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 /**************************************************************************************** 19 Portions of this file are derived from the following 3GPP standard: 20 21 3GPP TS 26.073 22 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 Available from http://www.3gpp.org 24 25 (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 Permission to distribute, modify and use this file under the standard license 27 terms listed above has been obtained from the copyright holder. 28 ****************************************************************************************/ 29 /* 30 31 32 33 Filename: /audio/gsm_amr/c/src/qgain475_tab.c 34 35 Date: 12/09/2002 36 37 ------------------------------------------------------------------------------ 38 REVISION HISTORY 39 40 Description: Created this file from the reference, qgain475.tab. 41 42 Description: Added #ifdef __cplusplus and removed "extern" from table 43 definition. 44 45 Description: Put "extern" back. 46 47 Description: 48 49 ------------------------------------------------------------------------------ 50 MODULE DESCRIPTION 51 52 ------------------------------------------------------------------------------ 53 */ 54 55 /*---------------------------------------------------------------------------- 56 ; INCLUDES 57 ----------------------------------------------------------------------------*/ 58 #include "qgain475_tab.h" 59 60 /*--------------------------------------------------------------------------*/ 61 #ifdef __cplusplus 62 extern "C" 63 { 64 #endif 65 66 /*---------------------------------------------------------------------------- 67 ; MACROS 68 ; [Define module specific macros here] 69 ----------------------------------------------------------------------------*/ 70 71 /*---------------------------------------------------------------------------- 72 ; DEFINES 73 ; [Include all pre-processor statements here. Include conditional 74 ; compile variables also.] 75 ----------------------------------------------------------------------------*/ 76 77 /*---------------------------------------------------------------------------- 78 ; LOCAL FUNCTION DEFINITIONS 79 ; [List function prototypes here] 80 ----------------------------------------------------------------------------*/ 81 82 /*---------------------------------------------------------------------------- 83 ; LOCAL VARIABLE DEFINITIONS 84 ; [Variable declaration - defined here and used outside this module] 85 ----------------------------------------------------------------------------*/ 86 87 /* The table contains the following data: 88 * 89 * g_pitch(0) (Q14) // for sub- 90 * g_fac(0) (Q12) // frame 0 and 2 91 * g_pitch(1) (Q14) // for sub- 92 * g_fac(2) (Q12) // frame 1 and 3 93 * 94 */ 95 const Word16 table_gain_MR475[MR475_VQ_SIZE*4] = 96 { 97 /*g_pit(0), g_fac(0), g_pit(1), g_fac(1) */ 98 812, 128, 542, 140, 99 2873, 1135, 2266, 3402, 100 2067, 563, 12677, 647, 101 4132, 1798, 5601, 5285, 102 7689, 374, 3735, 441, 103 10912, 2638, 11807, 2494, 104 20490, 797, 5218, 675, 105 6724, 8354, 5282, 1696, 106 1488, 428, 5882, 452, 107 5332, 4072, 3583, 1268, 108 2469, 901, 15894, 1005, 109 14982, 3271, 10331, 4858, 110 3635, 2021, 2596, 835, 111 12360, 4892, 12206, 1704, 112 13432, 1604, 9118, 2341, 113 3968, 1538, 5479, 9936, 114 3795, 417, 1359, 414, 115 3640, 1569, 7995, 3541, 116 11405, 645, 8552, 635, 117 4056, 1377, 16608, 6124, 118 11420, 700, 2007, 607, 119 12415, 1578, 11119, 4654, 120 13680, 1708, 11990, 1229, 121 7996, 7297, 13231, 5715, 122 2428, 1159, 2073, 1941, 123 6218, 6121, 3546, 1804, 124 8925, 1802, 8679, 1580, 125 13935, 3576, 13313, 6237, 126 6142, 1130, 5994, 1734, 127 14141, 4662, 11271, 3321, 128 12226, 1551, 13931, 3015, 129 5081, 10464, 9444, 6706, 130 1689, 683, 1436, 1306, 131 7212, 3933, 4082, 2713, 132 7793, 704, 15070, 802, 133 6299, 5212, 4337, 5357, 134 6676, 541, 6062, 626, 135 13651, 3700, 11498, 2408, 136 16156, 716, 12177, 751, 137 8065, 11489, 6314, 2256, 138 4466, 496, 7293, 523, 139 10213, 3833, 8394, 3037, 140 8403, 966, 14228, 1880, 141 8703, 5409, 16395, 4863, 142 7420, 1979, 6089, 1230, 143 9371, 4398, 14558, 3363, 144 13559, 2873, 13163, 1465, 145 5534, 1678, 13138, 14771, 146 7338, 600, 1318, 548, 147 4252, 3539, 10044, 2364, 148 10587, 622, 13088, 669, 149 14126, 3526, 5039, 9784, 150 15338, 619, 3115, 590, 151 16442, 3013, 15542, 4168, 152 15537, 1611, 15405, 1228, 153 16023, 9299, 7534, 4976, 154 1990, 1213, 11447, 1157, 155 12512, 5519, 9475, 2644, 156 7716, 2034, 13280, 2239, 157 16011, 5093, 8066, 6761, 158 10083, 1413, 5002, 2347, 159 12523, 5975, 15126, 2899, 160 18264, 2289, 15827, 2527, 161 16265, 10254, 14651, 11319, 162 1797, 337, 3115, 397, 163 3510, 2928, 4592, 2670, 164 7519, 628, 11415, 656, 165 5946, 2435, 6544, 7367, 166 8238, 829, 4000, 863, 167 10032, 2492, 16057, 3551, 168 18204, 1054, 6103, 1454, 169 5884, 7900, 18752, 3468, 170 1864, 544, 9198, 683, 171 11623, 4160, 4594, 1644, 172 3158, 1157, 15953, 2560, 173 12349, 3733, 17420, 5260, 174 6106, 2004, 2917, 1742, 175 16467, 5257, 16787, 1680, 176 17205, 1759, 4773, 3231, 177 7386, 6035, 14342, 10012, 178 4035, 442, 4194, 458, 179 9214, 2242, 7427, 4217, 180 12860, 801, 11186, 825, 181 12648, 2084, 12956, 6554, 182 9505, 996, 6629, 985, 183 10537, 2502, 15289, 5006, 184 12602, 2055, 15484, 1653, 185 16194, 6921, 14231, 5790, 186 2626, 828, 5615, 1686, 187 13663, 5778, 3668, 1554, 188 11313, 2633, 9770, 1459, 189 14003, 4733, 15897, 6291, 190 6278, 1870, 7910, 2285, 191 16978, 4571, 16576, 3849, 192 15248, 2311, 16023, 3244, 193 14459, 17808, 11847, 2763, 194 1981, 1407, 1400, 876, 195 4335, 3547, 4391, 4210, 196 5405, 680, 17461, 781, 197 6501, 5118, 8091, 7677, 198 7355, 794, 8333, 1182, 199 15041, 3160, 14928, 3039, 200 20421, 880, 14545, 852, 201 12337, 14708, 6904, 1920, 202 4225, 933, 8218, 1087, 203 10659, 4084, 10082, 4533, 204 2735, 840, 20657, 1081, 205 16711, 5966, 15873, 4578, 206 10871, 2574, 3773, 1166, 207 14519, 4044, 20699, 2627, 208 15219, 2734, 15274, 2186, 209 6257, 3226, 13125, 19480, 210 7196, 930, 2462, 1618, 211 4515, 3092, 13852, 4277, 212 10460, 833, 17339, 810, 213 16891, 2289, 15546, 8217, 214 13603, 1684, 3197, 1834, 215 15948, 2820, 15812, 5327, 216 17006, 2438, 16788, 1326, 217 15671, 8156, 11726, 8556, 218 3762, 2053, 9563, 1317, 219 13561, 6790, 12227, 1936, 220 8180, 3550, 13287, 1778, 221 16299, 6599, 16291, 7758, 222 8521, 2551, 7225, 2645, 223 18269, 7489, 16885, 2248, 224 17882, 2884, 17265, 3328, 225 9417, 20162, 11042, 8320, 226 1286, 620, 1431, 583, 227 5993, 2289, 3978, 3626, 228 5144, 752, 13409, 830, 229 5553, 2860, 11764, 5908, 230 10737, 560, 5446, 564, 231 13321, 3008, 11946, 3683, 232 19887, 798, 9825, 728, 233 13663, 8748, 7391, 3053, 234 2515, 778, 6050, 833, 235 6469, 5074, 8305, 2463, 236 6141, 1865, 15308, 1262, 237 14408, 4547, 13663, 4515, 238 3137, 2983, 2479, 1259, 239 15088, 4647, 15382, 2607, 240 14492, 2392, 12462, 2537, 241 7539, 2949, 12909, 12060, 242 5468, 684, 3141, 722, 243 5081, 1274, 12732, 4200, 244 15302, 681, 7819, 592, 245 6534, 2021, 16478, 8737, 246 13364, 882, 5397, 899, 247 14656, 2178, 14741, 4227, 248 14270, 1298, 13929, 2029, 249 15477, 7482, 15815, 4572, 250 2521, 2013, 5062, 1804, 251 5159, 6582, 7130, 3597, 252 10920, 1611, 11729, 1708, 253 16903, 3455, 16268, 6640, 254 9306, 1007, 9369, 2106, 255 19182, 5037, 12441, 4269, 256 15919, 1332, 15357, 3512, 257 11898, 14141, 16101, 6854, 258 2010, 737, 3779, 861, 259 11454, 2880, 3564, 3540, 260 9057, 1241, 12391, 896, 261 8546, 4629, 11561, 5776, 262 8129, 589, 8218, 588, 263 18728, 3755, 12973, 3149, 264 15729, 758, 16634, 754, 265 15222, 11138, 15871, 2208, 266 4673, 610, 10218, 678, 267 15257, 4146, 5729, 3327, 268 8377, 1670, 19862, 2321, 269 15450, 5511, 14054, 5481, 270 5728, 2888, 7580, 1346, 271 14384, 5325, 16236, 3950, 272 15118, 3744, 15306, 1435, 273 14597, 4070, 12301, 15696, 274 7617, 1699, 2170, 884, 275 4459, 4567, 18094, 3306, 276 12742, 815, 14926, 907, 277 15016, 4281, 15518, 8368, 278 17994, 1087, 2358, 865, 279 16281, 3787, 15679, 4596, 280 16356, 1534, 16584, 2210, 281 16833, 9697, 15929, 4513, 282 3277, 1085, 9643, 2187, 283 11973, 6068, 9199, 4462, 284 8955, 1629, 10289, 3062, 285 16481, 5155, 15466, 7066, 286 13678, 2543, 5273, 2277, 287 16746, 6213, 16655, 3408, 288 20304, 3363, 18688, 1985, 289 14172, 12867, 15154, 15703, 290 4473, 1020, 1681, 886, 291 4311, 4301, 8952, 3657, 292 5893, 1147, 11647, 1452, 293 15886, 2227, 4582, 6644, 294 6929, 1205, 6220, 799, 295 12415, 3409, 15968, 3877, 296 19859, 2109, 9689, 2141, 297 14742, 8830, 14480, 2599, 298 1817, 1238, 7771, 813, 299 19079, 4410, 5554, 2064, 300 3687, 2844, 17435, 2256, 301 16697, 4486, 16199, 5388, 302 8028, 2763, 3405, 2119, 303 17426, 5477, 13698, 2786, 304 19879, 2720, 9098, 3880, 305 18172, 4833, 17336, 12207, 306 5116, 996, 4935, 988, 307 9888, 3081, 6014, 5371, 308 15881, 1667, 8405, 1183, 309 15087, 2366, 19777, 7002, 310 11963, 1562, 7279, 1128, 311 16859, 1532, 15762, 5381, 312 14708, 2065, 20105, 2155, 313 17158, 8245, 17911, 6318, 314 5467, 1504, 4100, 2574, 315 17421, 6810, 5673, 2888, 316 16636, 3382, 8975, 1831, 317 20159, 4737, 19550, 7294, 318 6658, 2781, 11472, 3321, 319 19397, 5054, 18878, 4722, 320 16439, 2373, 20430, 4386, 321 11353, 26526, 11593, 3068, 322 2866, 1566, 5108, 1070, 323 9614, 4915, 4939, 3536, 324 7541, 878, 20717, 851, 325 6938, 4395, 16799, 7733, 326 10137, 1019, 9845, 964, 327 15494, 3955, 15459, 3430, 328 18863, 982, 20120, 963, 329 16876, 12887, 14334, 4200, 330 6599, 1220, 9222, 814, 331 16942, 5134, 5661, 4898, 332 5488, 1798, 20258, 3962, 333 17005, 6178, 17929, 5929, 334 9365, 3420, 7474, 1971, 335 19537, 5177, 19003, 3006, 336 16454, 3788, 16070, 2367, 337 8664, 2743, 9445, 26358, 338 10856, 1287, 3555, 1009, 339 5606, 3622, 19453, 5512, 340 12453, 797, 20634, 911, 341 15427, 3066, 17037, 10275, 342 18883, 2633, 3913, 1268, 343 19519, 3371, 18052, 5230, 344 19291, 1678, 19508, 3172, 345 18072, 10754, 16625, 6845, 346 3134, 2298, 10869, 2437, 347 15580, 6913, 12597, 3381, 348 11116, 3297, 16762, 2424, 349 18853, 6715, 17171, 9887, 350 12743, 2605, 8937, 3140, 351 19033, 7764, 18347, 3880, 352 20475, 3682, 19602, 3380, 353 13044, 19373, 10526, 23124 354 }; 355 356 357 /*--------------------------------------------------------------------------*/ 358 #ifdef __cplusplus 359 } 360 #endif 361 362 /* 363 ------------------------------------------------------------------------------ 364 FUNCTION NAME: 365 ------------------------------------------------------------------------------ 366 INPUT AND OUTPUT DEFINITIONS 367 368 Inputs: 369 None 370 371 Outputs: 372 None 373 374 Returns: 375 None 376 377 Global Variables Used: 378 None 379 380 Local Variables Needed: 381 None 382 383 ------------------------------------------------------------------------------ 384 FUNCTION DESCRIPTION 385 386 None 387 388 ------------------------------------------------------------------------------ 389 REQUIREMENTS 390 391 None 392 393 ------------------------------------------------------------------------------ 394 REFERENCES 395 396 [1] qua_gain.tab, UMTS GSM AMR speech codec, 397 R99 - Version 3.2.0, March 2, 2001 398 399 ------------------------------------------------------------------------------ 400 PSEUDO-CODE 401 402 403 ------------------------------------------------------------------------------ 404 RESOURCES USED [optional] 405 406 When the code is written for a specific target processor the 407 the resources used should be documented below. 408 409 HEAP MEMORY USED: x bytes 410 411 STACK MEMORY USED: x bytes 412 413 CLOCK CYCLES: (cycle count equation for this function) + (variable 414 used to represent cycle count for each subroutine 415 called) 416 where: (cycle count variable) = cycle count for [subroutine 417 name] 418 419 ------------------------------------------------------------------------------ 420 CAUTION [optional] 421 [State any special notes, constraints or cautions for users of this function] 422 423 ------------------------------------------------------------------------------ 424 */ 425 426 /*---------------------------------------------------------------------------- 427 ; FUNCTION CODE 428 ----------------------------------------------------------------------------*/ 429 430 431 432 433 434 435 436