g723_1.h 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  1. /*
  2. * G.723.1 common header and data tables
  3. * Copyright (c) 2006 Benjamin Larsson
  4. * Copyright (c) 2010 Mohamed Naufal Basheer
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /**
  23. * @file
  24. * G.723.1 types, functions and data tables
  25. */
  26. #ifndef AVCODEC_G723_1_H
  27. #define AVCODEC_G723_1_H
  28. #include <stdint.h>
  29. #include "libavutil/log.h"
  30. #define SUBFRAMES 4
  31. #define SUBFRAME_LEN 60
  32. #define FRAME_LEN (SUBFRAME_LEN << 2)
  33. #define HALF_FRAME_LEN (FRAME_LEN / 2)
  34. #define LPC_FRAME (HALF_FRAME_LEN + SUBFRAME_LEN)
  35. #define LPC_ORDER 10
  36. #define LSP_BANDS 3
  37. #define LSP_CB_SIZE 256
  38. #define PITCH_MIN 18
  39. #define PITCH_MAX (PITCH_MIN + 127)
  40. #define PITCH_ORDER 5
  41. #define GRID_SIZE 2
  42. #define PULSE_MAX 6
  43. #define GAIN_LEVELS 24
  44. #define COS_TBL_SIZE 512
  45. /**
  46. * Bitexact implementation of 2ab scaled by 1/2^16.
  47. *
  48. * @param a 32 bit multiplicand
  49. * @param b 16 bit multiplier
  50. */
  51. #define MULL2(a, b) \
  52. ((((a) >> 16) * (b) * 2) + (((a) & 0xffff) * (b) >> 15))
  53. /**
  54. * G723.1 frame types
  55. */
  56. enum FrameType {
  57. ACTIVE_FRAME, ///< Active speech
  58. SID_FRAME, ///< Silence Insertion Descriptor frame
  59. UNTRANSMITTED_FRAME
  60. };
  61. /**
  62. * G723.1 rate values
  63. */
  64. enum Rate {
  65. RATE_6300,
  66. RATE_5300
  67. };
  68. /**
  69. * G723.1 unpacked data subframe
  70. */
  71. typedef struct G723_1_Subframe {
  72. int ad_cb_lag; ///< adaptive codebook lag
  73. int ad_cb_gain;
  74. int dirac_train;
  75. int pulse_sign;
  76. int grid_index;
  77. int amp_index;
  78. int pulse_pos;
  79. } G723_1_Subframe;
  80. /**
  81. * Pitch postfilter parameters
  82. */
  83. typedef struct PPFParam {
  84. int index; ///< postfilter backward/forward lag
  85. int16_t opt_gain; ///< optimal gain
  86. int16_t sc_gain; ///< scaling gain
  87. } PPFParam;
  88. /**
  89. * Harmonic filter parameters
  90. */
  91. typedef struct HFParam {
  92. int index;
  93. int gain;
  94. } HFParam;
  95. /**
  96. * Optimized fixed codebook excitation parameters
  97. */
  98. typedef struct FCBParam {
  99. int min_err;
  100. int amp_index;
  101. int grid_index;
  102. int dirac_train;
  103. int pulse_pos[PULSE_MAX];
  104. int pulse_sign[PULSE_MAX];
  105. } FCBParam;
  106. typedef struct G723_1_ChannelContext {
  107. G723_1_Subframe subframe[4];
  108. enum FrameType cur_frame_type;
  109. enum FrameType past_frame_type;
  110. enum Rate cur_rate;
  111. uint8_t lsp_index[LSP_BANDS];
  112. int pitch_lag[2];
  113. int erased_frames;
  114. int16_t prev_lsp[LPC_ORDER];
  115. int16_t sid_lsp[LPC_ORDER];
  116. int16_t prev_excitation[PITCH_MAX];
  117. int16_t excitation[PITCH_MAX + FRAME_LEN + 4];
  118. int16_t synth_mem[LPC_ORDER];
  119. int16_t fir_mem[LPC_ORDER];
  120. int iir_mem[LPC_ORDER];
  121. int random_seed;
  122. int cng_random_seed;
  123. int interp_index;
  124. int interp_gain;
  125. int sid_gain;
  126. int cur_gain;
  127. int reflection_coef;
  128. int pf_gain; ///< formant postfilter
  129. ///< gain scaling unit memory
  130. int16_t audio[FRAME_LEN + LPC_ORDER + PITCH_MAX + 4];
  131. /* encoder */
  132. int16_t prev_data[HALF_FRAME_LEN];
  133. int16_t prev_weight_sig[PITCH_MAX];
  134. int16_t hpf_fir_mem; ///< highpass filter fir
  135. int hpf_iir_mem; ///< and iir memories
  136. int16_t perf_fir_mem[LPC_ORDER]; ///< perceptual filter fir
  137. int16_t perf_iir_mem[LPC_ORDER]; ///< and iir memories
  138. int16_t harmonic_mem[PITCH_MAX];
  139. } G723_1_ChannelContext;
  140. typedef struct G723_1_Context {
  141. AVClass *class;
  142. int postfilter;
  143. G723_1_ChannelContext ch[2];
  144. } G723_1_Context;
  145. /**
  146. * Scale vector contents based on the largest of their absolutes.
  147. */
  148. int ff_g723_1_scale_vector(int16_t *dst, const int16_t *vector, int length);
  149. /**
  150. * Calculate the number of left-shifts required for normalizing the input.
  151. *
  152. * @param num input number
  153. * @param width width of the input, 16 bits(0) / 32 bits(1)
  154. */
  155. int ff_g723_1_normalize_bits(int num, int width);
  156. int ff_g723_1_dot_product(const int16_t *a, const int16_t *b, int length);
  157. /**
  158. * Get delayed contribution from the previous excitation vector.
  159. */
  160. void ff_g723_1_get_residual(int16_t *residual, int16_t *prev_excitation,
  161. int lag);
  162. /**
  163. * Generate a train of dirac functions with period as pitch lag.
  164. */
  165. void ff_g723_1_gen_dirac_train(int16_t *buf, int pitch_lag);
  166. /**
  167. * Generate adaptive codebook excitation.
  168. */
  169. void ff_g723_1_gen_acb_excitation(int16_t *vector, int16_t *prev_excitation,
  170. int pitch_lag, G723_1_Subframe *subfrm,
  171. enum Rate cur_rate);
  172. /**
  173. * Quantize LSP frequencies by interpolation and convert them to
  174. * the corresponding LPC coefficients.
  175. *
  176. * @param lpc buffer for LPC coefficients
  177. * @param cur_lsp the current LSP vector
  178. * @param prev_lsp the previous LSP vector
  179. */
  180. void ff_g723_1_lsp_interpolate(int16_t *lpc, int16_t *cur_lsp,
  181. int16_t *prev_lsp);
  182. /**
  183. * Perform inverse quantization of LSP frequencies.
  184. *
  185. * @param cur_lsp the current LSP vector
  186. * @param prev_lsp the previous LSP vector
  187. * @param lsp_index VQ indices
  188. * @param bad_frame bad frame flag
  189. */
  190. void ff_g723_1_inverse_quant(int16_t *cur_lsp, int16_t *prev_lsp,
  191. uint8_t *lsp_index, int bad_frame);
  192. static const uint8_t frame_size[4] = { 24, 20, 4, 1 };
  193. /**
  194. * Postfilter gain weighting factors scaled by 2^15
  195. */
  196. static const int16_t ppf_gain_weight[2] = {0x1800, 0x2000};
  197. /**
  198. * LSP DC component
  199. */
  200. static const int16_t dc_lsp[LPC_ORDER] = {
  201. 0x0c3b,
  202. 0x1271,
  203. 0x1e0a,
  204. 0x2a36,
  205. 0x3630,
  206. 0x406f,
  207. 0x4d28,
  208. 0x56f4,
  209. 0x638c,
  210. 0x6c46
  211. };
  212. /* Cosine table scaled by 2^14 */
  213. static const int16_t cos_tab[COS_TBL_SIZE + 1] = {
  214. 16384, 16383, 16379, 16373, 16364, 16353, 16340, 16324,
  215. 16305, 16284, 16261, 16235, 16207, 16176, 16143, 16107,
  216. 16069, 16029, 15986, 15941, 15893, 15843, 15791, 15736,
  217. 15679, 15619, 15557, 15493, 15426, 15357, 15286, 15213,
  218. 15137, 15059, 14978, 14896, 14811, 14724, 14635, 14543,
  219. 14449, 14354, 14256, 14155, 14053, 13949, 13842, 13733,
  220. 13623, 13510, 13395, 13279, 13160, 13039, 12916, 12792,
  221. 12665, 12537, 12406, 12274, 12140, 12004, 11866, 11727,
  222. 11585, 11442, 11297, 11151, 11003, 10853, 10702, 10549,
  223. 10394, 10238, 10080, 9921, 9760, 9598, 9434, 9269,
  224. 9102, 8935, 8765, 8595, 8423, 8250, 8076, 7900,
  225. 7723, 7545, 7366, 7186, 7005, 6823, 6639, 6455,
  226. 6270, 6084, 5897, 5708, 5520, 5330, 5139, 4948,
  227. 4756, 4563, 4370, 4176, 3981, 3786, 3590, 3393,
  228. 3196, 2999, 2801, 2603, 2404, 2205, 2006, 1806,
  229. 1606, 1406, 1205, 1005, 804, 603, 402, 201,
  230. 0, -201, -402, -603, -804, -1005, -1205, -1406,
  231. -1606, -1806, -2006, -2205, -2404, -2603, -2801, -2999,
  232. -3196, -3393, -3590, -3786, -3981, -4176, -4370, -4563,
  233. -4756, -4948, -5139, -5330, -5520, -5708, -5897, -6084,
  234. -6270, -6455, -6639, -6823, -7005, -7186, -7366, -7545,
  235. -7723, -7900, -8076, -8250, -8423, -8595, -8765, -8935,
  236. -9102, -9269, -9434, -9598, -9760, -9921, -10080, -10238,
  237. -10394, -10549, -10702, -10853, -11003, -11151, -11297, -11442,
  238. -11585, -11727, -11866, -12004, -12140, -12274, -12406, -12537,
  239. -12665, -12792, -12916, -13039, -13160, -13279, -13395, -13510,
  240. -13623, -13733, -13842, -13949, -14053, -14155, -14256, -14354,
  241. -14449, -14543, -14635, -14724, -14811, -14896, -14978, -15059,
  242. -15137, -15213, -15286, -15357, -15426, -15493, -15557, -15619,
  243. -15679, -15736, -15791, -15843, -15893, -15941, -15986, -16029,
  244. -16069, -16107, -16143, -16176, -16207, -16235, -16261, -16284,
  245. -16305, -16324, -16340, -16353, -16364, -16373, -16379, -16383,
  246. -16384, -16383, -16379, -16373, -16364, -16353, -16340, -16324,
  247. -16305, -16284, -16261, -16235, -16207, -16176, -16143, -16107,
  248. -16069, -16029, -15986, -15941, -15893, -15843, -15791, -15736,
  249. -15679, -15619, -15557, -15493, -15426, -15357, -15286, -15213,
  250. -15137, -15059, -14978, -14896, -14811, -14724, -14635, -14543,
  251. -14449, -14354, -14256, -14155, -14053, -13949, -13842, -13733,
  252. -13623, -13510, -13395, -13279, -13160, -13039, -12916, -12792,
  253. -12665, -12537, -12406, -12274, -12140, -12004, -11866, -11727,
  254. -11585, -11442, -11297, -11151, -11003, -10853, -10702, -10549,
  255. -10394, -10238, -10080, -9921, -9760, -9598, -9434, -9269,
  256. -9102, -8935, -8765, -8595, -8423, -8250, -8076, -7900,
  257. -7723, -7545, -7366, -7186, -7005, -6823, -6639, -6455,
  258. -6270, -6084, -5897, -5708, -5520, -5330, -5139, -4948,
  259. -4756, -4563, -4370, -4176, -3981, -3786, -3590, -3393,
  260. -3196, -2999, -2801, -2603, -2404, -2205, -2006, -1806,
  261. -1606, -1406, -1205, -1005, -804, -603, -402, -201,
  262. 0, 201, 402, 603, 804, 1005, 1205, 1406,
  263. 1606, 1806, 2006, 2205, 2404, 2603, 2801, 2999,
  264. 3196, 3393, 3590, 3786, 3981, 4176, 4370, 4563,
  265. 4756, 4948, 5139, 5330, 5520, 5708, 5897, 6084,
  266. 6270, 6455, 6639, 6823, 7005, 7186, 7366, 7545,
  267. 7723, 7900, 8076, 8250, 8423, 8595, 8765, 8935,
  268. 9102, 9269, 9434, 9598, 9760, 9921, 10080, 10238,
  269. 10394, 10549, 10702, 10853, 11003, 11151, 11297, 11442,
  270. 11585, 11727, 11866, 12004, 12140, 12274, 12406, 12537,
  271. 12665, 12792, 12916, 13039, 13160, 13279, 13395, 13510,
  272. 13623, 13733, 13842, 13949, 14053, 14155, 14256, 14354,
  273. 14449, 14543, 14635, 14724, 14811, 14896, 14978, 15059,
  274. 15137, 15213, 15286, 15357, 15426, 15493, 15557, 15619,
  275. 15679, 15736, 15791, 15843, 15893, 15941, 15986, 16029,
  276. 16069, 16107, 16143, 16176, 16207, 16235, 16261, 16284,
  277. 16305, 16324, 16340, 16353, 16364, 16373, 16379, 16383,
  278. 16384
  279. };
  280. /**
  281. * LSP VQ tables
  282. */
  283. static const int16_t lsp_band0[LSP_CB_SIZE][3] = {
  284. { 0, 0, 0}, { -270, -1372, -1032}, { -541, -1650, -1382},
  285. { -723, -2011, -2213}, { -941, -1122, -1942}, { -780, -1145, -2454},
  286. { -884, -1309, -1373}, {-1051, -1523, -1766}, {-1083, -1622, -2300},
  287. { -777, -1377, -2147}, { -935, -1467, -2763}, { -802, -1327, -3471},
  288. { -935, -1959, -3999}, { -240, -89, 222}, { -661, -257, -160},
  289. { -994, -466, -419}, { -188, -164, -278}, { -342, -512, -415},
  290. { -607, -511, -797}, { 16, 19, -716}, { 374, 425, -972},
  291. { -346, 245, -282}, { -265, 506, -754}, { -620, -147, 1955},
  292. { -742, -860, 2597}, { -150, -352, 2704}, { 305, 880, 1954},
  293. { 123, 731, 2766}, { -348, 765, 3327}, { 618, 221, 3258},
  294. { -178, -47, 4219}, { 393, 1304, 3842}, { 698, 1702, 4801},
  295. { 63, -584, 1229}, { -215, -732, 1704}, { 172, -335, 1909},
  296. { -2, 216, 1797}, { 353, 127, 2205}, {-1208, 188, 11},
  297. { -513, -75, -683}, { -973, 222, -646}, { -616, -843, -388},
  298. { -950, -1113, -359}, {-1431, -623, -705}, {-1398, -1063, -178},
  299. { -45, -461, 35}, { -9, -657, -216}, { 127, -1078, 95},
  300. { -950, -1156, 584}, {-1480, -1494, 449}, { -120, -705, 516},
  301. { -368, -961, 727}, { -378, -526, 973}, { -793, -614, 676},
  302. { -801, -755, 1287}, {-1476, -340, 1636}, { -505, -1254, 1543},
  303. {-1243, -1622, 1532}, { -776, -1477, -655}, {-1151, -1296, -823},
  304. {-1153, -1672, -1124}, {-1291, -2003, -1702}, { -622, -1283, 57},
  305. { -471, -1611, 509}, {-1060, -1570, -139}, { -873, -2156, -536},
  306. {-1716, -2021, -364}, {-2150, -3218, -1291}, {-1248, -1945, -2904},
  307. {-1215, -2633, -2855}, { 167, -244, 84}, { 349, -412, -217},
  308. { -40, -352, 632}, { 227, -529, 405}, { 68, -383, -443},
  309. { 167, -558, -706}, { -275, -854, -14}, { -351, -1089, -449},
  310. { 341, -72, -289}, { 603, -106, -474}, { 322, -219, -649},
  311. { 179, -317, -998}, { 450, -291, -996}, { 555, 195, -525},
  312. { 784, 272, -831}, { -148, -384, -849}, { 82, -536, -1357},
  313. { 238, -172, -1354}, { 422, -268, -1841}, { 297, -737, -2079},
  314. { -111, -801, -598}, { 1, -668, -984}, { -131, -818, -1299},
  315. { -329, -521, -1310}, { -151, -778, -1834}, { -93, -352, -1746},
  316. { -568, -640, -1821}, { -509, -941, -2183}, { 464, -815, -1250},
  317. { 79, -1133, -1597}, { -184, -1353, -2123}, { -196, -410, -2427},
  318. { -192, -833, -2810}, { -259, -1382, -3045}, { -217, 4, -1166},
  319. { -800, -325, -1219}, { -363, -830, -898}, { -661, -1134, -960},
  320. { -386, -980, -1501}, { -627, -1159, -1722}, { -903, -829, -855},
  321. { -685, -829, -1313}, {-1065, -959, -1405}, { 441, 25, -847},
  322. { 655, -27, -1181}, { 1159, -110, -705}, { 856, 253, -1671},
  323. { 415, 404, -1}, { 322, 903, -398}, { 670, 499, -292},
  324. { 803, 591, -610}, { 1144, 591, -814}, { 717, 183, 393},
  325. { 857, 381, 106}, { 609, 62, -27}, { 792, 198, -325},
  326. { 735, 805, 88}, { 1142, 812, 78}, { 1028, 366, -292},
  327. { 1309, 743, -237}, { 1615, 589, -79}, { 1010, 639, -243},
  328. { 999, 964, -311}, { 1500, 1137, -615}, { 988, 357, 646},
  329. { 1227, 667, 683}, { 1164, 1565, 894}, { 1392, 2015, 477},
  330. { 1138, 533, 250}, { 1437, 896, 391}, { 1765, 1118, 99},
  331. { 1112, 1090, 802}, { 1596, 846, 1134}, { 937, 1161, 279},
  332. { 1719, 1254, 683}, { 1338, 1086, 35}, { 1419, 1324, 428},
  333. { 1428, 1524, 40}, { 2108, 1594, 89}, { 1015, 544, 1222},
  334. { 1121, 925, 1263}, { 1030, 1318, 1485}, { 1295, 789, 1817},
  335. { 1323, 1272, 1909}, { 1724, 1237, 1803}, { 1797, 1689, 858},
  336. { 2149, 1367, 1301}, { 2302, 1867, 761}, { 2863, 2351, 1053},
  337. { 52, 163, -76}, { 230, 309, -492}, { -71, 619, 39},
  338. { -218, 856, 499}, { -654, 736, -207}, { -535, 1259, 155},
  339. { -480, 1476, 643}, { 262, 1081, 102}, { 309, 1592, -182},
  340. { 627, 1629, 534}, { 337, 643, 456}, { 758, 670, 713},
  341. { 202, 1126, 658}, { 612, 1131, 666}, { 686, 1223, 1136},
  342. { -131, 377, 525}, { 42, 708, 907}, { 87, 1488, 1035},
  343. { 432, 2117, 904}, { 137, 981, 1332}, { -447, 1014, 1136},
  344. { -839, 1793, 1246}, { -559, 297, 198}, { -850, 685, 446},
  345. {-1273, 632, 826}, { -401, -544, 173}, { -753, -793, 144},
  346. { -436, -9, 772}, { -115, -243, 1310}, { -670, -269, 374},
  347. {-1027, -13, 639}, { -887, -81, 1137}, {-1277, -455, 158},
  348. {-1411, -720, 736}, { 172, 88, 403}, { 386, 255, 756},
  349. { -500, 522, 910}, { -958, 659, 1388}, { -395, 301, 1344},
  350. { -356, 768, 1813}, { -613, 841, 2419}, { 445, -122, 252},
  351. { 629, -87, 723}, { 283, -253, 870}, { 456, -116, 1381},
  352. { 757, 180, 1059}, { 532, 408, 1509}, { 947, 288, 1806},
  353. { 1325, 994, 2524}, { 892, 1219, 3023}, { 1397, 1596, 3406},
  354. { 1143, 1552, 2546}, { 1850, 1433, 2710}, { -10, 134, 1002},
  355. { 154, 499, 1323}, { 508, 792, 1117}, { 509, 1340, 1616},
  356. { 762, 862, 1608}, { 787, 740, 2320}, { 794, 1727, 1283},
  357. { 465, 2108, 1660}, { -120, 1451, 1613}, { -386, 2016, 2169},
  358. { 891, 1225, 2050}, { 456, 1480, 2185}, { 1493, 1283, 1209},
  359. { 1397, 1636, 1518}, { 1776, 1738, 1552}, { 1572, 1698, 2141},
  360. { 1389, 2126, 1271}, { 1959, 2413, 1119}, { 1365, 2892, 1505},
  361. { 2206, 1971, 1623}, { 2076, 1950, 2280}, { 1717, 2291, 1867},
  362. { 2366, 2515, 1953}, { 2865, 2838, 2522}, { 2535, 3465, 2011},
  363. { 3381, 4127, 2638}, { 836, 2667, 2289}, { 1761, 2773, 2337},
  364. { 1415, 3325, 2911}, { 2354, 3138, 3126}, { 2659, 4192, 4010},
  365. { 1048, 1786, 1818}, { 1242, 2111, 2240}, { 1512, 2079, 2780},
  366. { 1573, 2491, 3138}, { 2230, 2377, 2782}, { 416, 1773, 2704},
  367. { 725, 2336, 3297}, { 1252, 2373, 3978}, { 2094, 2268, 3568},
  368. { 2011, 2712, 4528}, { 1341, 3507, 3876}, { 1216, 3919, 4922},
  369. { 1693, 4793, 6012}
  370. };
  371. static const int16_t lsp_band1[LSP_CB_SIZE][3] = {
  372. { 0, 0, 0}, {-2114, -1302, 76}, {-2652, -1278, -1368},
  373. {-2847, -828, -349}, {-3812, -2190, -349}, {-3946, -364, -449},
  374. {-2725, -4492, -3607}, {-3495, -4764, -1744}, { -51, -756, 84},
  375. { -153, -1191, 504}, { 108, -1418, 1167}, { -835, -896, 390},
  376. { -569, -1702, 87}, {-1151, -1818, 933}, {-1826, -2547, 411},
  377. {-1842, -1818, 1451}, {-2438, -1611, 781}, {-2747, -2477, 1311},
  378. { -940, 1252, 477}, {-1629, 1688, 602}, {-1202, 617, 280},
  379. {-1737, 393, 580}, {-1528, 1077, 1199}, {-2165, -161, 1408},
  380. {-2504, -1087, 2371}, {-3458, -175, 1395}, {-1397, -98, -843},
  381. {-2252, -177, -1149}, {-1489, -726, -1283}, {-1558, -265, -1744},
  382. {-1867, -821, -1897}, {-2062, -1516, -2340}, {-2595, -1142, -2861},
  383. { 170, 46, -819}, { -193, -204, -1151}, { 326, -196, -1532},
  384. { 780, 329, -816}, { 201, 369, -1243}, { 650, -209, -1060},
  385. { 1144, -15, -1216}, { 1203, -259, -1867}, { -890, -564, -1430},
  386. { -638, -852, -1921}, { 177, -739, -1358}, { -261, -526, -1666},
  387. { 206, -407, -2255}, { 338, -526, -822}, { 421, -1095, -1009},
  388. { 765, -607, -1408}, { 825, -1295, -2004}, { 357, -905, -1815},
  389. { -58, -1248, -1588}, { -596, -1436, -2046}, { -73, -1159, -2116},
  390. { -115, -1382, -2581}, { -160, -1723, -1952}, { -6, -2196, -2954},
  391. { -649, -1705, -2603}, { -617, -1453, -3282}, { -949, -2019, -3102},
  392. { -812, 1544, 1937}, {-1854, 574, 2000}, {-1463, 1140, 2649},
  393. {-2683, 1748, 1452}, {-2486, 2241, 2523}, { 783, 1910, 1435},
  394. { 581, 2682, 1376}, { 236, 2197, 1885}, { -453, 2943, 2057},
  395. { -682, 2178, 2565}, {-1342, 3201, 3328}, { -288, -184, 262},
  396. { 121, -149, -183}, { 758, -412, 206}, { 1038, -204, 853},
  397. { 1577, -457, 700}, { 937, -640, -567}, { 1508, -528, -1024},
  398. { -225, -527, -427}, { -564, -1095, -332}, { -742, -353, -186},
  399. {-1288, -459, 84}, {-1853, -484, -274}, {-1554, -731, 825},
  400. {-2425, -234, 382}, {-1722, 293, -271}, {-2515, 425, -564},
  401. {-2599, 818, 464}, { -358, 118, -375}, { -613, 198, -874},
  402. { -690, 683, -324}, {-1352, 1155, -168}, {-1093, 129, -324},
  403. {-1184, 611, -858}, { 433, 386, -372}, { -120, 486, -634},
  404. { 234, 851, -631}, { 602, 128, 46}, { 1099, 410, 159},
  405. { 715, -145, -424}, { 1198, -85, -593}, { 1390, 367, -358},
  406. { 1683, 362, -964}, { 1711, 622, 45}, { 2033, 833, -383},
  407. { 2890, 549, -506}, { 7, 401, 52}, { 72, 811, 415},
  408. { 566, 668, 41}, { 467, 1218, 130}, { 68, 957, -187},
  409. { -25, 1649, -103}, { -661, 260, 214}, { -925, -94, 612},
  410. { -321, -422, 965}, { -788, -672, 1783}, { 400, -673, 779},
  411. { 741, -595, 1635}, { -161, 307, 657}, { -382, 836, 871},
  412. { -814, 400, 1223}, { 364, 606, 1247}, { 57, 75, 1571},
  413. { 151, 471, 2287}, { -81, 1021, 1502}, { 227, 1470, 1097},
  414. { 658, 1275, 1653}, { 664, 1478, 2377}, { 263, -127, 444},
  415. { 264, 89, 969}, { 794, 171, 576}, { 821, 186, 1226},
  416. { 404, 462, 517}, { 339, 918, 794}, { 1280, 1423, 196},
  417. { 1453, 2019, 365}, { 1615, 1481, 672}, { 2394, 1708, 508},
  418. { 806, 1238, 573}, { 713, 1158, 1078}, { 1285, 1436, 1232},
  419. { 1790, 1188, 1141}, { 765, 643, 864}, { 1032, 797, 1279},
  420. { 900, 563, 1827}, { 1514, 673, 2312}, { 1544, 1129, 3240},
  421. { 1469, 1050, 1594}, { 1945, 1318, 1988}, { 2397, 2026, 2060},
  422. { 3538, 2057, 2620}, { 1249, -118, 74}, { 1727, 194, 421},
  423. { 2078, -50, -463}, { 970, 688, -432}, { 1149, 952, -110},
  424. { 1254, 1275, -651}, { 1386, 929, 401}, { 1960, 1167, 232},
  425. { 407, -752, -243}, { 859, -1118, 172}, { -227, -860, -992},
  426. { -796, -1175, -1380}, { 8, -1282, -388}, { 353, -1781, -1037},
  427. { -732, -397, -807}, { -853, -28, -1342}, {-1229, -1207, -1959},
  428. {-1015, -1125, -2543}, {-1452, -1791, -2725}, {-1891, -2416, -3269},
  429. { -918, -1629, -783}, { -580, -2155, -698}, {-1097, -2364, -96},
  430. {-1387, -1513, 7}, {-1588, -2076, -664}, {-1473, -2740, -784},
  431. {-2378, -3149, -56}, {-2856, -2092, -169}, {-3391, -3708, 316},
  432. {-1176, -890, -614}, {-1944, -1061, -800}, { -299, -1517, -1000},
  433. { -640, -1850, -1526}, {-1454, -1536, -1233}, {-1890, -1955, -1756},
  434. {-1086, -1921, -2122}, { -750, -2325, -2260}, {-1325, -2413, -2673},
  435. {-1114, -2542, -3459}, {-1341, -2901, -3963}, {-1160, -2226, -1393},
  436. {-1001, -2772, -1573}, {-1594, -2641, -1978}, {-1534, -3046, -2624},
  437. {-2224, -2196, -675}, {-2807, -3054, -1102}, {-2008, -2840, -1186},
  438. {-1980, -3332, -1695}, {-1715, -3562, -505}, {-2527, -4000, -1887},
  439. {-2333, -2734, -2296}, {-3440, -2401, -3211}, {-2008, -3528, -3337},
  440. {-2247, -3291, -4510}, { -475, 949, 155}, { -149, 1365, 545},
  441. { -757, 1644, 1083}, { -217, 2053, 1353}, {-1433, 2301, 1462},
  442. { 495, 1661, 529}, { 10, 2037, 740}, { 2082, 1898, 978},
  443. { 2831, 2294, 911}, { 842, 793, 420}, { 1223, 1023, 863},
  444. { 1237, 451, 780}, { 1744, 708, 822}, { 1533, 284, 1384},
  445. { 2135, 609, 1538}, { 2305, 626, 540}, { 2368, 1187, 955},
  446. { 2586, 1255, -7}, { 3116, 1131, 726}, { 3431, 1730, 428},
  447. { 2734, 1648, 1307}, { 2988, 1231, 2010}, { 3523, 2024, 1488},
  448. { 1034, 1657, 871}, { 1206, 2163, 1036}, { 1807, 2372, 1233},
  449. { 1808, 1769, 1493}, { 1573, 2332, 1779}, { 1216, 1609, 1866},
  450. { 1480, 1898, 2513}, { 465, 2708, 2776}, { 771, 3638, 3338},
  451. { 1869, 2599, 2623}, { 2825, 2745, 2468}, { 2638, 2439, 1585},
  452. { 2094, 2970, 1308}, { 2022, 3057, 1999}, { 3428, 2912, 1816},
  453. { 4536, 2974, 2129}, { 1046, 2563, 2086}, { 1363, 3562, 2318},
  454. { 2511, 1891, 2984}, { 1866, 2306, 3986}, { 3272, 2924, 3682},
  455. { 3146, 3564, 2272}, { 3592, 3968, 2822}, { 2431, 3369, 3069},
  456. { 1931, 4709, 3090}, { 2629, 4220, 3986}, { 4639, 4056, 3664},
  457. { 4035, 5334, 4912}
  458. };
  459. static const int16_t lsp_band2[LSP_CB_SIZE][4] = {
  460. { 0, 0, 0, 0}, { 601, 512, -542, 334},
  461. { 428, 1087, -484, -132}, { 652, 622, -391, -572},
  462. { 378, 799, 141, -860}, { 1040, 409, 112, -554},
  463. { 1123, 670, -75, -847}, { 1421, 494, -315, -1095},
  464. { 787, 1001, 114, -460}, { 988, 1672, 216, -681},
  465. { 1007, 1241, -132, -1247}, { 1073, 399, 186, -5},
  466. { 1262, 193, -694, -129}, { 325, 196, 51, -641},
  467. { 861, -59, 350, -458}, { 1261, 567, 586, -346},
  468. { 1532, 885, 210, -517}, { 2027, 937, 113, -792},
  469. { 1383, 1064, 334, 38}, { 1964, 1468, 459, 133},
  470. { 2062, 1186, -98, -121}, { 2577, 1445, 506, -373},
  471. { 2310, 1682, -2, -960}, { 2876, 1939, 765, 138},
  472. { 3581, 2360, 649, -414}, { 219, 176, -398, -309},
  473. { 434, -78, -435, -880}, { -344, 301, 265, -552},
  474. { -915, 470, 657, -380}, { 419, -432, -163, -453},
  475. { 351, -953, 8, -562}, { 789, -43, 20, -958},
  476. { 302, -594, -352, -1159}, { 1040, 108, -668, -924},
  477. { 1333, 210, -1217, -1663}, { 483, 589, -350, -1140},
  478. { 1003, 824, -802, -1184}, { 745, 58, -589, -1443},
  479. { 346, 247, -915, -1683}, { 270, 796, -720, -2043},
  480. { 1208, 722, -222, -193}, { 1486, 1180, -412, -672},
  481. { 1722, 179, -69, -521}, { 2047, 860, -666, -1410},
  482. { -146, 222, -281, -805}, { -189, 90, -114, -1307},
  483. { -152, 1086, -241, -764}, { -439, 733, -601, -1302},
  484. { -833, -167, -351, -601}, { -856, -422, -411, -1059},
  485. { -747, -355, -582, -1644}, { -837, 210, -916, -1144},
  486. {-1800, 32, -878, -1687}, { -48, -23, -1146, 52},
  487. { -350, -409, -1656, -364}, { 265, -728, -858, -577},
  488. { 458, -247, -1141, -997}, { 691, -407, -1988, -1161},
  489. { -66, -104, -705, -1249}, { -431, -93, -1191, -1844},
  490. { 203, -732, -1000, -1693}, { 10, -832, -1846, -1819},
  491. { 493, -128, -1436, -1768}, { 488, -311, -1730, -2540},
  492. { -653, -532, -1150, -1172}, {-1086, -289, -1706, -1533},
  493. { -699, -1205, -1216, -1766}, {-1032, -1481, -2074, -1523},
  494. { -721, -1220, -2277, -2600}, { 12, -539, -1484, -1131},
  495. { -40, -911, -2106, -441}, { -471, -484, -2267, -1549},
  496. { -141, -988, -3006, -1721}, {-1545, -2102, -583, 342},
  497. {-1383, -2772, -386, -13}, {-2118, -2589, -1205, 72},
  498. {-2147, -3231, -965, 390}, {-2949, -3300, -621, 637},
  499. {-3907, -4138, -865, 803}, {-1287, -845, -375, -548},
  500. {-1416, -1169, -487, -1277}, {-1400, -1690, -1027, -418},
  501. {-2018, -1909, -1188, -1260}, {-1418, -2222, -2029, -128},
  502. {-2067, -2998, -2693, -310}, { -950, -1028, -1538, 185},
  503. {-1616, -915, -2205, -549}, { 19, -821, -1145, 352},
  504. { 184, -1175, -1356, -627}, { -547, -1088, -1661, -911},
  505. { -216, -1502, -2197, -948}, { -795, -1306, -2374, -451},
  506. { -924, -1889, -2796, -680}, { -600, -1614, -3609, -885},
  507. {-2392, -2528, 319, 303}, {-2908, -2095, -310, 573},
  508. {-3460, -2141, 49, -113}, {-2231, -448, 675, -146},
  509. {-2805, -532, 1231, 479}, {-2684, -486, -200, 611},
  510. {-3525, -971, -198, 704}, {-3707, 173, 349, 254},
  511. {-4734, -1447, -34, 880}, { 777, -512, 114, -10},
  512. { 1250, -66, 442, -5}, { 604, 613, 452, -352},
  513. { 1224, 777, 675, -1014}, {-1372, -79, -1208, -238},
  514. {-2389, -17, -1157, -818}, {-1504, -673, -1133, -1060},
  515. {-1984, -799, -2005, -1973}, {-2037, -798, -1068, -105},
  516. {-3190, -899, -1817, -194}, { -156, -886, 394, -318},
  517. { -258, -1283, 551, 202}, { -536, -1729, 910, 331},
  518. { -847, -1109, 795, -163}, {-1171, -1128, 715, 519},
  519. {-1080, -1319, 1685, 668}, {-1000, -1921, 96, 211},
  520. {-1487, -2148, 831, 174}, {-1139, -374, 414, -4},
  521. {-1517, -1383, 396, -352}, {-1012, 439, -59, -967},
  522. {-1812, 706, -440, -1030}, {-1971, -329, -34, -827},
  523. {-2472, -1588, -151, -606}, {-2161, 374, -281, 76},
  524. {-3012, 231, -15, -690}, { 1104, 566, 721, 209},
  525. { 1685, 564, 383, 98}, { 1898, 750, 792, -97},
  526. { 556, -64, 561, -93}, { 876, 162, 913, -22},
  527. { 961, 675, 1296, 140}, { 756, -396, 851, 544},
  528. { 360, -303, 1341, 396}, { 878, -22, 1464, 863},
  529. { -309, -273, 642, -129}, { -686, -82, 842, 454},
  530. { -5, -47, 1069, 998}, { -94, 967, 1277, 298},
  531. { -489, 385, 1473, 746}, { -369, -717, 1333, 242},
  532. { 281, -993, 1726, 924}, { 464, 601, 1575, 1376},
  533. { -250, 206, 2339, 1175}, { -438, 377, -597, -285},
  534. {-1020, 787, -790, -287}, { -458, -410, 215, 295},
  535. { -589, -860, -121, 797}, {-1175, 122, -437, 466},
  536. {-1480, -121, 367, 924}, { 234, 323, 770, -555},
  537. { 145, 30, 996, 26}, { 66, 849, 93, -145},
  538. { -117, 1261, 474, -399}, {-1495, 1051, 218, -506},
  539. {-1390, 694, 994, 88}, { 616, 7, 78, 304},
  540. { 1060, 52, -62, 835}, { 833, 454, 649, 1359},
  541. { -770, 464, 47, 93}, { -574, 1199, -39, 379},
  542. { 114, -98, 488, 485}, { 727, 244, 606, 696},
  543. { -76, 455, 671, 546}, { -565, -13, 145, 819},
  544. { -376, 569, 448, 1128}, { 218, 122, 265, 1167},
  545. { 230, 738, 932, 1003}, { 138, 477, 36, 450},
  546. { 404, 787, -73, 1000}, { 497, 1259, 387, 1231},
  547. { 17, 207, 195, -79}, { 562, 358, 53, -158},
  548. { 493, 387, 478, 189}, { 678, 831, 640, 558},
  549. { -197, 523, 613, 57}, { 429, 894, 769, 111},
  550. { 67, 1174, 568, 511}, { 1242, 824, 251, 840},
  551. { 1419, 1074, 864, 481}, { 924, 1474, 669, 724},
  552. { 1539, 1879, 654, 1590}, { 445, 337, 1111, 541},
  553. { 472, 1421, 1264, 1094}, { 794, 735, 1103, 668},
  554. { 1055, 863, 1192, 1020}, { 778, 1105, 806, 1798},
  555. { 1052, 1527, 1587, 2151}, { 881, 1552, 1265, 391},
  556. { 726, 872, 1812, 601}, { 1469, 280, 1008, 616},
  557. { 1403, 577, 1803, 1244}, { 1650, 1314, 1148, 1072},
  558. { 1297, 1669, 1911, 1026}, { 2093, 1044, 2115, 1189},
  559. { 1644, 1961, 2587, 1512}, { 25, -315, -9, -106},
  560. { 290, -339, 428, -444}, { -68, -783, 735, 772},
  561. { 245, -555, 468, 47}, { 334, -895, 814, 146},
  562. { 235, 368, -964, -959}, { -203, 315, -1566, -1217},
  563. { 801, 17, -276, -354}, { 894, -495, -789, -635},
  564. { 716, 291, -1189, -357}, { 560, -260, -733, -2},
  565. { 679, -508, -1429, 211}, { -51, -62, -428, 557},
  566. { 322, -638, -211, 614}, { -878, -1057, -84, -71},
  567. { -388, -1415, -167, -318}, { -754, -1574, 214, -539},
  568. {-1419, -2004, -92, -787}, { -47, -856, -347, -255},
  569. { 23, -1211, -173, 320}, { -658, -487, -893, 353},
  570. { -783, -1587, -584, 507}, {-1420, -859, -378, 441},
  571. {-2095, -1491, -137, 439}, { -321, -1450, -1288, -12},
  572. { -359, -2113, -553, -8}, { -831, -1918, -1561, 32},
  573. {-1014, -2487, -1359, -939}, { -475, -311, -169, -236},
  574. { -907, -426, 276, -611}, { -96, -400, 50, -710},
  575. { -426, -1022, -10, -985}, { -197, -258, -744, -575},
  576. { -611, -930, -771, -394}, { -267, -776, -612, -939},
  577. { -256, -1346, -802, -1122}, { -796, -1570, -825, -754},
  578. { 712, 876, 141, 227}, { 981, 1509, 85, 124},
  579. { 1462, 1228, 979, -39}, { 1734, 999, 1481, 440},
  580. { 2293, 1116, 769, 440}, { 2504, 1480, 1241, 356},
  581. { 2474, 1909, 1558, 810}, { 917, 1134, 607, -134},
  582. { 509, 1809, 781, -123}, { 1712, 1506, 559, -423},
  583. { 2037, 2317, 726, -155}, { 3031, 2676, 1203, 331},
  584. { 3664, 3274, 1768, 531}, { 1610, 1839, 867, 183},
  585. { 1774, 1972, 1538, 97}, { 1822, 2158, 1282, 659},
  586. { 2222, 2758, 1818, 900}, { 3251, 2124, 1723, 996},
  587. { 3633, 2336, 2408, 1453}, { 2923, 3517, 2567, 1318},
  588. };
  589. /**
  590. * Used for the coding/decoding of the pulses positions
  591. * for the MP-MLQ codebook
  592. */
  593. static const int32_t combinatorial_table[PULSE_MAX][SUBFRAME_LEN/GRID_SIZE] = {
  594. {118755, 98280, 80730, 65780, 53130,
  595. 42504, 33649, 26334, 20349, 15504,
  596. 11628, 8568, 6188, 4368, 3003,
  597. 2002, 1287, 792, 462, 252,
  598. 126, 56, 21, 6, 1,
  599. 0, 0, 0, 0, 0},
  600. { 23751, 20475, 17550, 14950, 12650,
  601. 10626, 8855, 7315, 5985, 4845,
  602. 3876, 3060, 2380, 1820, 1365,
  603. 1001, 715, 495, 330, 210,
  604. 126, 70, 35, 15, 5,
  605. 1, 0, 0, 0, 0},
  606. { 3654, 3276, 2925, 2600, 2300,
  607. 2024, 1771, 1540, 1330, 1140,
  608. 969, 816, 680, 560, 455,
  609. 364, 286, 220, 165, 120,
  610. 84, 56, 35, 20, 10,
  611. 4, 1, 0, 0, 0},
  612. { 406, 378, 351, 325, 300,
  613. 276, 253, 231, 210, 190,
  614. 171, 153, 136, 120, 105,
  615. 91, 78, 66, 55, 45,
  616. 36, 28, 21, 15, 10,
  617. 6, 3, 1, 0, 0},
  618. { 29, 28, 27, 26, 25,
  619. 24, 23, 22, 21, 20,
  620. 19, 18, 17, 16, 15,
  621. 14, 13, 12, 11, 10,
  622. 9, 8, 7, 6, 5,
  623. 4, 3, 2, 1, 0},
  624. { 1, 1, 1, 1, 1,
  625. 1, 1, 1, 1, 1,
  626. 1, 1, 1, 1, 1,
  627. 1, 1, 1, 1, 1,
  628. 1, 1, 1, 1, 1,
  629. 1, 1, 1, 1, 1},
  630. };
  631. static const int16_t pitch_contrib[340] = {
  632. 60, 0, 0, 2489, 60, 0, 0, 5217,
  633. 1, 6171, 0, 3953, 0, 10364, 1, 9357,
  634. -1, 8843, 1, 9396, 0, 5794, -1, 10816,
  635. 2, 11606, -2, 12072, 0, 8616, 1, 12170,
  636. 0, 14440, 0, 7787, -1, 13721, 0, 18205,
  637. 0, 14471, 0, 15807, 1, 15275, 0, 13480,
  638. -1, 18375, -1, 0, 1, 11194, -1, 13010,
  639. 1, 18836, -2, 20354, 1, 16233, -1, 0,
  640. 60, 0, 0, 12130, 0, 13385, 1, 17834,
  641. 1, 20875, 0, 21996, 1, 0, 1, 18277,
  642. -1, 21321, 1, 13738, -1, 19094, -1, 20387,
  643. -1, 0, 0, 21008, 60, 0, -2, 22807,
  644. 0, 15900, 1, 0, 0, 17989, -1, 22259,
  645. 1, 24395, 1, 23138, 0, 23948, 1, 22997,
  646. 2, 22604, -1, 25942, 0, 26246, 1, 25321,
  647. 0, 26423, 0, 24061, 0, 27247, 60, 0,
  648. -1, 25572, 1, 23918, 1, 25930, 2, 26408,
  649. -1, 19049, 1, 27357, -1, 24538, 60, 0,
  650. -1, 25093, 0, 28549, 1, 0, 0, 22793,
  651. -1, 25659, 0, 29377, 0, 30276, 0, 26198,
  652. 1, 22521, -1, 28919, 0, 27384, 1, 30162,
  653. -1, 0, 0, 24237, -1, 30062, 0, 21763,
  654. 1, 30917, 60, 0, 0, 31284, 0, 29433,
  655. 1, 26821, 1, 28655, 0, 31327, 2, 30799,
  656. 1, 31389, 0, 32322, 1, 31760, -2, 31830,
  657. 0, 26936, -1, 31180, 1, 30875, 0, 27873,
  658. -1, 30429, 1, 31050, 0, 0, 0, 31912,
  659. 1, 31611, 0, 31565, 0, 25557, 0, 31357,
  660. 60, 0, 1, 29536, 1, 28985, -1, 26984,
  661. -1, 31587, 2, 30836, -2, 31133, 0, 30243,
  662. -1, 30742, -1, 32090, 60, 0, 2, 30902,
  663. 60, 0, 0, 30027, 0, 29042, 60, 0,
  664. 0, 31756, 0, 24553, 0, 25636, -2, 30501,
  665. 60, 0, -1, 29617, 0, 30649, 60, 0,
  666. 0, 29274, 2, 30415, 0, 27480, 0, 31213,
  667. -1, 28147, 0, 30600, 1, 31652, 2, 29068,
  668. 60, 0, 1, 28571, 1, 28730, 1, 31422,
  669. 0, 28257, 0, 24797, 60, 0, 0, 0,
  670. 60, 0, 0, 22105, 0, 27852, 60, 0,
  671. 60, 0, -1, 24214, 0, 24642, 0, 23305,
  672. 60, 0, 60, 0, 1, 22883, 0, 21601,
  673. 60, 0, 2, 25650, 60, 0, -2, 31253,
  674. -2, 25144, 0, 17998
  675. };
  676. /**
  677. * Number of non-zero pulses in the MP-MLQ excitation
  678. */
  679. static const int8_t pulses[4] = {6, 5, 6, 5};
  680. /**
  681. * Size of the MP-MLQ fixed excitation codebooks
  682. */
  683. static const int32_t max_pos[4] = {593775, 142506, 593775, 142506};
  684. static const int16_t fixed_cb_gain[GAIN_LEVELS] = {
  685. 1, 2, 3, 4, 6, 9, 13, 18,
  686. 26, 38, 55, 80, 115, 166, 240, 348,
  687. 502, 726, 1050, 1517, 2193, 3170, 4582, 6623,
  688. };
  689. static const int16_t adaptive_cb_gain85[85 * 20] = {
  690. 0, 0, 0, 0, 0, 0, 0, 0,
  691. 0, 0, 0, 0, 0, 0, 0, 0,
  692. 0, 0, 0, 0, 800, 1496, 167, -256,
  693. -338, -39, -136, -1, -4, -6, -73, -8,
  694. -15, 12, 23, 2, 16, 30, 3, -5,
  695. -462, -686, 493, 2575, 311, -13, -28, -14,
  696. -404, -5, -19, 13, 20, 72, 107, -77,
  697. 8, 13, -9, -48, 1483, 144, 784, 928,
  698. 1243, -134, -1, -37, -52, -94, -13, -71,
  699. -6, -84, -8, -44, -112, -10, -59, -70,
  700. -77, 275, 3522, 1056, -1254, 0, -4, -757,
  701. -68, -95, 1, 16, -59, 4, -17, -227,
  702. -5, 21, 269, 80, -125, -40, -264, 381,
  703. 5027, 0, 0, -4, -8, -1542, 0, -2,
  704. 0, 2, 0, 6, 38, 12, 81, -117,
  705. 138, 332, 2215, 2574, 1339, -1, -6, -299,
  706. -404, -109, -2, -18, -44, -21, -52, -348,
  707. -11, -27, -181, -210, 3685, 2883, -887, 866,
  708. -1639, -828, -507, -48, -45, -164, -648, 199,
  709. 156, -194, -152, 46, 368, 288, -88, 86,
  710. 1396, 2146, 2235, 345, 942, -118, -281, -305,
  711. -7, -54, -182, -190, -292, -29, -45, -47,
  712. -80, -123, -128, -19, 13, 4475, 3549, -804,
  713. -655, 0, -1222, -768, -39, -26, -3, -2,
  714. -969, 0, 219, 174, 0, 179, 141, -32,
  715. -724, 254, 242, 6049, 2462, -32, -3, -3,
  716. -2233, -370, 11, 10, -3, 267, -94, -89,
  717. 108, -38, -36, -909, 626, -1713, 6121, 4561,
  718. -1061, -23, -179, -2287, -1270, -68, 65, -233,
  719. 640, -174, 477, -1704, 40, -111, 396, 295,
  720. -350, 1391, 7985, 511, -405, -7, -118, -3892,
  721. -15, -10, 29, 170, -678, 10, -43, -249,
  722. -8, 34, 197, 12, 3144, -529, 608, 2530,
  723. 3878, -603, -17, -22, -390, -918, 101, -116,
  724. 19, -485, 81, -93, -744, 125, -144, -599,
  725. 2589, -689, 3045, 5603, -404, -409, -29, -566,
  726. -1916, -10, 108, -481, 128, -885, 235, -1041,
  727. 63, -17, 75, 138, 3107, 513, 1374, -3594,
  728. -4922, -589, -16, -115, -788, -1478, -97, -260,
  729. -43, 681, 112, 301, 933, 154, 413, -1079,
  730. 2468, 6010, 1107, -390, 1961, -372, -2204, -74,
  731. -9, -234, -905, -166, -406, 58, 143, 26,
  732. -295, -719, -132, 46, 4773, 2766, 2368, 4862,
  733. -4044, -1390, -467, -342, -1443, -998, -806, -690,
  734. -399, -1416, -821, -702, 1178, 682, 584, 1200,
  735. 1665, -1879, 1443, 1701, 8562, -169, -215, -127,
  736. -176, -4475, 190, -146, 165, -172, 195, -149,
  737. -870, 982, -754, -889, 2716, 9011, -1007, 755,
  738. -1785, -450, -4956, -61, -34, -194, -1493, 167,
  739. 554, -125, -415, 46, 296, 982, -109, 82,
  740. -2727, 7548, 1285, 938, 3420, -453, -3478, -100,
  741. -53, -714, 1256, 213, -592, 156, -432, -73,
  742. 569, -1576, -268, -196, 3677, 882, 4050, 1202,
  743. 2323, -825, -47, -1001, -88, -329, -198, -909,
  744. -218, -269, -64, -297, -521, -125, -574, -170,
  745. 2046, -753, 122, 10102, 603, -255, -34, 0,
  746. -6229, -22, 94, -15, 5, -1261, 464, -75,
  747. -75, 27, -4, -372, 449, -1815, 10690, 3870,
  748. -527, -12, -201, -6976, -914, -16, 49, -293,
  749. 1184, -106, 428, -2525, 14, -58, 344, 124,
  750. -941, 2352, 5049, 3650, 2637, -54, -337, -1556,
  751. -813, -424, 135, 290, -725, 209, -524, -1125,
  752. 151, -378, -812, -587, -1879, 796, 3117, 9569,
  753. -404, -215, -38, -593, -5589, -9, 91, 357,
  754. -151, 1097, -464, -1821, -46, 19, 76, 236,
  755. -1715, 2043, -2096, 9946, 4001, -179, -254, -268,
  756. -6038, -977, 213, -219, 261, 1041, -1240, 1272,
  757. 418, -498, 511, -2429, -5772, -618, -3921, 284,
  758. -3155, -2033, -23, -938, -4, -607, -218, -1381,
  759. -148, 100, 10, 68, -1111, -119, -755, 54,
  760. 382, 4748, 8003, -2064, 2198, -8, -1376, -3909,
  761. -260, -294, -110, -186, -2319, 48, 598, 1008,
  762. -51, -637, -1073, 277, -867, 3015, 11926, -1675,
  763. 947, -45, -555, -8681, -171, -54, 159, 631,
  764. -2195, -88, 308, 1219, 50, -174, -690, 96,
  765. -4933, -432, 6757, 3771, 1352, -1485, -11, -2786,
  766. -867, -111, -130, 2034, 178, 1135, 99, -1555,
  767. 407, 35, -557, -311, 152, 9726, 4231, -1928,
  768. 1490, -1, -5774, -1092, -226, -135, -90, -39,
  769. -2511, 17, 1144, 498, -13, -884, -384, 175,
  770. 2512, 193, 9033, 5361, -3148, -385, -2, -4980,
  771. -1754, -605, -29, -1385, -106, -822, -63, -2956,
  772. 482, 37, 1735, 1030, 8464, 2844, 12, 549,
  773. 2132, -4373, -493, 0, -18, -277, -1469, -6,
  774. -2, -284, -95, 0, -1101, -370, -1, -71,
  775. 2141, -2602, 7166, 9046, -1350, -279, -413, -3134,
  776. -4994, -111, 340, -936, 1138, -1182, 1436, -3957,
  777. 176, -214, 590, 745, -244, 278, 13307, 1227,
  778. -161, -3, -4, -10808, -91, -1, 4, 198,
  779. -226, 18, -20, -997, -2, 2, 131, 12,
  780. -1947, 8217, 6269, 917, -2559, -231, -4121, -2399,
  781. -51, -399, 976, 745, -3144, 108, -460, -350,
  782. -304, 1283, 979, 143, -1810, 2061, -2781, 6056,
  783. 10058, -200, -259, -472, -2238, -6174, 227, -307,
  784. 349, 669, -761, 1028, 1111, -1265, 1707, -3717,
  785. 7827, 9161, -3409, 2473, -1510, -3739, -5122, -709,
  786. -373, -139, -4376, 1628, 1906, -1181, -1382, 514,
  787. 721, 844, -314, 228, -1430, 8313, 9541, -2955,
  788. 1626, -124, -4218, -5556, -533, -161, 725, 832,
  789. -4841, -257, 1499, 1721, 142, -825, -947, 293,
  790. 2819, -4247, 5391, 8673, 2756, -485, -1101, -1774,
  791. -4591, -463, 730, -927, 1397, -1492, 2248, -2854,
  792. -474, 714, -907, -1459, 141, 14552, 690, 257,
  793. -112, -1, -12926, -29, -4, 0, -125, -5,
  794. -613, -2, -228, -10, 0, 99, 4, 1,
  795. 11938, -1859, 1806, -962, -884, -8699, -211, -199,
  796. -56, -47, 1355, -1316, 205, 701, -109, 106,
  797. 644, -100, 97, -51, 3728, 1982, 2264, 4584,
  798. 3131, -848, -239, -312, -1282, -598, -451, -515,
  799. -273, -1043, -554, -633, -712, -378, -432, -876,
  800. -1181, 766, 720, 14303, -216, -85, -35, -31,
  801. -12486, -2, 55, 51, -33, 1031, -668, -628,
  802. -15, 10, 9, 189, -4385, 4826, 10112, 1569,
  803. 3388, -1173, -1421, -6242, -150, -700, 1291, 2706,
  804. -2979, 420, -462, -969, 906, -998, -2091, -324,
  805. -448, 1932, 15591, -1842, 657, -12, -227, -14837,
  806. -207, -26, 52, 427, -1838, -50, 217, 1753,
  807. 18, -77, -626, 74, -4141, 1844, 3962, 5517,
  808. 6220, -1046, -207, -958, -1858, -2361, 466, 1001,
  809. -446, 1394, -621, -1334, 1572, -700, -1504, -2094,
  810. 729, -2299, 14755, 3657, -952, -32, -322, -13288,
  811. -816, -55, 102, -656, 2071, -162, 513, -3294,
  812. 42, -133, 857, 212, -1385, 5801, 13339, -3137,
  813. 1344, -117, -2054, -10861, -600, -110, 490, 1127,
  814. -4723, -265, 1111, 2554, 113, -476, -1094, 257,
  815. 4710, 9661, 1073, -2467, 3274, -1354, -5697, -70,
  816. -371, -654, -2777, -308, -633, 709, 1455, 161,
  817. -941, -1930, -214, 493, 1843, -3624, 12422, 6898,
  818. -1559, -207, -802, -9419, -2904, -148, 407, -1397,
  819. 2748, -775, 1526, -5230, 175, -344, 1182, 656,
  820. 1433, 2394, 2507, 1380, 8780, -125, -349, -383,
  821. -116, -4705, -209, -219, -366, -120, -201, -211,
  822. -768, -1283, -1343, -740, -1712, 12915, 5883, -2197,
  823. 991, -179, -10181, -2112, -294, -60, 1350, 615,
  824. -4638, -229, 1732, 789, 103, -781, -356, 133,
  825. 15072, 2158, -1245, 910, -496, -13865, -284, -94,
  826. -50, -15, -1986, 1145, 164, -837, -119, 69,
  827. 456, 65, -37, 27, 4655, 7319, 4916, 586,
  828. -3381, -1322, -3270, -1475, -20, -697, -2079, -1396,
  829. -2196, -166, -261, -175, 960, 1510, 1014, 120,
  830. 1191, -2140, 5120, 13498, -1418, -86, -279, -1600,
  831. -11121, -122, 155, -372, 669, -981, 1763, -4218,
  832. 103, -185, 443, 1168, -1530, -817, 8191, 9632,
  833. -1452, -143, -40, -4095, -5663, -128, -76, 765,
  834. 408, 900, 480, -4815, -135, -72, 726, 854,
  835. -3236, 607, 1696, -2106, 11485, -639, -22, -175,
  836. -270, -8051, 119, 335, -62, -416, 78, 218,
  837. 2268, -425, -1189, 1476, 3203, -1903, -837, 9679,
  838. 7057, -626, -221, -42, -5718, -3039, 372, 163,
  839. -97, -1892, 1124, 494, -1380, 819, 360, -4169,
  840. 213, -655, 17015, 620, -384, -2, -26, -17671,
  841. -23, -9, 8, -221, 681, -8, 24, -644,
  842. 5, -15, 399, 14, 5088, 35, -3339, 3726,
  843. 8488, -1580, 0, -680, -847, -4397, -10, 1037,
  844. 7, -1157, -8, 759, -2636, -18, 1730, -1930,
  845. -988, 1454, -2688, 15039, 2682, -59, -129, -441,
  846. -13805, -439, 87, -162, 238, 907, -1335, 2467,
  847. 161, -238, 440, -2462, -4865, -2842, -53, 5495,
  848. 6523, -1445, -493, 0, -1843, -2597, -844, -16,
  849. -9, 1632, 953, 18, 1937, 1131, 21, -2188,
  850. 3076, 15069, -2914, 1810, -971, -577, -13860, -518,
  851. -200, -57, -2829, 547, 2680, -339, -1665, 322,
  852. 182, 893, -172, 107, 1311, 5355, 11054, 2299,
  853. -3654, -105, -1750, -7458, -322, -814, -428, -885,
  854. -3613, -184, -751, -1551, 292, 1194, 2465, 512,
  855. 4035, 5619, 4618, 1815, 1912, -994, -1927, -1301,
  856. -201, -223, -1384, -1137, -1583, -447, -622, -511,
  857. -471, -656, -539, -211, -2131, 2754, -4501, 12879,
  858. 7432, -277, -463, -1236, -10124, -3371, 358, -585,
  859. 756, 1675, -2165, 3538, 967, -1249, 2042, -5842,
  860. 5618, -515, 3219, -4149, 4857, -1926, -16, -632,
  861. -1050, -1440, 176, -1104, 101, 1422, -130, 815,
  862. -1666, 152, -954, 1230, 1838, -1709, 1139, 16867,
  863. 716, -206, -178, -79, -17366, -31, 191, -127,
  864. 118, -1892, 1759, -1173, -80, 74, -49, -737,
  865. 1978, -3845, 10050, 11854, -2492, -238, -902, -6164,
  866. -8576, -379, 464, -1213, 2358, -1431, 2782, -7271,
  867. 301, -585, 1529, 1803, -2600, 11246, 11289, -3647,
  868. 1463, -412, -7720, -7778, -812, -130, 1784, 1791,
  869. -7749, -578, 2504, 2513, 232, -1004, -1008, 325,
  870. 3442, 907, 2725, 8970, 3638, -723, -50, -453,
  871. -4911, -808, -190, -572, -150, -1884, -496, -1492,
  872. -764, -201, -605, -1992, -126, 17498, 3481, -2003,
  873. 1090, 0, -18689, -739, -244, -72, 135, 26,
  874. -3717, -15, 2139, 425, 8, -1165, -231, 133,
  875. -1814, 1048, -2164, 4070, 16272, -200, -67, -285,
  876. -1011, -16160, 116, -239, 138, 450, -260, 537,
  877. 1801, -1041, 2149, -4042, 9354, 12580, -1883, 962,
  878. -617, -5341, -9660, -216, -56, -23, -7183, 1075,
  879. 1446, -549, -738, 110, 352, 474, -71, 36,
  880. 1708, 4199, 7387, 6335, 1003, -178, -1076, -3330,
  881. -2449, -61, -437, -770, -1893, -660, -1623, -2856,
  882. -104, -257, -452, -388, -2624, 5623, 17310, -2353,
  883. 592, -420, -1930, -18288, -338, -21, 900, 2772,
  884. -5941, -376, 807, 2486, 94, -203, -625, 85,
  885. 1211, -850, 1193, -1926, 15992, -89, -44, -86,
  886. -226, -15609, 62, -88, 61, 142, -100, 140,
  887. -1182, 830, -1165, 1880, 3983, -2054, 11506, -19,
  888. 3622, -968, -257, -8080, 0, -801, 499, -2797,
  889. 1442, 4, -2, 13, -880, 454, -2544, 4,
  890. -786, -1354, 16092, 7246, -1665, -37, -111, -15805,
  891. -3205, -169, -65, 772, 1330, 348, 599, -7117,
  892. -80, -137, 1636, 736, -4316, -511, 6674, 11665,
  893. 4633, -1137, -15, -2719, -8305, -1310, -134, 1758,
  894. 208, 3073, 364, -4752, 1220, 144, -1887, -3299,
  895. 7912, 4557, 1937, 1885, 7037, -3821, -1267, -229,
  896. -216, -3022, -2200, -935, -538, -910, -524, -222,
  897. -3398, -1957, -832, -809, 3434, 2967, 5867, 8196,
  898. 8766, -720, -537, -2101, -4100, -4690, -622, -1230,
  899. -1062, -1718, -1484, -2935, -1837, -1588, -3139, -4385,
  900. 5881, 9176, 8119, 3934, 3355, -2111, -5139, -4023,
  901. -944, -687, -3294, -2914, -4547, -1412, -2203, -1949,
  902. -1204, -1879, -1662, -805
  903. };
  904. static const int16_t adaptive_cb_gain170[170 * 20] = {
  905. 0, 0, 0, 0, 0, 0, 0, 0,
  906. 0, 0, 0, 0, 0, 0, 0, 0,
  907. 0, 0, 0, 0, 776, 212, 715, 670,
  908. 809, -36, -2, -31, -27, -39, -10, -33,
  909. -9, -31, -8, -29, -38, -10, -35, -33,
  910. 1296, 1316, -168, -320, -815, -102, -105, -1,
  911. -6, -40, -104, 13, 13, 25, 25, -3,
  912. 64, 65, -8, -15, -589, 680, 2478, 308,
  913. -596, -21, -28, -375, -5, -21, 24, 89,
  914. -102, 11, -12, -46, -21, 24, 90, 11,
  915. -735, -487, -5, 2948, 468, -33, -14, 0,
  916. -530, -13, -21, 0, 0, 132, 87, 0,
  917. 21, 13, 0, -84, 1042, 1730, 1068, 333,
  918. 626, -66, -182, -69, -6, -23, -110, -67,
  919. -112, -21, -35, -21, -39, -66, -40, -12,
  920. 486, -769, 4074, 2825, -1107, -14, -36, -1013,
  921. -487, -74, 22, -120, 191, -83, 132, -702,
  922. 32, -52, 275, 191, 1521, -767, -124, 4320,
  923. 1026, -141, -35, 0, -1139, -64, 71, 11,
  924. -5, -401, 202, 32, -95, 48, 7, -270,
  925. 2425, 1267, 3439, -91, -1166, -359, -98, -722,
  926. 0, -83, -187, -509, -266, 13, 7, 19,
  927. 172, 90, 244, -6, -1251, 975, 173, 4039,
  928. 2005, -95, -58, -1, -996, -245, 74, 13,
  929. -10, 308, -240, -42, 153, -119, -21, -494,
  930. 1820, 632, 1322, 2062, 1031, -202, -24, -106,
  931. -259, -64, -70, -146, -51, -229, -79, -166,
  932. -114, -39, -83, -129, -447, 4904, 244, -315,
  933. -2038, -12, -1467, -3, -6, -253, 134, 6,
  934. -73, -8, 94, 4, -55, 610, 30, -39,
  935. -208, -1102, 463, -448, 5653, -2, -74, -13,
  936. -12, -1950, -14, 5, 31, -5, -30, 12,
  937. 71, 380, -159, 154, 4739, 2600, -1864, 856,
  938. -1554, -1371, -412, -212, -44, -147, -752, 539,
  939. 295, -247, -135, 97, 449, 246, -176, 81,
  940. 1894, 3533, 35, -26, 2145, -219, -762, 0,
  941. 0, -280, -408, -4, -7, 3, 5, 0,
  942. -248, -462, -4, 3, -2699, 1841, 4072, 2443,
  943. 1582, -444, -207, -1012, -364, -152, 303, 670,
  944. -457, 402, -274, -607, 260, -177, -393, -236,
  945. -844, 3358, 6106, -1059, -537, -43, -688, -2275,
  946. -68, -17, 173, 314, -1251, -54, 217, 395,
  947. -27, 110, 200, -34, 1251, 1016, 3020, 2210,
  948. 1445, -95, -63, -556, -298, -127, -77, -230,
  949. -187, -168, -137, -407, -110, -89, -266, -194,
  950. 2099, 2277, 4038, 3533, -2870, -269, -316, -995,
  951. -762, -503, -291, -517, -561, -452, -491, -871,
  952. 367, 399, 707, 619, 400, -1114, 8516, 2422,
  953. -1117, -9, -75, -4426, -358, -76, 27, -208,
  954. 579, -59, 164, -1259, 27, -75, 580, 165,
  955. -4398, -2011, 3912, -2407, 2258, -1180, -247, -934,
  956. -353, -311, -540, 1050, 480, -646, -295, 575,
  957. 606, 277, -539, 331, 1767, -1447, 4240, 6160,
  958. -757, -190, -127, -1097, -2316, -35, 156, -457,
  959. 374, -664, 544, -1594, 81, -66, 195, 284,
  960. 1594, -1463, 1035, 6938, 1920, -155, -130, -65,
  961. -2938, -225, 142, -100, 92, -675, 619, -438,
  962. -186, 171, -121, -813, -562, 4716, 4085, -591,
  963. 2421, -19, -1357, -1018, -21, -357, 162, 140,
  964. -1175, -20, 170, 147, 83, -696, -603, 87,
  965. 1552, 8778, -935, 354, -1424, -147, -4703, -53,
  966. -7, -123, -831, 88, 501, -33, -189, 20,
  967. 134, 763, -81, 30, 4831, -4431, 41, -1479,
  968. -2976, -1424, -1198, 0, -133, -540, 1306, -12,
  969. 11, 436, -400, 3, 877, -804, 7, -268,
  970. 2090, 1192, 1006, 1645, 4853, -266, -86, -61,
  971. -165, -1437, -152, -128, -73, -210, -119, -101,
  972. -619, -353, -298, -487, 2386, 5712, 1426, -94,
  973. 1350, -347, -1991, -124, 0, -111, -832, -207,
  974. -497, 13, 32, 8, -196, -470, -117, 7,
  975. -1349, 1091, 1659, 8891, 313, -111, -72, -168,
  976. -4825, -5, 89, 136, -110, 732, -592, -900,
  977. 25, -20, -31, -170, 9980, 916, -381, -808,
  978. 88, -6080, -51, -8, -39, 0, -558, 232,
  979. 21, 492, 45, -18, -53, -4, 2, 4,
  980. 2338, -1031, -248, 3928, 6484, -333, -64, -3,
  981. -942, -2566, 147, 35, -15, -560, 247, 59,
  982. -925, 408, 98, -1555, 6166, -1240, -337, 3672,
  983. -1277, -2320, -93, -6, -823, -99, 466, 126,
  984. -25, -1382, 278, 75, 480, -96, -26, 286,
  985. 4377, -132, -2588, 1701, 4865, -1169, -1, -409,
  986. -176, -1444, 35, 691, -20, -454, 13, 268,
  987. -1299, 39, 768, -505, 2594, 3295, 3944, 1481,
  988. 682, -410, -662, -949, -133, -28, -521, -624,
  989. -793, -234, -297, -356, -108, -137, -164, -61,
  990. 4151, 624, 815, 4485, 2229, -1052, -23, -40,
  991. -1228, -303, -158, -206, -31, -1136, -170, -223,
  992. -565, -84, -111, -610, -3575, -361, 4924, 2791,
  993. 4698, -780, -7, -1480, -475, -1347, -78, 1074,
  994. 108, 609, 61, -839, 1025, 103, -1412, -800,
  995. -2518, 3791, 8623, 315, 2465, -387, -877, -4538,
  996. -6, -370, 582, 1325, -1995, 48, -73, -166,
  997. 378, -570, -1297, -47, -691, 2989, 9957, -421,
  998. -1142, -29, -545, -6051, -10, -79, 126, 420,
  999. -1817, -17, 76, 256, -48, 208, 694, -29,
  1000. -1918, 104, -3190, -3410, -4440, -224, 0, -621,
  1001. -709, -1203, 12, -373, 20, -399, 21, -664,
  1002. -519, 28, -864, -924, -3359, -1668, 1854, 6939,
  1003. 1430, -688, -169, -209, -2939, -124, -341, 380,
  1004. 188, 1422, 706, -785, 293, 145, -161, -606,
  1005. 42, 9706, 3164, -952, 907, 0, -5750, -611,
  1006. -55, -50, -25, -8, -1874, 2, 564, 183,
  1007. -2, -537, -175, 52, 1607, 785, 2862, 4327,
  1008. 3307, -157, -37, -500, -1143, -667, -77, -280,
  1009. -137, -424, -207, -756, -324, -158, -577, -873,
  1010. 6801, 3416, 2227, 1682, -3217, -2823, -712, -302,
  1011. -172, -631, -1418, -924, -464, -698, -350, -228,
  1012. 1335, 670, 437, 330, 3459, 3898, 364, 7841,
  1013. -2640, -730, -927, -8, -3753, -425, -823, -76,
  1014. -86, -1655, -1865, -174, 557, 628, 58, 1263,
  1015. -5902, -3458, -2465, -1886, 4334, -2126, -730, -371,
  1016. -217, -1146, -1245, -888, -520, -679, -398, -283,
  1017. 1561, 915, 652, 499, -3710, 1133, 7849, 3443,
  1018. -215, -840, -78, -3760, -723, -2, 256, 1777,
  1019. -543, 779, -238, -1649, -48, 14, 103, 45,
  1020. 4132, 2828, 2, -4212, -4116, -1042, -488, 0,
  1021. -1083, -1034, -713, 0, 0, 1062, 727, 0,
  1022. 1038, 710, 0, -1058, 5875, 8496, -1796, 1376,
  1023. -1786, -2107, -4406, -197, -115, -194, -3047, 644,
  1024. 931, -493, -713, 150, 640, 926, -195, 150,
  1025. 3143, 3483, 3546, -793, 4489, -603, -740, -767,
  1026. -38, -1230, -668, -680, -754, 152, 168, 171,
  1027. -861, -954, -971, 217, 2845, 7965, 3695, -5432,
  1028. 3978, -494, -3873, -833, -1801, -966, -1383, -641,
  1029. -1796, 943, 2641, 1225, -691, -1934, -897, 1319,
  1030. 1538, 150, 7139, 2049, 3097, -144, -1, -3110,
  1031. -256, -585, -14, -670, -65, -192, -18, -892,
  1032. -290, -28, -1349, -387, 618, 7520, 4729, -238,
  1033. -3373, -23, -3452, -1365, -3, -694, -283, -178,
  1034. -2170, 8, 109, 68, 127, 1548, 973, -49,
  1035. 2965, -3013, 7912, 7076, -1997, -536, -554, -3821,
  1036. -3056, -243, 545, -1431, 1455, -1280, 1301, -3417,
  1037. 361, -367, 964, 862, 2443, -929, -1113, 9677,
  1038. 4138, -364, -52, -75, -5716, -1045, 138, 166,
  1039. -63, -1443, 549, 657, -617, 234, 281, -2444,
  1040. 1966, 3309, 10085, -3399, 2105, -236, -668, -6207,
  1041. -705, -270, -397, -1210, -2037, 408, 686, 2092,
  1042. -252, -425, -1295, 436, -112, -1368, 8868, 4822,
  1043. 2048, 0, -114, -4800, -1419, -256, -9, 61,
  1044. 740, 33, 402, -2610, 14, 171, -1108, -602,
  1045. -2597, 438, -1839, 6229, 7266, -411, -11, -206,
  1046. -2368, -3223, 69, -291, 49, 987, -166, 699,
  1047. 1152, -194, 816, -2763, 3454, 553, 9127, 4946,
  1048. -5596, -728, -18, -5084, -1493, -1911, -116, -1924,
  1049. -308, -1042, -166, -2755, 1179, 188, 3117, 1689,
  1050. -532, -663, 12262, 2495, -1004, -17, -26, -9177,
  1051. -380, -61, -21, 398, 496, 81, 101, -1867,
  1052. -32, -40, 751, 152, -2100, 1317, -1509, 11425,
  1053. 2997, -269, -105, -139, -7967, -548, 168, -193,
  1054. 121, 1464, -918, 1052, 384, -240, 276, -2090,
  1055. 1193, -2697, 11259, 5373, -763, -86, -444, -7737,
  1056. -1762, -35, 196, -819, 1853, -391, 884, -3692,
  1057. 55, -125, 525, 250, 2405, -471, 11079, 203,
  1058. 782, -353, -13, -7491, -2, -37, 69, -1626,
  1059. 318, -29, 5, -137, -114, 22, -529, -9,
  1060. -1871, 5685, 11290, -2662, 1353, -213, -1972, -7780,
  1061. -432, -111, 649, 1289, -3917, -304, 923, 1834,
  1062. 154, -469, -932, 220, -3768, 5927, -3093, 5041,
  1063. 5212, -866, -2144, -584, -1551, -1658, 1363, -711,
  1064. 1119, 1159, -1824, 951, 1198, -1885, 984, -1603,
  1065. -2546, 9502, 5969, -2440, 1928, -395, -5511, -2175,
  1066. -363, -226, 1477, 927, -3462, -379, 1415, 889,
  1067. 299, -1118, -702, 287, -4963, 3568, 4592, 5508,
  1068. 3451, -1503, -777, -1287, -1851, -727, 1080, 1391,
  1069. -1000, 1668, -1199, -1543, 1045, -751, -967, -1160,
  1070. 1745, -2586, 3983, 10899, -1551, -186, -408, -968,
  1071. -7250, -146, 275, -424, 628, -1161, 1720, -2649,
  1072. 165, -244, 377, 1032, 867, -456, -727, 3369,
  1073. 11822, -45, -12, -32, -692, -8531, 24, 38,
  1074. -20, -178, 93, 149, -625, 329, 525, -2431,
  1075. 7535, 2422, 1926, 1405, 1599, -3466, -358, -226,
  1076. -120, -156, -1114, -886, -284, -646, -207, -165,
  1077. -735, -236, -188, -137, 1041, -735, -142, 13209,
  1078. 1515, -66, -33, -1, -10649, -140, 46, 9,
  1079. -6, -839, 593, 114, -96, 68, 13, -1222,
  1080. 7950, 6745, -1444, -1008, 2721, -3857, -2777, -127,
  1081. -62, -452, -3273, 700, 594, 489, 415, -88,
  1082. -1320, -1120, 239, 167, -4754, -1379, 4522, -578,
  1083. -5733, -1379, -116, -1248, -20, -2006, -400, 1312,
  1084. 380, -167, -48, 159, -1663, -482, 1582, -202,
  1085. 3220, 5978, 5923, 2430, -2689, -633, -2181, -2141,
  1086. -360, -441, -1175, -1164, -2161, -477, -886, -878,
  1087. 528, 981, 972, 398, 377, 1312, 13978, -1470,
  1088. 677, -8, -105, -11925, -132, -28, -30, -321,
  1089. -1119, 33, 117, 1254, -15, -54, -577, 60,
  1090. -3435, 6770, 314, -885, 5686, -720, -2797, -6,
  1091. -47, -1973, 1419, 65, -129, -185, 366, 16,
  1092. 1192, -2349, -109, 307, 3171, 8774, -2260, 2679,
  1093. 3069, -613, -4699, -312, -438, -575, -1698, 437,
  1094. 1210, -518, -1435, 369, -594, -1643, 423, -501,
  1095. 5557, 1509, 5407, -125, -7386, -1884, -139, -1784,
  1096. 0, -3330, -511, -1834, -498, 42, 11, 41,
  1097. 2505, 680, 2438, -56, -2838, 2595, 13228, 271,
  1098. 1793, -491, -411, -10680, -4, -196, 449, 2291,
  1099. -2095, 47, -42, -219, 310, -284, -1447, -29,
  1100. 664, -278, 14966, 951, -711, -26, -4, -13672,
  1101. -55, -30, 11, -606, 253, -38, 16, -869,
  1102. 28, -12, 650, 41, 808, 1770, 8658, 5863,
  1103. -1486, -39, -191, -4576, -2098, -134, -87, -427,
  1104. -935, -289, -633, -3098, 73, 160, 785, 531,
  1105. 3063, 1539, 2000, -542, 9576, -572, -144, -244,
  1106. -17, -5597, -287, -374, -188, 101, 51, 66,
  1107. -1790, -900, -1169, 317, 514, 14083, -323, 896,
  1108. -891, -16, -12106, -6, -49, -48, -442, 10,
  1109. 277, -28, -770, 17, 27, 766, -17, 48,
  1110. 892, 158, 5237, 11057, -1603, -48, -1, -1674,
  1111. -7462, -156, -8, -285, -50, -602, -106, -3534,
  1112. 87, 15, 512, 1082, -1612, 2564, -4296, 12526,
  1113. 5710, -158, -401, -1126, -9576, -1990, 252, -422,
  1114. 672, 1232, -1960, 3284, 561, -893, 1497, -4365,
  1115. 4889, -6878, 612, 6109, 4753, -1459, -2887, -22,
  1116. -2277, -1379, 2052, -182, 257, -1823, 2564, -228,
  1117. -1418, 1995, -177, -1772, 3053, -506, 2403, 9625,
  1118. 1322, -569, -15, -352, -5655, -106, 94, -448,
  1119. 74, -1794, 297, -1412, -246, 40, -194, -777,
  1120. -754, 12904, 4480, -2113, 1471, -34, -10163, -1225,
  1121. -272, -132, 594, 206, -3529, -97, 1664, 577,
  1122. 67, -1159, -402, 189, 4255, 1476, 5055, 2393,
  1123. 2912, -1105, -132, -1559, -349, -517, -383, -1313,
  1124. -455, -621, -215, -738, -756, -262, -898, -425,
  1125. -1371, 535, 1417, 14604, -997, -114, -17, -122,
  1126. -13017, -60, 44, 118, -46, 1222, -477, -1263,
  1127. -83, 32, 86, 888, 5368, -1744, 4083, -1236,
  1128. 3753, -1758, -185, -1017, -93, -860, 571, -1338,
  1129. 434, 405, -131, 308, -1229, 399, -935, 283,
  1130. 1588, -3097, 14415, 3699, -1171, -154, -585, -12683,
  1131. -835, -83, 300, -1397, 2725, -358, 699, -3255,
  1132. 113, -221, 1030, 264, 212, 7989, 9471, -3344,
  1133. 2009, -2, -3895, -5475, -682, -246, -103, -123,
  1134. -4618, 43, 1630, 1933, -26, -979, -1161, 410,
  1135. 856, 2294, -627, 6930, 6929, -44, -321, -24,
  1136. -2931, -2930, -119, 32, 87, -362, -970, 265,
  1137. -362, -970, 265, -2931, 2357, -4187, 7162, 7683,
  1138. 3371, -339, -1070, -3131, -3603, -693, 602, -1030,
  1139. 1830, -1105, 1963, -3359, -485, 861, -1474, -1581,
  1140. 350, 4585, 14053, -3819, 1218, -7, -1283, -12054,
  1141. -890, -90, -97, -300, -3933, 81, 1068, 3275,
  1142. -26, -341, -1045, 284, -3248, 3531, 475, 2137,
  1143. 11711, -644, -761, -13, -278, -8372, 700, 94,
  1144. -102, 423, -460, -62, 2322, -2524, -340, -1528,
  1145. -3017, 3852, 1725, 8440, 5257, -555, -905, -181,
  1146. -4348, -1686, 709, 317, -405, 1554, -1984, -889,
  1147. 968, -1236, -553, -2708, -909, 3196, 15512, -2528,
  1148. 1066, -50, -623, -14686, -390, -69, 177, 861,
  1149. -3026, -140, 493, 2393, 59, -208, -1009, 164,
  1150. 959, -3370, 9617, 9545, -1761, -56, -693, -5645,
  1151. -5561, -189, 197, -563, 1978, -558, 1963, -5603,
  1152. 103, -362, 1034, 1026, 7575, 11796, -4845, 3252,
  1153. -1703, -3502, -8493, -1433, -645, -177, -5454, 2240,
  1154. 3488, -1503, -2341, 961, 787, 1226, -503, 338,
  1155. 6409, 1722, 1764, -4191, 6015, -2507, -181, -189,
  1156. -1072, -2208, -673, -690, -185, 1639, 440, 451,
  1157. -2353, -632, -647, 1538, -2420, 12161, 5038, 1286,
  1158. -2098, -357, -9027, -1549, -100, -268, 1796, 744,
  1159. -3740, 190, -954, -395, -310, 1557, 645, 164,
  1160. -2232, -1341, 7246, 9470, -1977, -304, -109, -3204,
  1161. -5474, -238, -182, 987, 593, 1290, 775, -4188,
  1162. -269, -161, 874, 1143, 1030, 7034, 4231, 1551,
  1163. 3077, -64, -3019, -1093, -146, -577, -442, -266,
  1164. -1816, -97, -666, -400, -193, -1321, -794, -291,
  1165. 5121, 11835, -477, -1749, 2298, -1601, -8549, -13,
  1166. -186, -322, -3699, 149, 344, 546, 1264, -50,
  1167. -718, -1660, 66, 245, -3328, 3827, 5921, 9976,
  1168. -1045, -676, -894, -2140, -6075, -66, 777, 1203,
  1169. -1383, 2027, -2330, -3605, -212, 244, 377, 636,
  1170. 3813, 5718, -4666, -3412, 5674, -887, -1995, -1329,
  1171. -710, -1965, -1331, 1086, 1628, 794, 1191, -972,
  1172. -1320, -1980, 1616, 1181, 1348, -3672, 13154, 6938,
  1173. -1690, -110, -823, -10561, -2938, -174, 302, -1082,
  1174. 2948, -570, 1555, -5570, 139, -379, 1357, 716,
  1175. 2151, -3586, 6949, 12131, -1224, -282, -785, -2947,
  1176. -8982, -91, 470, -912, 1521, -1592, 2655, -5145,
  1177. 160, -268, 519, 906, -2889, 9647, 10276, -2728,
  1178. 995, -509, -5680, -6445, -454, -60, 1701, 1812,
  1179. -6051, -481, 1606, 1711, 175, -586, -624, 165,
  1180. 6177, 2184, 555, 1985, 6589, -2329, -291, -18,
  1181. -240, -2650, -823, -209, -74, -748, -264, -67,
  1182. -2484, -878, -223, -798, -492, 391, 17166, -681,
  1183. 240, -14, -9, -17987, -28, -3, 11, 515,
  1184. -410, -20, 16, 713, 7, -5, -252, 10,
  1185. 12628, 5448, -2630, 3011, -2695, -9733, -1811, -422,
  1186. -553, -443, -4199, 2027, 874, -2321, -1001, 483,
  1187. 2077, 896, -432, 495, -3628, -534, 3447, 7002,
  1188. 6751, -803, -17, -725, -2992, -2782, -118, 763,
  1189. 112, 1550, 228, -1473, 1495, 220, -1420, -2885,
  1190. -5239, 5901, 8107, 3650, 4846, -1675, -2125, -4012,
  1191. -813, -1433, 1887, 2592, -2920, 1167, -1315, -1806,
  1192. 1550, -1745, -2398, -1080, 6157, 6678, 4099, -1074,
  1193. 2348, -2314, -2722, -1025, -70, -336, -2509, -1540,
  1194. -1670, 403, 437, 268, -882, -957, -587, 153,
  1195. 1079, 16099, 242, -881, 1690, -71, -15820, -3,
  1196. -47, -174, -1060, -16, -238, 58, 865, 13,
  1197. -111, -1661, -25, 90, -278, 227, -1039, 1636,
  1198. 16945, -4, -3, -65, -163, -17526, 3, -17,
  1199. 14, 27, -22, 103, 287, -234, 1074, -1693,
  1200. 15778, -1454, 574, -603, -107, -15195, -129, -20,
  1201. -22, 0, 1400, -553, 51, 581, -53, 21,
  1202. 103, -9, 3, -3, 2406, -836, 13224, 7993,
  1203. -4266, -353, -42, -10673, -3899, -1111, 122, -1942,
  1204. 674, -1174, 407, -6451, 626, -217, 3443, 2081,
  1205. 3184, 14368, -3336, 2255, -1801, -619, -12600, -679,
  1206. -310, -198, -2793, 648, 2926, -438, -1977, 459,
  1207. 350, 1580, -366, 247, -1698, 17076, 2504, -539,
  1208. -646, -176, -17798, -382, -17, -25, 1770, 259,
  1209. -2610, -55, 561, 82, -67, 673, 98, -21,
  1210. 2375, -797, -2696, 14483, 5383, -344, -38, -443,
  1211. -12803, -1769, 115, 391, -131, -2100, 705, 2384,
  1212. -780, 262, 886, -4759, -2691, 2554, -4520, 9573,
  1213. 10655, -442, -398, -1247, -5594, -6930, 419, -742,
  1214. 704, 1572, -1492, 2641, 1750, -1661, 2939, -6226,
  1215. -4332, -4399, -1657, 4880, 7375, -1145, -1181, -167,
  1216. -1453, -3319, -1163, -438, -444, 1290, 1310, 493,
  1217. 1950, 1980, 745, -2196, -3498, 7405, 9955, 2693,
  1218. -2971, -746, -3347, -6049, -442, -538, 1581, 2125,
  1219. -4499, 575, -1217, -1636, -634, 1342, 1805, 488,
  1220. 6717, -3792, 7739, 2798, 3489, -2754, -877, -3655,
  1221. -477, -743, 1554, -3173, 1791, -1147, 647, -1321,
  1222. -1430, 807, -1648, -595, 5263, 9770, 3463, 1069,
  1223. -3971, -1690, -5826, -732, -69, -962, -3138, -1112,
  1224. -2065, -343, -637, -226, 1275, 2368, 839, 259,
  1225. 1243, -2634, 16772, 1871, 332, -94, -423, -17169,
  1226. -213, -6, 199, -1273, 2696, -142, 300, -1915,
  1227. -25, 53, -339, -37, 2691, 2836, 3105, 5711,
  1228. 4817, -442, -491, -588, -1991, -1416, -465, -510,
  1229. -537, -938, -988, -1082, -791, -834, -913, -1679,
  1230. 4366, 2944, 7210, 3627, 1161, -1163, -529, -3172,
  1231. -803, -82, -784, -1921, -1295, -966, -651, -1596,
  1232. -309, -208, -511, -257, 13888, 3951, -671, -2305,
  1233. 3354, -11773, -953, -27, -324, -686, -3349, 569,
  1234. 161, 1954, 556, -94, -2843, -809, 137, 472,
  1235. 7053, 5847, 2929, 8378, -4794, -3036, -2086, -523,
  1236. -4284, -1403, -2517, -1261, -1045, -3607, -2990, -1498,
  1237. 2064, 1711, 857, 2451, -2191, 12838, 9182, -3915,
  1238. 1617, -293, -10059, -5146, -935, -159, 1717, 1228,
  1239. -7195, -523, 3068, 2194, 216, -1267, -906, 386,
  1240. -4881, 13114, 5767, -435, 4155, -1454, -10498, -2030,
  1241. -11, -1054, 3907, 1718, -4616, -129, 348, 153,
  1242. 1238, -3326, -1462, 110, 7843, -1250, 210, 7106,
  1243. -5203, -3754, -95, -2, -3082, -1652, 598, -100,
  1244. 16, -3402, 542, -91, 2491, -397, 66, 2257,
  1245. -2463, 8168, 14551, -3908, 1828, -370, -4072, -12923,
  1246. -932, -204, 1228, 2188, -7254, -587, 1948, 3471,
  1247. 274, -911, -1623, 436, -1579, 347, -272, -2735,
  1248. 16031, -152, -7, -4, -456, -15686, 33, -26,
  1249. 5, -263, 58, -45, 1545, -340, 266, 2676,
  1250. -6327, 1328, 5093, -5079, 7617, -2443, -107, -1583,
  1251. -1574, -3541, 513, 1967, -413, -1961, 411, 1578,
  1252. 2941, -617, -2367, 2361, 3286, -4509, 11306, 11025,
  1253. -2623, -659, -1241, -7802, -7419, -420, 904, -2267,
  1254. 3112, -2211, 3034, -7608, 526, -722, 1810, 1765,
  1255. 5567, 17853, -3754, 1166, -519, -1892, -19455, -860,
  1256. -83, -16, -6067, 1275, 4090, -396, -1271, 267,
  1257. 176, 566, -119, 37, -2136, -424, 15292, 5108,
  1258. -1648, -278, -10, -14273, -1593, -165, -55, 1993,
  1259. 396, 666, 132, -4768, -214, -42, 1538, 514,
  1260. 2267, -3297, 2549, 16563, -791, -313, -663, -396,
  1261. -16745, -38, 456, -352, 513, -2291, 3333, -2576,
  1262. 109, -159, 123, 799, 3655, 1899, -3364, 6279,
  1263. 12510, -815, -220, -690, -2406, -9552, -423, 750,
  1264. 390, -1400, -728, 1289, -2791, -1450, 2568, -4794,
  1265. 8052, 2285, -6193, 5138, 6003, -3957, -318, -2341,
  1266. -1611, -2199, -1123, 3044, 864, -2525, -716, 1942,
  1267. -2950, -837, 2269, -1882, -386, -2291, 7679, 15387,
  1268. -2723, -9, -320, -3599, -14452, -452, -54, 181,
  1269. 1074, 362, 2152, -7212, -64, -380, 1276, 2557,
  1270. 2777, -1173, 3984, 13079, 2508, -470, -84, -969,
  1271. -10440, -384, 198, -675, 285, -2217, 936, -3180,
  1272. -425, 179, -610, -2002, -1879, 1771, -2684, 16705,
  1273. 1833, -215, -191, -439, -17032, -205, 203, -308,
  1274. 290, 1916, -1805, 2736, 210, -198, 300, -1869,
  1275. 1052, 4495, 15519, 1467, -4032, -67, -1233, -14700,
  1276. -131, -992, -288, -997, -4257, -94, -402, -1389,
  1277. 259, 1106, 3819, 361, 3010, 2544, 6969, 7559,
  1278. 1996, -553, -395, -2964, -3487, -243, -467, -1280,
  1279. -1082, -1388, -1174, -3215, -366, -310, -849, -921,
  1280. -5209, -1867, 8713, 10351, 1549, -1656, -212, -4634,
  1281. -6540, -146, -593, 2770, 993, 3291, 1180, -5505,
  1282. 492, 176, -824, -979, -4314, 8513, 913, 7547,
  1283. -2723, -1135, -4423, -50, -3476, -452, 2241, 240,
  1284. -474, 1987, -3921, -420, -717, 1415, 151, 1254,
  1285. 12929, -1219, 2448, 1757, 6303, -10204, -90, -365,
  1286. -188, -2425, 962, -1932, 182, -1386, 130, -262,
  1287. -4974, 469, -941, -676, 6465, 4132, 3167, 3160,
  1288. 5697, -2551, -1042, -612, -609, -1981, -1630, -1249,
  1289. -798, -1247, -797, -611, -2248, -1437, -1101, -1099,
  1290. -3636, 4859, 18914, -1335, 810, -807, -1441, -21836,
  1291. -108, -40, 1078, 4198, -5609, -296, 396, 1541,
  1292. 179, -240, -936, 66, 8844, 7864, 654, -4063,
  1293. -5680, -4774, -3774, -26, -1007, -1969, -4245, -353,
  1294. -314, 2193, 1950, 162, 3066, 2726, 226, -1408,
  1295. 1859, 2634, 9228, 996, 9464, -211, -423, -5197,
  1296. -60, -5467, -299, -1047, -1483, -113, -160, -561,
  1297. -1074, -1521, -5330, -575, 2949, 12260, 10290, -497,
  1298. -3943, -530, -9174, -6463, -15, -949, -2206, -1852,
  1299. -7700, 89, 372, 312, 709, 2950, 2476, -119,
  1300. -2903, 1552, 14867, 9970, -496, -514, -147, -13491,
  1301. -6068, -15, 275, 2634, -1408, 1766, -944, -9047,
  1302. -87, 47, 450, 302, 3243, 8234, 7586, 3373,
  1303. 2151, -642, -4138, -3512, -694, -282, -1630, -1501,
  1304. -3812, -667, -1695, -1561, -425, -1081, -996, -442,
  1305. -9631, 60, 3501, 5359, 10150, -5662, 0, -748,
  1306. -1752, -6288, 35, 2058, -12, 3150, -19, -1145,
  1307. 5967, -37, -2169, -3320, -6874, -2553, -5446, -2195,
  1308. -7841, -2884, -397, -1810, -294, -3753, -1071, -2285,
  1309. -848, -921, -342, -729, -3290, -1221, -2606, -1050,
  1310. -3413, -1141, 4630, 13612, 7897, -711, -79, -1308,
  1311. -11310, -3806, -237, 964, 322, 2836, 948, -3847,
  1312. 1645, 550, -2231, -6561, 4410, -5678, 8006, -3992,
  1313. 3811, -1187, -1968, -3912, -973, -886, 1528, -2155,
  1314. 2775, 1074, -1383, 1951, -1025, 1321, -1862, 928,
  1315. 5659, 11535, 2203, -452, 7169, -1954, -8121, -296,
  1316. -12, -3137, -3984, -761, -1551, 156, 318, 60,
  1317. -2476, -5048, -964, 197, 2914, -2914, 3485, -3965,
  1318. 13675, -518, -518, -741, -959, -11414, 518, -620,
  1319. 620, 705, -705, 843, -2433, 2432, -2909, 3310,
  1320. 7843, 1907, 1022, 8882, 7972, -3755, -222, -63,
  1321. -4815, -3879, -913, -489, -119, -4252, -1034, -554,
  1322. -3816, -928, -497, -4322, 13807, 9531, 1436, 1612,
  1323. 1779, -11636, -5544, -125, -158, -193, -8032, -1210,
  1324. -835, -1358, -938, -141, -1499, -1035, -156, -175,
  1325. 13620, -5337, 5450, -2263, 1723, -11322, -1738, -1813,
  1326. -312, -181, 4436, -4531, 1775, 1881, -737, 752,
  1327. -1432, 561, -573, 238, 5297, 8374, 8872, 7694,
  1328. 6538, -1712, -4280, -4804, -3613, -2609, -2707, -2868,
  1329. -4534, -2487, -3932, -4166, -2113, -3341, -3540, -3070
  1330. };
  1331. /**
  1332. * 0.65^i (Zero part) and 0.75^i (Pole part) scaled by 2^15
  1333. */
  1334. static const int16_t postfilter_tbl[2][LPC_ORDER] = {
  1335. /* Zero */
  1336. {21299, 13844, 8999, 5849, 3802, 2471, 1606, 1044, 679, 441},
  1337. /* Pole */
  1338. {24576, 18432, 13824, 10368, 7776, 5832, 4374, 3281, 2460, 1845}
  1339. };
  1340. /**
  1341. * Hamming window coefficients scaled by 2^15
  1342. */
  1343. static const int16_t hamming_window[LPC_FRAME] = {
  1344. 2621, 2631, 2659, 2705, 2770, 2853, 2955, 3074, 3212, 3367,
  1345. 3541, 3731, 3939, 4164, 4405, 4663, 4937, 5226, 5531, 5851,
  1346. 6186, 6534, 6897, 7273, 7661, 8062, 8475, 8899, 9334, 9780,
  1347. 10235, 10699, 11172, 11653, 12141, 12636, 13138, 13645, 14157, 14673,
  1348. 15193, 15716, 16242, 16769, 17298, 17827, 18356, 18884, 19411, 19935,
  1349. 20457, 20975, 21489, 21999, 22503, 23002, 23494, 23978, 24455, 24924,
  1350. 25384, 25834, 26274, 26704, 27122, 27529, 27924, 28306, 28675, 29031,
  1351. 29373, 29700, 30012, 30310, 30592, 30857, 31107, 31340, 31557, 31756,
  1352. 31938, 32102, 32249, 32377, 32488, 32580, 32654, 32710, 32747, 32766,
  1353. 32766, 32747, 32710, 32654, 32580, 32488, 32377, 32249, 32102, 31938,
  1354. 31756, 31557, 31340, 31107, 30857, 30592, 30310, 30012, 29700, 29373,
  1355. 29031, 28675, 28306, 27924, 27529, 27122, 26704, 26274, 25834, 25384,
  1356. 24924, 24455, 23978, 23494, 23002, 22503, 21999, 21489, 20975, 20457,
  1357. 19935, 19411, 18884, 18356, 17827, 17298, 16769, 16242, 15716, 15193,
  1358. 14673, 14157, 13645, 13138, 12636, 12141, 11653, 11172, 10699, 10235,
  1359. 9780, 9334, 8899, 8475, 8062, 7661, 7273, 6897, 6534, 6186,
  1360. 5851, 5531, 5226, 4937, 4663, 4405, 4164, 3939, 3731, 3541,
  1361. 3367, 3212, 3074, 2955, 2853, 2770, 2705, 2659, 2631, 2621
  1362. };
  1363. /**
  1364. * Binomial window coefficients scaled by 2^15
  1365. */
  1366. static const int16_t binomial_window[LPC_ORDER] = {
  1367. 32749, 32695, 32604, 32477, 32315, 32118, 31887, 31622, 31324, 30995
  1368. };
  1369. /**
  1370. * 0.994^i scaled by 2^15
  1371. */
  1372. static const int16_t bandwidth_expand[LPC_ORDER] = {
  1373. 32571, 32376, 32182, 31989, 31797, 31606, 31416, 31228, 31040, 30854
  1374. };
  1375. /**
  1376. * 0.5^i scaled by 2^15
  1377. */
  1378. static const int16_t percept_flt_tbl[2][LPC_ORDER] = {
  1379. /* Zero part */
  1380. {29491, 26542, 23888, 21499, 19349, 17414, 15673, 14106, 12695, 11425},
  1381. /* Pole part */
  1382. {16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32}
  1383. };
  1384. static const int cng_adaptive_cb_lag[4] = { 1, 0, 1, 3 };
  1385. static const int cng_filt[4] = { 273, 998, 499, 333 };
  1386. static const int cng_bseg[3] = { 2048, 18432, 231233 };
  1387. #endif /* AVCODEC_G723_1_H */