⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseunit.c

📁 语音编结码的基本算法
💻 C
📖 第 1 页 / 共 5 页
字号:
   **  Table Structure:
   **      8 bit, 256 entry table.
   */
   
   Word16   Band2Tb8[LspCbSize*4] = {
	   0,      0,      0,      0,
		   601,    512,   -542,    334,
		   428,   1087,   -484,   -132,
		   652,    622,   -391,   -572,
		   378,    799,    141,   -860,
		   1040,    409,    112,   -554,
		   1123,    670,    -75,   -847,
		   1421,    494,   -315,  -1095,
		   787,   1001,    114,   -460,
		   988,   1672,    216,   -681,
		   1007,   1241,   -132,  -1247,
		   1073,    399,    186,     -5,
		   1262,    193,   -694,   -129,
		   325,    196,     51,   -641,
		   861,    -59,    350,   -458,
		   1261,    567,    586,   -346,
		   1532,    885,    210,   -517,
		   2027,    937,    113,   -792,
		   1383,   1064,    334,     38,
		   1964,   1468,    459,    133,
		   2062,   1186,    -98,   -121,
		   2577,   1445,    506,   -373,
		   2310,   1682,     -2,   -960,
		   2876,   1939,    765,    138,
		   3581,   2360,    649,   -414,
		   219,    176,   -398,   -309,
		   434,    -78,   -435,   -880,
		   -344,    301,    265,   -552,
		   -915,    470,    657,   -380,
		   419,   -432,   -163,   -453,
		   351,   -953,      8,   -562,
		   789,    -43,     20,   -958,
		   302,   -594,   -352,  -1159,
		   1040,    108,   -668,   -924,
		   1333,    210,  -1217,  -1663,
		   483,    589,   -350,  -1140,
		   1003,    824,   -802,  -1184,
		   745,     58,   -589,  -1443,
		   346,    247,   -915,  -1683,
		   270,    796,   -720,  -2043,
		   1208,    722,   -222,   -193,
		   1486,   1180,   -412,   -672,
		   1722,    179,    -69,   -521,
		   2047,    860,   -666,  -1410,
		   -146,    222,   -281,   -805,
		   -189,     90,   -114,  -1307,
		   -152,   1086,   -241,   -764,
		   -439,    733,   -601,  -1302,
		   -833,   -167,   -351,   -601,
		   -856,   -422,   -411,  -1059,
		   -747,   -355,   -582,  -1644,
		   -837,    210,   -916,  -1144,
		   -1800,     32,   -878,  -1687,
		   -48,    -23,  -1146,     52,
		   -350,   -409,  -1656,   -364,
		   265,   -728,   -858,   -577,
		   458,   -247,  -1141,   -997,
		   691,   -407,  -1988,  -1161,
		   -66,   -104,   -705,  -1249,
		   -431,    -93,  -1191,  -1844,
		   203,   -732,  -1000,  -1693,
		   10,   -832,  -1846,  -1819,
		   493,   -128,  -1436,  -1768,
		   488,   -311,  -1730,  -2540,
		   -653,   -532,  -1150,  -1172,
		   -1086,   -289,  -1706,  -1533,
		   -699,  -1205,  -1216,  -1766,
		   -1032,  -1481,  -2074,  -1523,
		   -721,  -1220,  -2277,  -2600,
		   12,   -539,  -1484,  -1131,
		   -40,   -911,  -2106,   -441,
		   -471,   -484,  -2267,  -1549,
		   -141,   -988,  -3006,  -1721,
		   -1545,  -2102,   -583,    342,
		   -1383,  -2772,   -386,    -13,
		   -2118,  -2589,  -1205,     72,
		   -2147,  -3231,   -965,    390,
		   -2949,  -3300,   -621,    637,
		   -3907,  -4138,   -865,    803,
		   -1287,   -845,   -375,   -548,
		   -1416,  -1169,   -487,  -1277,
		   -1400,  -1690,  -1027,   -418,
		   -2018,  -1909,  -1188,  -1260,
		   -1418,  -2222,  -2029,   -128,
		   -2067,  -2998,  -2693,   -310,
		   -950,  -1028,  -1538,    185,
		   -1616,   -915,  -2205,   -549,
		   19,   -821,  -1145,    352,
		   184,  -1175,  -1356,   -627,
		   -547,  -1088,  -1661,   -911,
		   -216,  -1502,  -2197,   -948,
		   -795,  -1306,  -2374,   -451,
		   -924,  -1889,  -2796,   -680,
		   -600,  -1614,  -3609,   -885,
		   -2392,  -2528,    319,    303,
		   -2908,  -2095,   -310,    573,
		   -3460,  -2141,     49,   -113,
		   -2231,   -448,    675,   -146,
		   -2805,   -532,   1231,    479,
		   -2684,   -486,   -200,    611,
		   -3525,   -971,   -198,    704,
		   -3707,    173,    349,    254,
		   -4734,  -1447,    -34,    880,
		   777,   -512,    114,    -10,
		   1250,    -66,    442,     -5,
		   604,    613,    452,   -352,
		   1224,    777,    675,  -1014,
		   -1372,    -79,  -1208,   -238,
		   -2389,    -17,  -1157,   -818,
		   -1504,   -673,  -1133,  -1060,
		   -1984,   -799,  -2005,  -1973,
		   -2037,   -798,  -1068,   -105,
		   -3190,   -899,  -1817,   -194,
		   -156,   -886,    394,   -318,
		   -258,  -1283,    551,    202,
		   -536,  -1729,    910,    331,
		   -847,  -1109,    795,   -163,
		   -1171,  -1128,    715,    519,
		   -1080,  -1319,   1685,    668,
		   -1000,  -1921,     96,    211,
		   -1487,  -2148,    831,    174,
		   -1139,   -374,    414,     -4,
		   -1517,  -1383,    396,   -352,
		   -1012,    439,    -59,   -967,
		   -1812,    706,   -440,  -1030,
		   -1971,   -329,    -34,   -827,
		   -2472,  -1588,   -151,   -606,
		   -2161,    374,   -281,     76,
		   -3012,    231,    -15,   -690,
		   1104,    566,    721,    209,
		   1685,    564,    383,     98,
		   1898,    750,    792,    -97,
		   556,    -64,    561,    -93,
		   876,    162,    913,    -22,
		   961,    675,   1296,    140,
		   756,   -396,    851,    544,
		   360,   -303,   1341,    396,
		   878,    -22,   1464,    863,
		   -309,   -273,    642,   -129,
		   -686,    -82,    842,    454,
		   -5,    -47,   1069,    998,
		   -94,    967,   1277,    298,
		   -489,    385,   1473,    746,
		   -369,   -717,   1333,    242,
		   281,   -993,   1726,    924,
		   464,    601,   1575,   1376,
		   -250,    206,   2339,   1175,
		   -438,    377,   -597,   -285,
		   -1020,    787,   -790,   -287,
		   -458,   -410,    215,    295,
		   -589,   -860,   -121,    797,
		   -1175,    122,   -437,    466,
		   -1480,   -121,    367,    924,
		   234,    323,    770,   -555,
		   145,     30,    996,     26,
		   66,    849,     93,   -145,
		   -117,   1261,    474,   -399,
		   -1495,   1051,    218,   -506,
		   -1390,    694,    994,     88,
		   616,      7,     78,    304,
		   1060,     52,    -62,    835,
		   833,    454,    649,   1359,
		   -770,    464,     47,     93,
		   -574,   1199,    -39,    379,
		   114,    -98,    488,    485,
		   727,    244,    606,    696,
		   -76,    455,    671,    546,
		   -565,    -13,    145,    819,
		   -376,    569,    448,   1128,
		   218,    122,    265,   1167,
		   230,    738,    932,   1003,
		   138,    477,     36,    450,
		   404,    787,    -73,   1000,
		   497,   1259,    387,   1231,
		   17,    207,    195,    -79,
		   562,    358,     53,   -158,
		   493,    387,    478,    189,
		   678,    831,    640,    558,
		   -197,    523,    613,     57,
		   429,    894,    769,    111,
		   67,   1174,    568,    511,
		   1242,    824,    251,    840,
		   1419,   1074,    864,    481,
		   924,   1474,    669,    724,
		   1539,   1879,    654,   1590,
		   445,    337,   1111,    541,
		   472,   1421,   1264,   1094,
		   794,    735,   1103,    668,
		   1055,    863,   1192,   1020,
		   778,   1105,    806,   1798,
		   1052,   1527,   1587,   2151,
		   881,   1552,   1265,    391,
		   726,    872,   1812,    601,
		   1469,    280,   1008,    616,
		   1403,    577,   1803,   1244,
		   1650,   1314,   1148,   1072,
		   1297,   1669,   1911,   1026,
		   2093,   1044,   2115,   1189,
		   1644,   1961,   2587,   1512,
		   25,   -315,     -9,   -106,
		   290,   -339,    428,   -444,
		   -68,   -783,    735,    772,
		   245,   -555,    468,     47,
		   334,   -895,    814,    146,
		   235,    368,   -964,   -959,
		   -203,    315,  -1566,  -1217,
		   801,     17,   -276,   -354,
		   894,   -495,   -789,   -635,
		   716,    291,  -1189,   -357,
		   560,   -260,   -733,     -2,
		   679,   -508,  -1429,    211,
		   -51,    -62,   -428,    557,
		   322,   -638,   -211,    614,
		   -878,  -1057,    -84,    -71,
		   -388,  -1415,   -167,   -318,
		   -754,  -1574,    214,   -539,
		   -1419,  -2004,    -92,   -787,
		   -47,   -856,   -347,   -255,
		   23,  -1211,   -173,    320,
		   -658,   -487,   -893,    353,
		   -783,  -1587,   -584,    507,
		   -1420,   -859,   -378,    441,
		   -2095,  -1491,   -137,    439,
		   -321,  -1450,  -1288,    -12,
		   -359,  -2113,   -553,     -8,
		   -831,  -1918,  -1561,     32,
		   -1014,  -2487,  -1359,   -939,
		   -475,   -311,   -169,   -236,
		   -907,   -426,    276,   -611,
		   -96,   -400,     50,   -710,
		   -426,  -1022,    -10,   -985,
		   -197,   -258,   -744,   -575,
		   -611,   -930,   -771,   -394,
		   -267,   -776,   -612,   -939,
		   -256,  -1346,   -802,  -1122,
		   -796,  -1570,   -825,   -754,
		   712,    876,    141,    227,
		   981,   1509,     85,    124,
		   1462,   1228,    979,    -39,
		   1734,    999,   1481,    440,
		   2293,   1116,    769,    440,
		   2504,   1480,   1241,    356,
		   2474,   1909,   1558,    810,
		   917,   1134,    607,   -134,
		   509,   1809,    781,   -123,
		   1712,   1506,    559,   -423,
		   2037,   2317,    726,   -155,
		   3031,   2676,   1203,    331,
		   3664,   3274,   1768,    531,
		   1610,   1839,    867,    183,
		   1774,   1972,   1538,     97,
		   1822,   2158,   1282,    659,
		   2222,   2758,   1818,    900,
		   3251,   2124,   1723,    996,
		   3633,   2336,   2408,   1453,
		   2923,   3517,   2567,   1318,
   } ;
   
   /*
   **  BandQntTable:
   **
   **  Purpose:
   **      collects the three subvector tables.
   */
   
   
   Word16  *BandQntTable[LspQntBands] = {
	   Band0Tb8 ,
		   Band1Tb8 ,
		   Band2Tb8 ,
   } ;
   
   /*
   **  PerFiltZeroTable:
   **
   **  Purpose:
   **     Creates the FIR part of the formant perceptual weighting filter. 
   **     Corresponds to gamma1 in section 2.8.
   **
   **  Table Structure:
   **     (0.9) to the x power, where x = [1,..,10]
   **     These values are scaled by 32768.
   */
   
   Word16   PerFiltZeroTable[LpcOrder] = {
	   29491 ,
		   26542 ,
		   23888 ,
		   21499 ,
		   19349 ,
		   17414 ,
		   15673 ,
		   14106 ,
		   12695 ,
		   11425 ,
   } ;
   
   /*
   **  PerFiltPoleTable:
   **
   **  Purpose:
   **     Creates the IIR part of the formant perceptual weighting filter. 
   **     Corresponds to gamma2 in section 2.8.
   **
   **  Table Structure:
   **     (0.5) to the x power, where x = [1,..,10]
   **     These values are scaled by 32768
   */
   
   Word16   PerFiltPoleTable[LpcOrder] = {
	   16384 ,
		   8192 ,
		   4096 ,
		   2048 ,
		   1024 ,
		   512 ,
		   256 ,
		   128 ,
		   64 ,
		   32 ,
   } ;
   
   /*
   **  PostFiltZeroTable:
   **
   **  Purpose:
   **     Creates the FIR part of the formant postfilter.  Corresponds to
   **     lambda1 in section 3.8.
   **
   **  Table Structure:
   **     (0.65) to the x power, where x = [1,..,10]
   **     These values are scaled by 32768
   */
   
   Word16   PostFiltZeroTable[LpcOrder] = {
	   21299 ,
		   13844 ,
		   8999 ,
		   5849 ,
		   3802 ,
		   2471 ,
		   1606 ,
		   1044 ,
		   679 ,
		   441 ,
   } ;
   
   /*
   **  PostFiltPoleTable:
   **
   **  Purpose:
   **     Creates the IIR part of the formant postfilter.  Corresponds to
   **     lambda2 in section 3.8.
   **
   **  Table Structure:
   **     (0.75) to the x power, where x = [1,..,10]
   **     These values are scaled by 32768
   */
   
   Word16   PostFiltPoleTable[LpcOrder] = {
	   24576 ,
		   18432 ,
		   13824 ,
		   10368 ,
		   7776 ,
		   5832 ,
		   4374 ,
		   3281 ,
		   2460 ,
		   1845 ,
   } ;
   
   /*
   **  Nb_puls:
   **
   **  Purpose:
   **      Indexing
   **
   **  Table Structure:
   **      Table values are the number of non-zero pulses in the high-rate
   **      excitation (MP-MLQ), indexed by subframe number (0,..,3).
   */
   
   Word16   Nb_puls[4] = { 6,5,6,5};
   
   /*
   **  FcbkGainTable:
   **
   **  Purpose:
   **      Logarithmic scalar quantizer in 24 steps of 3.2 dB each
   **
   **  Table Structure:
   **      Contains x where 20*log10(x) = 3.2*i,  i = 1,..,24
   */
   
   Word16   FcbkGainTable[NumOfGainLev] = {
	   1 ,
		   2 ,
		   3 ,
		   4 ,
		   6 ,
		   9 ,
		   13 ,
		   18 ,
		   26 ,
		   38 ,
		   55 ,
		   80 ,
		   115 ,
		   166 ,
		   240 ,
		   348 ,
		   502 ,
		   726 ,
		   1050 ,
		   1517 ,
		   2193 ,
		   3170 ,
		   4582 ,
		   6623 ,
   } ;
   
   /*
   **  MaxPosTable:
   **
   **  Purpose:
   **      size of the high rate fixed excitation codebooks (MP-MLQ)
   **
   **  Table Structure:
   **      Table values are the number of codewords in the high rate fixed
   **      excitation codebook (MP-MLQ), indexed by subframe number (0,..,3).
   **      MaxPosTable[i] is the number of combinations of i elements among 30
   **      non-zero pulses in the high-rate
   */
   
   Word32   MaxPosTable[4] = {
	   0x00090f6fL ,
		   0x00022caaL ,
		   0x00090f6fL ,
		   0x00022caaL ,
   } ;
   
   /*
   **  CombinatorialTable:
   **
   **  Purpose:
   **      used for the coding and the decoding of the pulses positions
   **      for the high-rate fixed excitation codebook
   **
   **  Table Structure:
   **      CombinatorialTable[i][j] is the number of combinations of
   **      (MaxPulsNum-1-i) elements among (SubFrLen-2-j)
   */
   
   Word32   CombinatorialTable[MaxPulseNum][SubFrLen/Sgrid] = {
	   { 118755L ,
		   98280L ,
		   80730L ,
		   65780L ,
		   53130L ,
		   42504L ,
		   33649L ,
		   26334 ,
		   20349 ,
		   15504 ,
		   11628 ,
		   8568 ,
		   6188 ,
		   4368 ,
		   3003 ,
		   2002 ,
		   1287 ,
		   792 ,
		   462 ,
		   252 ,
		   126 ,
		   56 ,
		   21 ,
		   6 ,
		   1 ,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -