1/* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18/****************************************************************************************
19Portions of this file are derived from the following 3GPP standard:
20
21    3GPP TS 26.173
22    ANSI-C code for the Adaptive Multi-Rate - Wideband (AMR-WB) speech codec
23    Available from http://www.3gpp.org
24
25(C) 2007, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
26Permission to distribute, modify and use this file under the standard license
27terms listed above has been obtained from the copyright holder.
28****************************************************************************************/
29#include "qisf_ns.h"
30
31
32/*
33 * Tables for function q_gain2()
34 *
35 *  g_pitch(Q14),  g_code(Q11)
36 *
37 * pitch gain are ordered in table to reduce complexity
38 * during quantization of gains.
39 */
40
41
42
43
44const int16 t_qua_gain6b[NB_QUA_GAIN6B*2] =
45{
46    1566,  1332,
47    1577,  3557,
48    3071,  6490,
49    4193, 10163,
50    4496,  2534,
51    5019,  4488,
52    5586, 15614,
53    5725,  1422,
54    6453,   580,
55    6724,  6831,
56    7657,  3527,
57    8072,  2099,
58    8232,  5319,
59    8827,  8775,
60    9740,  2868,
61    9856,  1465,
62    10087, 12488,
63    10241,  4453,
64    10859,  6618,
65    11321,  3587,
66    11417,  1800,
67    11643,  2428,
68    11718,   988,
69    12312,  5093,
70    12523,  8413,
71    12574, 26214,
72    12601,  3396,
73    13172,  1623,
74    13285,  2423,
75    13418,  6087,
76    13459, 12810,
77    13656,  3607,
78    14111,  4521,
79    14144,  1229,
80    14425,  1871,
81    14431,  7234,
82    14445,  2834,
83    14628, 10036,
84    14860, 17496,
85    15161,  3629,
86    15209,  5819,
87    15299,  2256,
88    15518,  4722,
89    15663,  1060,
90    15759,  7972,
91    15939, 11964,
92    16020,  2996,
93    16086,  1707,
94    16521,  4254,
95    16576,  6224,
96    16894,  2380,
97    16906,   681,
98    17213,  8406,
99    17610,  3418,
100    17895,  5269,
101    18168, 11748,
102    18230,  1575,
103    18607, 32767,
104    18728, 21684,
105    19137,  2543,
106    19422,  6577,
107    19446,  4097,
108    19450,  9056,
109    20371, 14885
110};
111
112const int16 t_qua_gain7b[NB_QUA_GAIN7B*2] =
113{
114    204,   441,
115    464,  1977,
116    869,  1077,
117    1072,  3062,
118    1281,  4759,
119    1647,  1539,
120    1845,  7020,
121    1853,   634,
122    1995,  2336,
123    2351, 15400,
124    2661,  1165,
125    2702,  3900,
126    2710, 10133,
127    3195,  1752,
128    3498,  2624,
129    3663,   849,
130    3984,  5697,
131    4214,  3399,
132    4415,  1304,
133    4695,  2056,
134    5376,  4558,
135    5386,   676,
136    5518, 23554,
137    5567,  7794,
138    5644,  3061,
139    5672,  1513,
140    5957,  2338,
141    6533,  1060,
142    6804,  5998,
143    6820,  1767,
144    6937,  3837,
145    7277,   414,
146    7305,  2665,
147    7466, 11304,
148    7942,   794,
149    8007,  1982,
150    8007,  1366,
151    8326,  3105,
152    8336,  4810,
153    8708,  7954,
154    8989,  2279,
155    9031,  1055,
156    9247,  3568,
157    9283,  1631,
158    9654,  6311,
159    9811,  2605,
160    10120,   683,
161    10143,  4179,
162    10245,  1946,
163    10335,  1218,
164    10468,  9960,
165    10651,  3000,
166    10951,  1530,
167    10969,  5290,
168    11203,  2305,
169    11325,  3562,
170    11771,  6754,
171    11839,  1849,
172    11941,  4495,
173    11954,  1298,
174    11975, 15223,
175    11977,   883,
176    11986,  2842,
177    12438,  2141,
178    12593,  3665,
179    12636,  8367,
180    12658,  1594,
181    12886,  2628,
182    12984,  4942,
183    13146,  1115,
184    13224,   524,
185    13341,  3163,
186    13399,  1923,
187    13549,  5961,
188    13606,  1401,
189    13655,  2399,
190    13782,  3909,
191    13868, 10923,
192    14226,  1723,
193    14232,  2939,
194    14278,  7528,
195    14439,  4598,
196    14451,   984,
197    14458,  2265,
198    14792,  1403,
199    14818,  3445,
200    14899,  5709,
201    15017, 15362,
202    15048,  1946,
203    15069,  2655,
204    15405,  9591,
205    15405,  4079,
206    15570,  7183,
207    15687,  2286,
208    15691,  1624,
209    15699,  3068,
210    15772,  5149,
211    15868,  1205,
212    15970,   696,
213    16249,  3584,
214    16338,  1917,
215    16424,  2560,
216    16483,  4438,
217    16529,  6410,
218    16620, 11966,
219    16839,  8780,
220    17030,  3050,
221    17033, 18325,
222    17092,  1568,
223    17123,  5197,
224    17351,  2113,
225    17374,   980,
226    17566, 26214,
227    17609,  3912,
228    17639, 32767,
229    18151,  7871,
230    18197,  2516,
231    18202,  5649,
232    18679,  3283,
233    18930,  1370,
234    19271, 13757,
235    19317,  4120,
236    19460,  1973,
237    19654, 10018,
238    19764,  6792,
239    19912,  5135,
240    20040,  2841,
241    21234, 19833
242};
243
244
245