ref: afa5eb38b5102af727188c2e945fd2ccf0fe2e7f
parent: 92376697c6ad73d352a6fecae30e3dfcc86b4c49
author: Jean-Marc Valin <[email protected]>
date: Wed Mar 5 07:22:37 EST 2008
fixed-point: quantised the pitch gain table.
--- a/libcelt/pgain_table.h
+++ b/libcelt/pgain_table.h
@@ -1,130 +1,133 @@
-float pgain_table[1024] = {
-0., 0., 0., 0., 0., 0., 0., 0.,
-0.0787638, 0.0502377, 0.0370167, 0.0322025, 0.356783, 0.0669546, 0.0574281, 0.0260472,
-0.5126, 0.499592, 0.460184, 0.032245, 0.0312514, 0.0289121, 0.0265145, 0.0207962,
-0.373555, 0.468631, 0.0241895, 0.0194926, 0.0256133, 0.0238522, 0.0211873, 0.0148774,
-0.513634, 0.467355, 0.255641, 0.091945, 0.319676, 0.0593489, 0.0488637, 0.02425,
-0.297209, 0.0228254, 0.189478, 0.0192015, 0.0263458, 0.0241322, 0.0262124, 0.015507,
-0.0575023, 0.297549, 0.022103, 0.0219353, 0.0442874, 0.043595, 0.0413361, 0.0220558,
-0.512868, 0.487026, 0.269087, 0.217517, 0.0457607, 0.0364232, 0.0336818, 0.0223455,
-0.483847, 0.0214638, 0.0170899, 0.145853, 0.0216337, 0.0196664, 0.0223999, 0.0142125,
-0.548714, 0.527375, 0.512646, 0.494208, 0.43804, 0.391018, 0.15976, 0.225987,
-0.545213, 0.526942, 0.508622, 0.475946, 0.441183, 0.371154, 0.0607552, 0.0328965,
-0.290022, 0.0181251, 0.0140146, 0.0145954, 0.0196605, 0.0166212, 0.0279428, 0.0170792,
-0.511696, 0.132275, 0.014829, 0.013503, 0.0182532, 0.0174757, 0.0205852, 0.0139466,
-0.0977428, 0.405133, 0.0433083, 0.406942, 0.0743768, 0.0548698, 0.0435205, 0.0200953,
-0.44179, 0.051301, 0.238532, 0.0299119, 0.206561, 0.0297702, 0.0327521, 0.0137814,
-0.485784, 0.272048, 0.26621, 0.275012, 0.0504255, 0.0376711, 0.0278796, 0.0193517,
-0.538688, 0.504845, 0.459099, 0.276602, 0.123405, 0.24618, 0.0575136, 0.0340285,
-0.503759, 0.3308, 0.0226003, 0.213781, 0.0260914, 0.024873, 0.020094, 0.0152087,
-0.544098, 0.515877, 0.492745, 0.478337, 0.272132, 0.0488403, 0.0437556, 0.0262766,
-0.040649, 0.15058, 0.0267391, 0.0197018, 0.0240194, 0.0273171, 0.0297749, 0.0339926,
-0.488474, 0.0239941, 0.143662, 0.0149703, 0.019432, 0.0210481, 0.0253029, 0.014893,
-0.536448, 0.498304, 0.235616, 0.452697, 0.406445, 0.306984, 0.0913519, 0.0478872,
-0.483289, 0.195506, 0.201848, 0.0216449, 0.0231691, 0.0221934, 0.0242558, 0.0144529,
-0.158673, 0.0193311, 0.0199367, 0.0170375, 0.0211973, 0.0214792, 0.0216821, 0.0217097,
-0.0833342, 0.115804, 0.100556, 0.428187, 0.340127, 0.0744877, 0.0530479, 0.0277507,
-0.380068, 0.154533, 0.0203781, 0.0177103, 0.0221503, 0.0209989, 0.0242612, 0.0152092,
-0.54849, 0.531136, 0.523601, 0.518986, 0.476011, 0.43352, 0.403379, 0.0805104,
-0.480563, 0.0321039, 0.292696, 0.019032, 0.0197696, 0.0267388, 0.0213754, 0.0145281,
-0.507807, 0.466355, 0.39686, 0.0685688, 0.0564086, 0.0724607, 0.27872, 0.042135,
-0.405842, 0.0148818, 0.0144337, 0.0133937, 0.0175772, 0.0188296, 0.0242431, 0.0153982,
-0.50909, 0.254132, 0.015081, 0.0145612, 0.0151372, 0.0213557, 0.0196674, 0.0137015,
-0.474454, 0.032211, 0.0215858, 0.290435, 0.0246372, 0.030831, 0.0242935, 0.0142782,
-0.298761, 0.445731, 0.270098, 0.0376684, 0.0395962, 0.0310456, 0.0305019, 0.0140758,
-0.284279, 0.0370077, 0.0328599, 0.0290777, 0.205874, 0.0284155, 0.0287325, 0.0170486,
-0.519758, 0.485751, 0.282916, 0.441389, 0.0587818, 0.045821, 0.0332713, 0.024212,
-0.492657, 0.431496, 0.0567487, 0.375711, 0.314867, 0.0596738, 0.0392567, 0.024958,
-0.505993, 0.469388, 0.137757, 0.102308, 0.25662, 0.311787, 0.333808, 0.0777759,
-0.492582, 0.156746, 0.138669, 0.439101, 0.346335, 0.26625, 0.0826502, 0.0408158,
-0.477937, 0.184635, 0.0246974, 0.190215, 0.0297121, 0.0248674, 0.0263497, 0.0142565,
-0.537095, 0.502646, 0.481898, 0.464889, 0.0794596, 0.375978, 0.355635, 0.07709,
-0.522493, 0.498889, 0.0204957, 0.0138793, 0.0189477, 0.0200809, 0.0222631, 0.0140279,
-0.123179, 0.424567, 0.391461, 0.354527, 0.358751, 0.10282, 0.0549891, 0.0274275,
-0.528795, 0.487514, 0.459733, 0.0793026, 0.403803, 0.38799, 0.38209, 0.1471,
-0.55061, 0.529953, 0.513969, 0.509732, 0.472307, 0.362863, 0.229991, 0.0451679,
-0.294937, 0.0373008, 0.0237473, 0.192329, 0.0291248, 0.0264692, 0.0286856, 0.0170383,
-0.516345, 0.503439, 0.233098, 0.02104, 0.0306855, 0.0304296, 0.028353, 0.0181174,
-0.0376752, 0.0414287, 0.0365141, 0.0320138, 0.0416821, 0.21494, 0.0583503, 0.0310943,
-0.545536, 0.525283, 0.502468, 0.485843, 0.280668, 0.247182, 0.065109, 0.0376046,
-0.284072, 0.303033, 0.0370453, 0.0405145, 0.254611, 0.0366666, 0.0316358, 0.0131245,
-0.450164, 0.0540264, 0.0339943, 0.0357633, 0.349069, 0.0411876, 0.0387931, 0.0169509,
-0.494493, 0.186951, 0.417463, 0.448934, 0.116963, 0.271991, 0.268833, 0.0923259,
-0.539181, 0.504426, 0.480572, 0.294178, 0.38153, 0.0823093, 0.0395744, 0.0288434,
-0.49767, 0.464062, 0.0389319, 0.415059, 0.0352984, 0.0299908, 0.0293543, 0.0194198,
-0.476256, 0.373448, 0.0512192, 0.0387075, 0.0389365, 0.0521819, 0.253284, 0.0265524,
-0.513271, 0.466054, 0.191349, 0.396854, 0.0991469, 0.119392, 0.302858, 0.0563146,
-0.0580714, 0.0351893, 0.210637, 0.0275106, 0.0303196, 0.0361181, 0.037958, 0.0294124,
-0.533917, 0.511064, 0.479481, 0.136219, 0.388898, 0.319245, 0.0808824, 0.0510372,
-0.273322, 0.222921, 0.243329, 0.0288988, 0.0369452, 0.0354183, 0.0287901, 0.0153741,
-0.0552466, 0.0239783, 0.0268056, 0.191781, 0.0232597, 0.0322249, 0.0359275, 0.0330772,
-0.280616, 0.0399935, 0.396289, 0.0331576, 0.0368525, 0.0330585, 0.0260254, 0.0151421,
-0.111085, 0.0732053, 0.442937, 0.393057, 0.0992536, 0.0582644, 0.0368657, 0.0220709,
-0.505174, 0.436297, 0.11101, 0.412587, 0.10785, 0.301373, 0.0963685, 0.0489725,
-0.477113, 0.0567418, 0.0288064, 0.0321713, 0.0347067, 0.196294, 0.0375139, 0.0174825,
-0.485663, 0.251076, 0.0319754, 0.0253407, 0.190876, 0.0271973, 0.0228804, 0.015032,
-0.4694, 0.0365884, 0.211227, 0.209514, 0.0293375, 0.0288063, 0.029967, 0.0153691,
-0.546189, 0.520083, 0.50551, 0.494562, 0.453643, 0.138298, 0.0543973, 0.0398042,
-0.267047, 0.0574955, 0.033611, 0.402232, 0.0375599, 0.0336061, 0.0321448, 0.0177746,
-0.515146, 0.25702, 0.458526, 0.451461, 0.398763, 0.307401, 0.0959231, 0.0510415,
-0.0893776, 0.0847446, 0.333786, 0.0670824, 0.29655, 0.0547783, 0.0429568, 0.0199323,
-0.292708, 0.358557, 0.0399675, 0.253195, 0.0352651, 0.0299277, 0.0279988, 0.0167567,
-0.484649, 0.426842, 0.0449755, 0.032786, 0.0407841, 0.227993, 0.0357597, 0.0203768,
-0.463652, 0.245219, 0.0371621, 0.415337, 0.0366889, 0.0322565, 0.0282701, 0.0152695,
-0.536858, 0.497598, 0.466439, 0.325524, 0.281388, 0.210839, 0.228809, 0.0542916,
-0.444923, 0.0588109, 0.306314, 0.436768, 0.0462395, 0.0470134, 0.0290017, 0.0185529,
-0.514636, 0.187679, 0.443737, 0.460379, 0.416557, 0.358488, 0.361157, 0.110637,
-0.463495, 0.250563, 0.438812, 0.0403623, 0.0317018, 0.0299602, 0.0257445, 0.0160852,
-0.545175, 0.524746, 0.506926, 0.50148, 0.286488, 0.361888, 0.291088, 0.0520514,
-0.51172, 0.378545, 0.0103911, 0.0149462, 0.0201416, 0.0190087, 0.016752, 0.0142577,
-0.045519, 0.0330453, 0.0285486, 0.0299786, 0.0356514, 0.0430286, 0.207662, 0.0421054,
-0.522701, 0.48916, 0.455466, 0.112748, 0.398967, 0.137821, 0.281066, 0.056569,
-0.224965, 0.200768, 0.0232688, 0.0231001, 0.0277121, 0.0261187, 0.0256954, 0.0167706,
-0.529789, 0.466371, 0.282044, 0.474314, 0.434233, 0.391914, 0.36712, 0.134578,
-0.141838, 0.403677, 0.381201, 0.367728, 0.0450129, 0.0458031, 0.0405435, 0.0223247,
-0.544483, 0.516172, 0.50121, 0.489886, 0.427531, 0.235994, 0.336372, 0.220091,
-0.512973, 0.0135682, 0.00984772, 0.00998318, 0.0143182, 0.017734, 0.023003, 0.0139938,
-0.532619, 0.486619, 0.283427, 0.450018, 0.33591, 0.0742189, 0.0473009, 0.0294699,
-0.515734, 0.484254, 0.417976, 0.0452372, 0.0663509, 0.260578, 0.0568644, 0.0317328,
-0.483807, 0.0307962, 0.0189256, 0.0218481, 0.166457, 0.0229056, 0.0245553, 0.0145457,
-0.478671, 0.0344262, 0.0313721, 0.445091, 0.0359781, 0.03076, 0.027735, 0.0159822,
-0.432776, 0.065321, 0.0406421, 0.310838, 0.264972, 0.0333801, 0.0340246, 0.0164034,
-0.497296, 0.357495, 0.155257, 0.0206194, 0.0240947, 0.0234885, 0.0202811, 0.0159961,
-0.0530467, 0.322825, 0.245226, 0.0405491, 0.0444536, 0.0437254, 0.0387548, 0.0202728,
-0.0496423, 0.465851, 0.0396607, 0.0404733, 0.0387685, 0.0512054, 0.0409178, 0.0209648,
-0.492415, 0.113905, 0.386156, 0.416351, 0.348395, 0.0830868, 0.070118, 0.0304837,
-0.0480067, 0.0411771, 0.0294894, 0.0228534, 0.175137, 0.0350851, 0.0372561, 0.0321694,
-0.538796, 0.522438, 0.491235, 0.471766, 0.0600285, 0.0645234, 0.03373, 0.0253324,
-0.494429, 0.45912, 0.0296788, 0.0349389, 0.246274, 0.0296646, 0.0287229, 0.0169861,
-0.0428509, 0.0459492, 0.027608, 0.411753, 0.038874, 0.0486857, 0.0574385, 0.0304562,
-0.523727, 0.45972, 0.0762532, 0.455541, 0.376657, 0.312805, 0.321047, 0.104483,
-0.248798, 0.0578615, 0.259561, 0.23612, 0.0410723, 0.0276543, 0.0300453, 0.0155599,
-0.454719, 0.135757, 0.401808, 0.0690376, 0.334653, 0.0653793, 0.0414005, 0.0208336,
-0.0629488, 0.381316, 0.0575357, 0.0664022, 0.300213, 0.0470978, 0.0442278, 0.01787,
-0.5361, 0.510337, 0.491681, 0.456268, 0.102374, 0.116161, 0.269527, 0.061298,
-0.502165, 0.351121, 0.321234, 0.0230394, 0.0431045, 0.0294172, 0.0256392, 0.0182848,
-0.53043, 0.498617, 0.471897, 0.142589, 0.0975547, 0.342358, 0.327843, 0.0999274,
-0.0746568, 0.250436, 0.0441247, 0.237506, 0.0440184, 0.0439439, 0.0387285, 0.0209566,
-0.0555448, 0.0530822, 0.414562, 0.0427418, 0.0369288, 0.0438713, 0.0443696, 0.0266759,
-0.507398, 0.304542, 0.44266, 0.422075, 0.0944977, 0.0669679, 0.0407496, 0.0234118,
-0.523172, 0.492436, 0.473258, 0.064754, 0.28517, 0.0566145, 0.0362884, 0.0266862,
-0.539766, 0.514104, 0.497719, 0.304374, 0.432913, 0.399754, 0.338708, 0.0939798,
-0.160938, 0.397512, 0.41066, 0.418352, 0.334477, 0.359115, 0.29701, 0.0773729,
-0.365648, 0.305196, 0.0203123, 0.0213494, 0.0214346, 0.0273973, 0.0204158, 0.0141074,
-0.544375, 0.513947, 0.495797, 0.481077, 0.418519, 0.133062, 0.283684, 0.0437724,
-0.463821, 0.0965547, 0.0864051, 0.385377, 0.344091, 0.334203, 0.347358, 0.102106,
-0.219768, 0.411136, 0.0264795, 0.0244034, 0.0302075, 0.0299032, 0.0271124, 0.0155358,
-0.478851, 0.0360803, 0.444847, 0.0223962, 0.0326878, 0.0299389, 0.0287945, 0.0150446,
-0.535522, 0.50538, 0.48114, 0.47397, 0.0910883, 0.325223, 0.0854865, 0.0500923,
-0.465679, 0.103778, 0.327331, 0.108974, 0.173869, 0.295736, 0.258233, 0.0809207,
-0.549559, 0.528022, 0.518306, 0.512122, 0.481031, 0.455163, 0.424757, 0.284505,
-0.105361, 0.4035, 0.432965, 0.0371125, 0.0722029, 0.0473709, 0.0437242, 0.0175435,
-0.539556, 0.508145, 0.491452, 0.474864, 0.209832, 0.400763, 0.375121, 0.26657,
-0.5325, 0.506275, 0.477372, 0.257875, 0.0706501, 0.0379196, 0.0364784, 0.026075,
-0.274965, 0.0462474, 0.0313918, 0.0262821, 0.0372731, 0.183543, 0.0370259, 0.0180593,
-0.499921, 0.44112, 0.109475, 0.106255, 0.370082, 0.287331, 0.0759546, 0.0443718,
-0.0873953, 0.0519051, 0.0405878, 0.244583, 0.24331, 0.0472709, 0.0342439, 0.0193514,
-0.458317, 0.057672, 0.435058, 0.267291, 0.0477908, 0.0428445, 0.0316399, 0.0179872,
-0.508195, 0.486214, 0.0292766, 0.19827, 0.0328902, 0.0251418, 0.026129, 0.0171563,
-0.0533115, 0.0600637, 0.256955, 0.348908, 0.046663, 0.0442101, 0.0437872, 0.0212731,
+/* Each row contains 8 values for the pitch table. The lowest index value is
+ stored in the MSB (i.e. big endian ordering) */
+celt_uint16_t pgain_table[1024] = {
+0x0000, 0x0000, 0x0000, 0x0000,
+0x140d, 0x0908, 0x5b11, 0x0f07,
+0x8380, 0x7608, 0x0807, 0x0705,
+0x6078, 0x0605, 0x0706, 0x0504,
+0x8378, 0x4118, 0x520f, 0x0d06,
+0x4c06, 0x3105, 0x0706, 0x0704,
+0x0f4c, 0x0606, 0x0b0b, 0x0b06,
+0x837d, 0x4538, 0x0c09, 0x0906,
+0x7c05, 0x0425, 0x0605, 0x0604,
+0x8c87, 0x837f, 0x7064, 0x293a,
+0x8c87, 0x827a, 0x715f, 0x1008,
+0x4a05, 0x0404, 0x0504, 0x0704,
+0x8322, 0x0403, 0x0504, 0x0504,
+0x1968, 0x0b68, 0x130e, 0x0b05,
+0x710d, 0x3d08, 0x3508, 0x0804,
+0x7c46, 0x4446, 0x0d0a, 0x0705,
+0x8a81, 0x7647, 0x203f, 0x0f09,
+0x8155, 0x0637, 0x0706, 0x0504,
+0x8b84, 0x7e7a, 0x460d, 0x0b07,
+0x0a27, 0x0705, 0x0607, 0x0809,
+0x7d06, 0x2504, 0x0505, 0x0604,
+0x8980, 0x3c74, 0x684f, 0x170c,
+0x7c32, 0x3406, 0x0606, 0x0604,
+0x2905, 0x0504, 0x0505, 0x0606,
+0x151e, 0x1a6e, 0x5713, 0x0e07,
+0x6128, 0x0505, 0x0605, 0x0604,
+0x8c88, 0x8685, 0x7a6f, 0x6715,
+0x7b08, 0x4b05, 0x0507, 0x0504,
+0x8277, 0x6612, 0x0e13, 0x470b,
+0x6804, 0x0403, 0x0405, 0x0604,
+0x8241, 0x0404, 0x0405, 0x0504,
+0x7908, 0x064a, 0x0608, 0x0604,
+0x4c72, 0x450a, 0x0a08, 0x0804,
+0x4909, 0x0807, 0x3507, 0x0704,
+0x857c, 0x4871, 0x0f0c, 0x0906,
+0x7e6e, 0x0f60, 0x510f, 0x0a06,
+0x8278, 0x231a, 0x4250, 0x5514,
+0x7e28, 0x2370, 0x5944, 0x150a,
+0x7a2f, 0x0631, 0x0806, 0x0704,
+0x8981, 0x7b77, 0x1460, 0x5b14,
+0x8680, 0x0504, 0x0505, 0x0604,
+0x206d, 0x645b, 0x5c1a, 0x0e07,
+0x877d, 0x7614, 0x6763, 0x6226,
+0x8d88, 0x8482, 0x795d, 0x3b0c,
+0x4c0a, 0x0631, 0x0707, 0x0704,
+0x8481, 0x3c05, 0x0808, 0x0705,
+0x0a0b, 0x0908, 0x0b37, 0x0f08,
+0x8c86, 0x817c, 0x483f, 0x110a,
+0x494e, 0x090a, 0x4109, 0x0803,
+0x730e, 0x0909, 0x590b, 0x0a04,
+0x7f30, 0x6b73, 0x1e46, 0x4518,
+0x8a81, 0x7b4b, 0x6215, 0x0a07,
+0x7f77, 0x0a6a, 0x0908, 0x0805,
+0x7a60, 0x0d0a, 0x0a0d, 0x4107,
+0x8377, 0x3166, 0x191f, 0x4e0e,
+0x0f09, 0x3607, 0x0809, 0x0a08,
+0x8983, 0x7b23, 0x6452, 0x150d,
+0x4639, 0x3e07, 0x0909, 0x0704,
+0x0e06, 0x0731, 0x0608, 0x0908,
+0x480a, 0x6508, 0x0908, 0x0704,
+0x1c13, 0x7165, 0x190f, 0x0906,
+0x8170, 0x1c6a, 0x1c4d, 0x190d,
+0x7a0f, 0x0708, 0x0932, 0x0a04,
+0x7c40, 0x0806, 0x3107, 0x0604,
+0x7809, 0x3636, 0x0807, 0x0804,
+0x8c85, 0x817f, 0x7423, 0x0e0a,
+0x440f, 0x0967, 0x0a09, 0x0805,
+0x8442, 0x7574, 0x664f, 0x190d,
+0x1716, 0x5511, 0x4c0e, 0x0b05,
+0x4b5c, 0x0a41, 0x0908, 0x0704,
+0x7c6d, 0x0c08, 0x0a3a, 0x0905,
+0x773f, 0x0a6a, 0x0908, 0x0704,
+0x897f, 0x7753, 0x4836, 0x3b0e,
+0x720f, 0x4e70, 0x0c0c, 0x0705,
+0x8430, 0x7276, 0x6b5c, 0x5c1c,
+0x7740, 0x700a, 0x0808, 0x0704,
+0x8c86, 0x8280, 0x495d, 0x4b0d,
+0x8361, 0x0304, 0x0505, 0x0404,
+0x0c08, 0x0708, 0x090b, 0x350b,
+0x867d, 0x751d, 0x6623, 0x480e,
+0x3a33, 0x0606, 0x0707, 0x0704,
+0x8877, 0x4879, 0x6f64, 0x5e22,
+0x2467, 0x625e, 0x0c0c, 0x0a06,
+0x8b84, 0x807d, 0x6d3c, 0x5638,
+0x8303, 0x0303, 0x0405, 0x0604,
+0x887d, 0x4973, 0x5613, 0x0c08,
+0x847c, 0x6b0c, 0x1143, 0x0f08,
+0x7c08, 0x0506, 0x2b06, 0x0604,
+0x7b09, 0x0872, 0x0908, 0x0704,
+0x6f11, 0x0a50, 0x4409, 0x0904,
+0x7f5c, 0x2805, 0x0606, 0x0504,
+0x0e53, 0x3f0a, 0x0b0b, 0x0a05,
+0x0d77, 0x0a0a, 0x0a0d, 0x0a05,
+0x7e1d, 0x636b, 0x5915, 0x1208,
+0x0c0b, 0x0806, 0x2d09, 0x0a08,
+0x8a86, 0x7e79, 0x0f11, 0x0906,
+0x7f76, 0x0809, 0x3f08, 0x0704,
+0x0b0c, 0x0769, 0x0a0c, 0x0f08,
+0x8676, 0x1475, 0x6050, 0x521b,
+0x400f, 0x423c, 0x0b07, 0x0804,
+0x7423, 0x6712, 0x5611, 0x0b05,
+0x1062, 0x0f11, 0x4d0c, 0x0b05,
+0x8983, 0x7e75, 0x1a1e, 0x4510,
+0x815a, 0x5206, 0x0b08, 0x0705,
+0x8880, 0x7925, 0x1958, 0x541a,
+0x1340, 0x0b3d, 0x0b0b, 0x0a05,
+0x0e0e, 0x6a0b, 0x090b, 0x0b07,
+0x824e, 0x716c, 0x1811, 0x0a06,
+0x867e, 0x7911, 0x490e, 0x0907,
+0x8a84, 0x7f4e, 0x6f66, 0x5718,
+0x2966, 0x696b, 0x565c, 0x4c14,
+0x5e4e, 0x0505, 0x0507, 0x0504,
+0x8b84, 0x7f7b, 0x6b22, 0x490b,
+0x7719, 0x1663, 0x5856, 0x591a,
+0x3869, 0x0706, 0x0808, 0x0704,
+0x7b09, 0x7206, 0x0808, 0x0704,
+0x8981, 0x7b79, 0x1753, 0x160d,
+0x771b, 0x541c, 0x2d4c, 0x4215,
+0x8d87, 0x8583, 0x7b75, 0x6d49,
+0x1b67, 0x6f0a, 0x120c, 0x0b04,
+0x8a82, 0x7e7a, 0x3667, 0x6044,
+0x8882, 0x7a42, 0x120a, 0x0907,
+0x460c, 0x0807, 0x0a2f, 0x0905,
+0x8071, 0x1c1b, 0x5f4a, 0x130b,
+0x160d, 0x0a3f, 0x3e0c, 0x0905,
+0x750f, 0x6f44, 0x0c0b, 0x0805,
+0x827c, 0x0733, 0x0806, 0x0704,
+0x0e0f, 0x4259, 0x0c0b, 0x0b05,
};
+
--- a/libcelt/quant_pitch.c
+++ b/libcelt/quant_pitch.c
@@ -39,13 +39,20 @@
#include "arch.h"
#include "mathops.h"
-#define PGAIN(codebook, i) ((celt_pgain_t)(Q15ONE*(codebook)[i]))
+//#define PGAIN(codebook, i) ((celt_pgain_t)(Q15ONE*(codebook)[i]))
+#ifdef FIXED_POINT
+#define PGAIN(codebook, i) ((i)&1 ? (celt_word16_t)(((codebook)[(i)>>1]&0x00ffU)<<7) : (celt_word16_t)(((codebook)[(i)>>1]&0xff00U)>>1) )
+#else
+#define PGAIN(codebook, i) ((1.f/32768.f)*((i)&1 ? (celt_word16_t)(((codebook)[(i)>>1]&0x00ffU)<<7) : (celt_word16_t)(((codebook)[(i)>>1]&0xff00U)>>1) ))
+#endif
+
+
#define Q1515ONE MULT16_16(Q15ONE,Q15ONE)
/* Taken from Speex.
Finds the index of the entry in a codebook that best matches the input*/
-int vq_index(celt_pgain_t *in, const float *codebook, int len, int entries)
+int vq_index(celt_pgain_t *in, const celt_uint16_t *codebook, int len, int entries)
{
int i,j;
int index = 0;