1/*---------------------------------------------------------------------------*
2 *  mulaw.h  *
3 *                                                                           *
4 *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
5 *                                                                           *
6 *  Licensed under the Apache License, Version 2.0 (the 'License');          *
7 *  you may not use this file except in compliance with the License.         *
8 *                                                                           *
9 *  You may obtain a copy of the License at                                  *
10 *      http://www.apache.org/licenses/LICENSE-2.0                           *
11 *                                                                           *
12 *  Unless required by applicable law or agreed to in writing, software      *
13 *  distributed under the License is distributed on an 'AS IS' BASIS,        *
14 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
15 *  See the License for the specific language governing permissions and      *
16 *  limitations under the License.                                           *
17 *                                                                           *
18 *---------------------------------------------------------------------------*/
19
20/*
21**  The mu-law decoding table
22**  Published internally by Alan Christie, Dragon UK.
23*/
24
25#ifdef SET_RCSID
26static const char mulaw_h[] = "$Id: mulaw.h,v 1.2.10.3 2007/08/31 17:44:52 dahan Exp $";
27#endif
28
29static const short u_law[256] =
30  {
31    -8031, -7775, -7519, -7263, -7007, -6751, -6495, -6239, /* u-Law Table */
32    -5983, -5727, -5471, -5215, -4959, -4703, -4447, -4191,
33    -3999, -3871, -3743, -3615, -3487, -3359, -3231, -3103, /* To Convert  */
34    -2975, -2847, -2719, -2591, -2463, -2335, -2207, -2079, /* PEB Data to */
35    -1983, -1919, -1855, -1791, -1727, -1663, -1599, -1535, /* Linear for  */
36    -1471, -1407, -1343, -1279, -1215, -1151, -1087, -1023, /* Subsequent  */
37    -975,  -943,  -911,  -879,  -847,  -815,  -783,  -751, /* Processing  */
38    -719,  -687,  -655,  -623,  -591,  -559,  -527,  -495,
39    -471,  -455,  -439,  -423,  -407,  -391,  -375,  -359,
40    -343,  -327,  -311,  -295,  -279,  -263,  -247,  -231,
41    -219,  -211,  -203,  -195,  -187,  -179,  -171,  -163,
42    -155,  -147,  -139,  -131,  -123,  -115,  -107,   -99,
43    -93,   -89,   -85,   -81,   -77,   -73,   -69,   -65,
44    -61,   -57,   -53,   -49,   -45,   -41,   -37,   -33,
45    -30,   -28,   -26,   -24,   -22,   -20,   -18,   -16,
46    -14,   -12,   -10,    -8,    -6,    -4,    -2,     0,
47    8031,  7775,  7519,  7263,  7007,  6751,  6495,  6239,
48    5983,  5727,  5471,  5215,  4959,  4703,  4447,  4191,
49    3999,  3871,  3743,  3615,  3487,  3359,  3231,  3103,
50    2975,  2847,  2719,  2591,  2463,  2335,  2207,  2079,
51    1983,  1919,  1855,  1791,  1727,  1663,  1599,  1535,
52    1471,  1407,  1343,  1279,  1215,  1151,  1087,  1023,
53    975,   943,   911,   879,   847,   815,   783,   751,
54    719,   687,   655,   623,   591,   559,   527,   495,
55    471,   455,   439,   423,   407,   391,   375,   359,
56    343,   327,   311,   295,   279,   263,   247,   231,
57    219,   211,   203,   195,   187,   179,   171,   163,
58    155,   147,   139,   131,   123,   115,   107,    99,
59    93,    89,    85,    81,    77,    73,    69,    65,
60    61,    57,    53,    49,    45,    41,    37,    33,
61    30,    28,    26,    24,    22,    20,    18,    16,
62    14,    12,    10,     8,     6,     4,     2,     0
63  };
64
65#define MULAW_TO_LINEAR(X) u_law[(X)]
66