qua_gain.tab 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. ********************************************************************************
  3. *
  4. * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
  5. * R99 Version 3.3.0
  6. * REL-4 Version 4.1.0
  7. *
  8. ********************************************************************************
  9. *
  10. * File : qua_gain.tab
  11. * Purpose : Tables for function Qua_gain()
  12. * $Id $
  13. *
  14. ********************************************************************************
  15. */
  16. /* The tables contains the following data:
  17. g_pitch (Q14),
  18. g_fac (Q12), (g_code = g_code0*g_fac),
  19. qua_ener_MR122 (Q10), (log2(g_fac))
  20. qua_ener (Q10) (20*log10(g_fac))
  21. The log2() and log10() values are calculated on the fixed point value
  22. (g_fac Q12) and not on the original floating point value of g_fac
  23. to make the quantizer/MA predictdor use corresponding values.
  24. */
  25. /* table used in 'high' rates: MR67 MR74 */
  26. #define VQ_SIZE_HIGHRATES 128
  27. static const Word16 table_gain_highrates[VQ_SIZE_HIGHRATES*4] = {
  28. /* Note: column 4 (qua_ener) contains the original values from IS641
  29. to ensure bit-exactness; however, they are not exactly the
  30. rounded value of (20*log10(g_fac)) */
  31. /*g_pit, g_fac, qua_ener_MR122, qua_ener */
  32. 577, 662, -2692, -16214,
  33. 806, 1836, -1185, -7135,
  34. 3109, 1052, -2008, -12086,
  35. 4181, 1387, -1600, -9629,
  36. 2373, 1425, -1560, -9394,
  37. 3248, 1985, -1070, -6442,
  38. 1827, 2320, -840, -5056,
  39. 941, 3314, -313, -1885,
  40. 2351, 2977, -471, -2838,
  41. 3616, 2420, -777, -4681,
  42. 3451, 3096, -414, -2490,
  43. 2955, 4301, 72, 434,
  44. 1848, 4500, 139, 836,
  45. 3884, 5416, 413, 2484,
  46. 1187, 7210, 835, 5030,
  47. 3083, 9000, 1163, 7002,
  48. 7384, 883, -2267, -13647,
  49. 5962, 1506, -1478, -8900,
  50. 5155, 2134, -963, -5800,
  51. 7944, 2009, -1052, -6335,
  52. 6507, 2250, -885, -5327,
  53. 7670, 2752, -588, -3537,
  54. 5952, 3016, -452, -2724,
  55. 4898, 3764, -125, -751,
  56. 6989, 3588, -196, -1177,
  57. 8174, 3978, -43, -260,
  58. 6064, 4404, 107, 645,
  59. 7709, 5087, 320, 1928,
  60. 5523, 6021, 569, 3426,
  61. 7769, 7126, 818, 4926,
  62. 6060, 7938, 977, 5885,
  63. 5594, 11487, 1523, 9172,
  64. 10581, 1356, -1633, -9831,
  65. 9049, 1597, -1391, -8380,
  66. 9794, 2035, -1033, -6220,
  67. 8946, 2415, -780, -4700,
  68. 10296, 2584, -681, -4099,
  69. 9407, 2734, -597, -3595,
  70. 8700, 3218, -356, -2144,
  71. 9757, 3395, -277, -1669,
  72. 10177, 3892, -75, -454,
  73. 9170, 4528, 148, 891,
  74. 10152, 5004, 296, 1781,
  75. 9114, 5735, 497, 2993,
  76. 10500, 6266, 628, 3782,
  77. 10110, 7631, 919, 5534,
  78. 8844, 8727, 1117, 6728,
  79. 8956, 12496, 1648, 9921,
  80. 12924, 976, -2119, -12753,
  81. 11435, 1755, -1252, -7539,
  82. 12138, 2328, -835, -5024,
  83. 11388, 2368, -810, -4872,
  84. 10700, 3064, -429, -2580,
  85. 12332, 2861, -530, -3192,
  86. 11722, 3327, -307, -1848,
  87. 11270, 3700, -150, -904,
  88. 10861, 4413, 110, 663,
  89. 12082, 4533, 150, 902,
  90. 11283, 5205, 354, 2132,
  91. 11960, 6305, 637, 3837,
  92. 11167, 7534, 900, 5420,
  93. 12128, 8329, 1049, 6312,
  94. 10969, 10777, 1429, 8604,
  95. 10300, 17376, 2135, 12853,
  96. 13899, 1681, -1316, -7921,
  97. 12580, 2045, -1026, -6179,
  98. 13265, 2439, -766, -4610,
  99. 14033, 2989, -465, -2802,
  100. 13452, 3098, -413, -2482,
  101. 12396, 3658, -167, -1006,
  102. 13510, 3780, -119, -713,
  103. 12880, 4272, 62, 374,
  104. 13533, 4861, 253, 1523,
  105. 12667, 5457, 424, 2552,
  106. 13854, 6106, 590, 3551,
  107. 13031, 6483, 678, 4084,
  108. 13557, 7721, 937, 5639,
  109. 12957, 9311, 1213, 7304,
  110. 13714, 11551, 1532, 9221,
  111. 12591, 15206, 1938, 11667,
  112. 15113, 1540, -1445, -8700,
  113. 15072, 2333, -832, -5007,
  114. 14527, 2511, -723, -4352,
  115. 14692, 3199, -365, -2197,
  116. 15382, 3560, -207, -1247,
  117. 14133, 3960, -50, -300,
  118. 15102, 4236, 50, 298,
  119. 14332, 4824, 242, 1454,
  120. 14846, 5451, 422, 2542,
  121. 15306, 6083, 584, 3518,
  122. 14329, 6888, 768, 4623,
  123. 15060, 7689, 930, 5602,
  124. 14406, 9426, 1231, 7413,
  125. 15387, 9741, 1280, 7706,
  126. 14824, 14271, 1844, 11102,
  127. 13600, 24939, 2669, 16067,
  128. 16396, 1969, -1082, -6517,
  129. 16817, 2832, -545, -3283,
  130. 15713, 2843, -539, -3248,
  131. 16104, 3336, -303, -1825,
  132. 16384, 3963, -49, -294,
  133. 16940, 4579, 165, 992,
  134. 15711, 4599, 171, 1030,
  135. 16222, 5448, 421, 2537,
  136. 16832, 6382, 655, 3945,
  137. 15745, 7141, 821, 4944,
  138. 16326, 7469, 888, 5343,
  139. 16611, 8624, 1100, 6622,
  140. 17028, 10418, 1379, 8303,
  141. 15905, 11817, 1565, 9423,
  142. 16878, 14690, 1887, 11360,
  143. 16515, 20870, 2406, 14483,
  144. 18142, 2083, -999, -6013,
  145. 19401, 3178, -375, -2257,
  146. 17508, 3426, -264, -1589,
  147. 20054, 4027, -25, -151,
  148. 18069, 4249, 54, 326,
  149. 18952, 5066, 314, 1890,
  150. 17711, 5402, 409, 2461,
  151. 19835, 6192, 610, 3676,
  152. 17950, 7014, 795, 4784,
  153. 21318, 7877, 966, 5816,
  154. 17910, 9289, 1210, 7283,
  155. 19144, 9290, 1210, 7284,
  156. 20517, 11381, 1510, 9089,
  157. 18075, 14485, 1866, 11234,
  158. 19999, 17882, 2177, 13108,
  159. 18842, 32764, 3072, 18494
  160. };
  161. /* table used in 'low' rates: MR475, MR515, MR59 */
  162. #define VQ_SIZE_LOWRATES 64
  163. static const Word16 table_gain_lowrates[VQ_SIZE_LOWRATES*4] = {
  164. /*g_pit, g_fac, qua_ener_MR122, qua_ener */
  165. 10813, 28753, 2879, 17333,
  166. 20480, 2785, -570, -3431,
  167. 18841, 6594, 703, 4235,
  168. 6225, 7413, 876, 5276,
  169. 17203, 10444, 1383, 8325,
  170. 21626, 1269, -1731, -10422,
  171. 21135, 4423, 113, 683,
  172. 11304, 1556, -1430, -8609,
  173. 19005, 12820, 1686, 10148,
  174. 17367, 2498, -731, -4398,
  175. 17858, 4833, 244, 1472,
  176. 9994, 2498, -731, -4398,
  177. 17530, 7864, 964, 5802,
  178. 14254, 1884, -1147, -6907,
  179. 15892, 3153, -387, -2327,
  180. 6717, 1802, -1213, -7303,
  181. 18186, 20193, 2357, 14189,
  182. 18022, 3031, -445, -2678,
  183. 16711, 5857, 528, 3181,
  184. 8847, 4014, -30, -180,
  185. 15892, 8970, 1158, 6972,
  186. 18022, 1392, -1594, -9599,
  187. 16711, 4096, 0, 0,
  188. 8192, 655, -2708, -16305,
  189. 15237, 13926, 1808, 10884,
  190. 14254, 3112, -406, -2444,
  191. 14090, 4669, 193, 1165,
  192. 5406, 2703, -614, -3697,
  193. 13434, 6553, 694, 4180,
  194. 12451, 901, -2237, -13468,
  195. 12451, 2662, -637, -3833,
  196. 3768, 655, -2708, -16305,
  197. 14745, 23511, 2582, 15543,
  198. 19169, 2457, -755, -4546,
  199. 20152, 5079, 318, 1913,
  200. 6881, 4096, 0, 0,
  201. 20480, 8560, 1089, 6556,
  202. 19660, 737, -2534, -15255,
  203. 19005, 4259, 58, 347,
  204. 7864, 2088, -995, -5993,
  205. 11468, 12288, 1623, 9771,
  206. 15892, 1474, -1510, -9090,
  207. 15728, 4628, 180, 1086,
  208. 9175, 1433, -1552, -9341,
  209. 16056, 7004, 793, 4772,
  210. 14827, 737, -2534, -15255,
  211. 15073, 2252, -884, -5321,
  212. 5079, 1228, -1780, -10714,
  213. 13271, 17326, 2131, 12827,
  214. 16547, 2334, -831, -5002,
  215. 15073, 5816, 518, 3118,
  216. 3932, 3686, -156, -938,
  217. 14254, 8601, 1096, 6598,
  218. 16875, 778, -2454, -14774,
  219. 15073, 3809, -107, -646,
  220. 6062, 614, -2804, -16879,
  221. 9338, 9256, 1204, 7251,
  222. 13271, 1761, -1247, -7508,
  223. 13271, 3522, -223, -1343,
  224. 2457, 1966, -1084, -6529,
  225. 11468, 5529, 443, 2668,
  226. 10485, 737, -2534, -15255,
  227. 11632, 3194, -367, -2212,
  228. 1474, 778, -2454, -14774
  229. };