[FFmpeg-soc] [soc]: r1264 - in qcelp: qcelpdata.h qcelpdec.c

reynaldo subversion at mplayerhq.hu
Thu Aug 30 22:29:16 CEST 2007


Author: reynaldo
Date: Thu Aug 30 22:29:16 2007
New Revision: 1264

Log:
Store LSP vector quantization table values as uint16_t instead of float.
-- Another from Michael's review.
(This might be just a part of a more general change over the lspf/lspv code)


Modified:
   qcelp/qcelpdata.h
   qcelp/qcelpdec.c

Modified: qcelp/qcelpdata.h
==============================================================================
--- qcelp/qcelpdata.h	(original)
+++ qcelp/qcelpdata.h	Thu Aug 30 22:29:16 2007
@@ -211,131 +211,137 @@ static const QCELPBitmap QCELP_REFERENCE
 
 typedef struct
 {
-    float x;
-    float y;
-} qcelp_fvector;
+    uint16_t x;
+    uint16_t y;
+} qcelp_vector;
 
-static const qcelp_fvector qcelp_lspvq1[]={
-{.0327,.0118},{.0919,.0111},{.0427,.0440},{.1327,.0185},
-{.0469,.0050},{.1272,.0091},{.0892,.0059},{.1771,.0193},
-{.0222,.0158},{.1100,.0127},{.0827,.0055},{.0978,.0791},
-{.0665,.0047},{.0700,.1401},{.0670,.0859},{.1913,.1048},
-{.0471,.0215},{.1046,.0125},{.0645,.0298},{.1599,.0160},
-{.0593,.0039},{.1187,.0462},{.0749,.0341},{.1520,.0511},
-{.0290,.0792},{.0909,.0362},{.0753,.0081},{.1111,.1058},
-{.0519,.0253},{.0828,.0839},{.0685,.0541},{.1421,.1258},
-{.0386,.0130},{.0962,.0119},{.0542,.0387},{.1431,.0185},
-{.0526,.0051},{.1175,.0260},{.0831,.0167},{.1728,.0510},
-{.0273,.0437},{.1172,.0113},{.0771,.0144},{.1122,.0751},
-{.0619,.0119},{.0492,.1276},{.0658,.0695},{.1882,.0615},
-{.0415,.0200},{.1018,.0088},{.0681,.0339},{.1436,.0325},
-{.0555,.0122},{.1042,.0485},{.0826,.0345},{.1374,.0743},
-{.0383,.1018},{.1005,.0358},{.0704,.0086},{.1301,.0586},
-{.0597,.0241},{.0832,.0621},{.0555,.0573},{.1504,.0839}};
+/**
+ * LSP Vector quantization tables in x*10000 form.
+ *
+ * TIA/EIA/IS-733 tables 2.4.3.2.6.3-1 through 2.4.3.2.6.3-5
+ */
 
-static const qcelp_fvector qcelp_lspvq2[]={
-{.0255,.0293},{.0904,.0219},{.0151,.1211},{.1447,.0498},
-{.0470,.0253},{.1559,.0177},{.1547,.0994},{.2394,.0242},
-{.0091,.0813},{.0857,.0590},{.0934,.1326},{.1889,.0282},
-{.0813,.0472},{.1057,.1494},{.0450,.3315},{.2163,.1895},
-{.0538,.0532},{.1399,.0218},{.0146,.1552},{.1755,.0626},
-{.0822,.0202},{.1299,.0663},{.0706,.1732},{.2656,.0401},
-{.0418,.0745},{.0762,.1038},{.0583,.1748},{.1746,.1285},
-{.0527,.1169},{.1314,.0830},{.0556,.2116},{.1073,.2321},
-{.0297,.0570},{.0981,.0403},{.0468,.1103},{.1740,.0243},
-{.0725,.0179},{.1255,.0474},{.1374,.1362},{.1922,.0912},
-{.0285,.0947},{.0930,.0700},{.0593,.1372},{.1909,.0576},
-{.0588,.0916},{.1110,.1116},{.0224,.2719},{.1633,.2220},
-{.0402,.0520},{.1061,.0448},{.0402,.1352},{.1499,.0775},
-{.0664,.0589},{.1081,.0727},{.0801,.2206},{.2165,.1157},
-{.0566,.0802},{.0911,.1116},{.0306,.1703},{.1792,.0836},
-{.0655,.0999},{.1061,.1038},{.0298,.2089},{.1110,.1753},
-{.0361,.0311},{.0970,.0239},{.0265,.1231},{.1495,.0573},
-{.0566,.0262},{.1569,.0293},{.1341,.1144},{.2271,.0544},
-{.0214,.0877},{.0847,.0719},{.0794,.1384},{.2067,.0274},
-{.0703,.0688},{.1099,.1306},{.0391,.2947},{.2024,.1670},
-{.0471,.0525},{.1245,.0290},{.0264,.1557},{.1568,.0807},
-{.0718,.0399},{.1193,.0685},{.0883,.1594},{.2729,.0764},
-{.0500,.0754},{.0809,.1108},{.0541,.1648},{.1523,.1385},
-{.0614,.1196},{.1209,.0847},{.0345,.2242},{.1442,.1747},
-{.0199,.0560},{.1092,.0194},{.0349,.1253},{.1653,.0507},
-{.0625,.0354},{.1376,.0431},{.1187,.1465},{.2164,.0872},
-{.0360,.0974},{.1008,.0698},{.0704,.1346},{.2114,.0452},
-{.0720,.0816},{.1240,.1089},{.0439,.2475},{.1498,.2040},
-{.0336,.0718},{.1213,.0187},{.0451,.1450},{.1368,.0885},
-{.0592,.0578},{.1131,.0531},{.0861,.1855},{.1764,.1500},
-{.0444,.0970},{.0935,.0903},{.0424,.1687},{.1633,.1102},
-{.0793,.0897},{.1060,.0897},{.0185,.2011},{.1205,.1855}};
+static const qcelp_vector qcelp_lspvq1[]={
+{ 327, 118},{ 919, 111},{ 427, 440},{1327, 185},
+{ 469,  50},{1272,  91},{ 892,  59},{1771, 193},
+{ 222, 158},{1100, 127},{ 827,  55},{ 978, 791},
+{ 665,  47},{ 700,1401},{ 670, 859},{1913,1048},
+{ 471, 215},{1046, 125},{ 645, 298},{1599, 160},
+{ 593,  39},{1187, 462},{ 749, 341},{1520, 511},
+{ 290, 792},{ 909, 362},{ 753,  81},{1111,1058},
+{ 519, 253},{ 828, 839},{ 685, 541},{1421,1258},
+{ 386, 130},{ 962, 119},{ 542, 387},{1431, 185},
+{ 526,  51},{1175, 260},{ 831, 167},{1728, 510},
+{ 273, 437},{1172, 113},{ 771, 144},{1122, 751},
+{ 619, 119},{ 492,1276},{ 658, 695},{1882, 615},
+{ 415, 200},{1018,  88},{ 681, 339},{1436, 325},
+{ 555, 122},{1042, 485},{ 826, 345},{1374, 743},
+{ 383,1018},{1005, 358},{ 704,  86},{1301, 586},
+{ 597, 241},{ 832, 621},{ 555, 573},{1504, 839}};
 
-static const qcelp_fvector qcelp_lspvq3[]={
-{.0225,.0283},{.1296,.0355},{.0543,.0343},{.2073,.0274},
-{.0204,.1099},{.1562,.0523},{.1388,.0161},{.2784,.0274},
-{.0112,.0849},{.1870,.0175},{.1189,.0160},{.1490,.1088},
-{.0969,.1115},{.0659,.3322},{.1158,.1073},{.3183,.1363},
-{.0517,.0223},{.1740,.0223},{.0704,.0387},{.2637,.0234},
-{.0692,.1005},{.1287,.1610},{.0952,.0532},{.2393,.0646},
-{.0490,.0552},{.1619,.0657},{.0845,.0670},{.1784,.2280},
-{.0191,.1775},{.0272,.2868},{.0942,.0952},{.2628,.1479},
-{.0278,.0579},{.1565,.0218},{.0814,.0180},{.2379,.0187},
-{.0276,.1444},{.1199,.1223},{.1200,.0349},{.3009,.0307},
-{.0312,.0844},{.1898,.0306},{.0863,.0470},{.1685,.1241},
-{.0513,.1727},{.0711,.2233},{.1085,.0864},{.3398,.0527},
-{.0414,.0440},{.1356,.0612},{.0964,.0147},{.2173,.0738},
-{.0465,.1292},{.0877,.1749},{.1104,.0689},{.2105,.1311},
-{.0580,.0864},{.1895,.0752},{.0652,.0609},{.1485,.1699},
-{.0514,.1400},{.0386,.2131},{.0933,.0798},{.2473,.0986},
-{.0334,.0360},{.1375,.0398},{.0621,.0276},{.2183,.0280},
-{.0311,.1114},{.1382,.0807},{.1284,.0175},{.2605,.0636},
-{.0230,.0816},{.1739,.0408},{.1074,.0176},{.1619,.1120},
-{.0784,.1371},{.0448,.3050},{.1189,.0880},{.3039,.1165},
-{.0424,.0241},{.1672,.0186},{.0815,.0333},{.2432,.0324},
-{.0584,.1029},{.1137,.1546},{.1015,.0585},{.2198,.0995},
-{.0574,.0581},{.1746,.0647},{.0733,.0740},{.1938,.1737},
-{.0347,.1710},{.0373,.2429},{.0787,.1061},{.2439,.1438},
-{.0185,.0536},{.1489,.0178},{.0703,.0216},{.2178,.0487},
-{.0154,.1421},{.1414,.0994},{.1103,.0352},{.3072,.0473},
-{.0408,.0819},{.2055,.0168},{.0998,.0354},{.1917,.1140},
-{.0665,.1799},{.0993,.2213},{.1234,.0631},{.3003,.0762},
-{.0373,.0620},{.1518,.0425},{.0913,.0300},{.1966,.0836},
-{.0402,.1185},{.0948,.1385},{.1121,.0555},{.1802,.1509},
-{.0474,.0886},{.1888,.0610},{.0739,.0585},{.1231,.2379},
-{.0661,.1335},{.0205,.2211},{.0823,.0822},{.2480,.1179}};
+static const qcelp_vector qcelp_lspvq2[]={
+{ 255, 293},{ 904, 219},{ 151,1211},{1447, 498},
+{ 470, 253},{1559, 177},{1547, 994},{2394, 242},
+{  91, 813},{ 857, 590},{ 934,1326},{1889, 282},
+{ 813, 472},{1057,1494},{ 450,3315},{2163,1895},
+{ 538, 532},{1399, 218},{ 146,1552},{1755, 626},
+{ 822, 202},{1299, 663},{ 706,1732},{2656, 401},
+{ 418, 745},{ 762,1038},{ 583,1748},{1746,1285},
+{ 527,1169},{1314, 830},{ 556,2116},{1073,2321},
+{ 297, 570},{ 981, 403},{ 468,1103},{1740, 243},
+{ 725, 179},{1255, 474},{1374,1362},{1922, 912},
+{ 285, 947},{ 930, 700},{ 593,1372},{1909, 576},
+{ 588, 916},{1110,1116},{ 224,2719},{1633,2220},
+{ 402, 520},{1061, 448},{ 402,1352},{1499, 775},
+{ 664, 589},{1081, 727},{ 801,2206},{2165,1157},
+{ 566, 802},{ 911,1116},{ 306,1703},{1792, 836},
+{ 655, 999},{1061,1038},{ 298,2089},{1110,1753},
+{ 361, 311},{ 970, 239},{ 265,1231},{1495, 573},
+{ 566, 262},{1569, 293},{1341,1144},{2271, 544},
+{ 214, 877},{ 847, 719},{ 794,1384},{2067, 274},
+{ 703, 688},{1099,1306},{ 391,2947},{2024,1670},
+{ 471, 525},{1245, 290},{ 264,1557},{1568, 807},
+{ 718, 399},{1193, 685},{ 883,1594},{2729, 764},
+{ 500, 754},{ 809,1108},{ 541,1648},{1523,1385},
+{ 614,1196},{1209, 847},{ 345,2242},{1442,1747},
+{ 199, 560},{1092, 194},{ 349,1253},{1653, 507},
+{ 625, 354},{1376, 431},{1187,1465},{2164, 872},
+{ 360, 974},{1008, 698},{ 704,1346},{2114, 452},
+{ 720, 816},{1240,1089},{ 439,2475},{1498,2040},
+{ 336, 718},{1213, 187},{ 451,1450},{1368, 885},
+{ 592, 578},{1131, 531},{ 861,1855},{1764,1500},
+{ 444, 970},{ 935, 903},{ 424,1687},{1633,1102},
+{ 793, 897},{1060, 897},{ 185,2011},{1205,1855}};
 
-static const qcelp_fvector qcelp_lspvq4[]={
-{.0348,.0311},{.0812,.1145},{.0552,.0461},{.1826,.0263},
-{.0601,.0675},{.1730,.0172},{.1523,.0193},{.2449,.0277},
-{.0334,.0668},{.0805,.1441},{.1319,.0207},{.1684,.0910},
-{.0582,.1318},{.1403,.1098},{.0979,.0832},{.2700,.1359},
-{.0624,.0228},{.1292,.0979},{.0800,.0195},{.2226,.0285},
-{.0730,.0862},{.1537,.0601},{.1115,.0509},{.2720,.0354},
-{.0218,.1167},{.1212,.1538},{.1074,.0247},{.1674,.1710},
-{.0322,.2142},{.1263,.0777},{.0981,.0556},{.2119,.1710},
-{.0193,.0596},{.1035,.0957},{.0694,.0397},{.1997,.0253},
-{.0743,.0603},{.1584,.0321},{.1346,.0346},{.2221,.0708},
-{.0451,.0732},{.1040,.1415},{.1184,.0230},{.1853,.0919},
-{.0310,.1661},{.1625,.0706},{.0856,.0843},{.2902,.0702},
-{.0467,.0348},{.1108,.1048},{.0859,.0306},{.1964,.0463},
-{.0560,.1013},{.1425,.0533},{.1142,.0634},{.2391,.0879},
-{.0397,.1084},{.1345,.1700},{.0976,.0248},{.1887,.1189},
-{.0644,.2087},{.1262,.0603},{.0877,.0550},{.2203,.1307}};
+static const qcelp_vector qcelp_lspvq3[]={
+{ 225, 283},{1296, 355},{ 543, 343},{2073, 274},
+{ 204,1099},{1562, 523},{1388, 161},{2784, 274},
+{ 112, 849},{1870, 175},{1189, 160},{1490,1088},
+{ 969,1115},{ 659,3322},{1158,1073},{3183,1363},
+{ 517, 223},{1740, 223},{ 704, 387},{2637, 234},
+{ 692,1005},{1287,1610},{ 952, 532},{2393, 646},
+{ 490, 552},{1619, 657},{ 845, 670},{1784,2280},
+{ 191,1775},{ 272,2868},{ 942, 952},{2628,1479},
+{ 278, 579},{1565, 218},{ 814, 180},{2379, 187},
+{ 276,1444},{1199,1223},{1200, 349},{3009, 307},
+{ 312, 844},{1898, 306},{ 863, 470},{1685,1241},
+{ 513,1727},{ 711,2233},{1085, 864},{3398, 527},
+{ 414, 440},{1356, 612},{ 964, 147},{2173, 738},
+{ 465,1292},{ 877,1749},{1104, 689},{2105,1311},
+{ 580, 864},{1895, 752},{ 652, 609},{1485,1699},
+{ 514,1400},{ 386,2131},{ 933, 798},{2473, 986},
+{ 334, 360},{1375, 398},{ 621, 276},{2183, 280},
+{ 311,1114},{1382, 807},{1284, 175},{2605, 636},
+{ 230, 816},{1739, 408},{1074, 176},{1619,1120},
+{ 784,1371},{ 448,3050},{1189, 880},{3039,1165},
+{ 424, 241},{1672, 186},{ 815, 333},{2432, 324},
+{ 584,1029},{1137,1546},{1015, 585},{2198, 995},
+{ 574, 581},{1746, 647},{ 733, 740},{1938,1737},
+{ 347,1710},{ 373,2429},{ 787,1061},{2439,1438},
+{ 185, 536},{1489, 178},{ 703, 216},{2178, 487},
+{ 154,1421},{1414, 994},{1103, 352},{3072, 473},
+{ 408, 819},{2055, 168},{ 998, 354},{1917,1140},
+{ 665,1799},{ 993,2213},{1234, 631},{3003, 762},
+{ 373, 620},{1518, 425},{ 913, 300},{1966, 836},
+{ 402,1185},{ 948,1385},{1121, 555},{1802,1509},
+{ 474, 886},{1888, 610},{ 739, 585},{1231,2379},
+{ 661,1335},{ 205,2211},{ 823, 822},{2480,1179}};
 
-static const qcelp_fvector qcelp_lspvq5[]={
-{.0360,.0222},{.0820,.1097},{.0601,.0319},{.1656,.0198},
-{.0604,.0513},{.1552,.0141},{.1391,.0155},{.2474,.0261},
-{.0269,.0785},{.1463,.0646},{.1123,.0191},{.2015,.0223},
-{.0785,.0844},{.1202,.1011},{.0980,.0807},{.3014,.0793},
-{.0570,.0180},{.1135,.1382},{.0778,.0256},{.1901,.0179},
-{.0807,.0622},{.1461,.0458},{.1231,.0178},{.2028,.0821},
-{.0387,.0927},{.1496,.1004},{.0888,.0392},{.2246,.0341},
-{.0295,.1462},{.1156,.0694},{.1022,.0473},{.2226,.1364},
-{.0210,.0478},{.1029,.1020},{.0722,.0181},{.1730,.0251},
-{.0730,.0488},{.1465,.0293},{.1303,.0326},{.2595,.0387},
-{.0458,.0584},{.1569,.0742},{.1029,.0173},{.1910,.0495},
-{.0605,.1159},{.1268,.0719},{.0973,.0646},{.2872,.0428},
-{.0443,.0334},{.0835,.1465},{.0912,.0138},{.1716,.0442},
-{.0620,.0778},{.1316,.0450},{.1186,.0335},{.1446,.1665},
-{.0486,.1050},{.1675,.1019},{.0880,.0278},{.2214,.0202},
-{.0539,.1564},{.1142,.0533},{.0984,.0391},{.2130,.1089}};
+static const qcelp_vector qcelp_lspvq4[]={
+{ 348, 311},{ 812,1145},{ 552, 461},{1826, 263},
+{ 601, 675},{1730, 172},{1523, 193},{2449, 277},
+{ 334, 668},{ 805,1441},{1319, 207},{1684, 910},
+{ 582,1318},{1403,1098},{ 979, 832},{2700,1359},
+{ 624, 228},{1292, 979},{ 800, 195},{2226, 285},
+{ 730, 862},{1537, 601},{1115, 509},{2720, 354},
+{ 218,1167},{1212,1538},{1074, 247},{1674,1710},
+{ 322,2142},{1263, 777},{ 981, 556},{2119,1710},
+{ 193, 596},{1035, 957},{ 694, 397},{1997, 253},
+{ 743, 603},{1584, 321},{1346, 346},{2221, 708},
+{ 451, 732},{1040,1415},{1184, 230},{1853, 919},
+{ 310,1661},{1625, 706},{ 856, 843},{2902, 702},
+{ 467, 348},{1108,1048},{ 859, 306},{1964, 463},
+{ 560,1013},{1425, 533},{1142, 634},{2391, 879},
+{ 397,1084},{1345,1700},{ 976, 248},{1887,1189},
+{ 644,2087},{1262, 603},{ 877, 550},{2203,1307}};
+
+static const qcelp_vector qcelp_lspvq5[]={
+{ 360, 222},{ 820,1097},{ 601, 319},{1656, 198},
+{ 604, 513},{1552, 141},{1391, 155},{2474, 261},
+{ 269, 785},{1463, 646},{1123, 191},{2015, 223},
+{ 785, 844},{1202,1011},{ 980, 807},{3014, 793},
+{ 570, 180},{1135,1382},{ 778, 256},{1901, 179},
+{ 807, 622},{1461, 458},{1231, 178},{2028, 821},
+{ 387, 927},{1496,1004},{ 888, 392},{2246, 341},
+{ 295,1462},{1156, 694},{1022, 473},{2226,1364},
+{ 210, 478},{1029,1020},{ 722, 181},{1730, 251},
+{ 730, 488},{1465, 293},{1303, 326},{2595, 387},
+{ 458, 584},{1569, 742},{1029, 173},{1910, 495},
+{ 605,1159},{1268, 719},{ 973, 646},{2872, 428},
+{ 443, 334},{ 835,1465},{ 912, 138},{1716, 442},
+{ 620, 778},{1316, 450},{1186, 335},{1446,1665},
+{ 486,1050},{1675,1019},{ 880, 278},{2214, 202},
+{ 539,1564},{1142, 533},{ 984, 391},{2130,1089}};
 
 /**
  * Gain parameters

Modified: qcelp/qcelpdec.c
==============================================================================
--- qcelp/qcelpdec.c	(original)
+++ qcelp/qcelpdec.c	Thu Aug 30 22:29:16 2007
@@ -119,16 +119,16 @@ static void qcelp_decode_lspf(const QCEL
     {
         lspv=frame->data+QCELP_LSPV0_POS;
 
-        lspf[0]=        qcelp_lspvq1[lspv[0]].x;
-        lspf[1]=lspf[0]+qcelp_lspvq1[lspv[0]].y;
-        lspf[2]=lspf[1]+qcelp_lspvq2[lspv[1]].x;
-        lspf[3]=lspf[2]+qcelp_lspvq2[lspv[1]].y;
-        lspf[4]=lspf[3]+qcelp_lspvq3[lspv[2]].x;
-        lspf[5]=lspf[4]+qcelp_lspvq3[lspv[2]].y;
-        lspf[6]=lspf[5]+qcelp_lspvq4[lspv[3]].x;
-        lspf[7]=lspf[6]+qcelp_lspvq4[lspv[3]].y;
-        lspf[8]=lspf[7]+qcelp_lspvq5[lspv[4]].x;
-        lspf[9]=lspf[8]+qcelp_lspvq5[lspv[4]].y;
+        lspf[0]=        qcelp_lspvq1[lspv[0]].x / 10000.0;
+        lspf[1]=lspf[0]+qcelp_lspvq1[lspv[0]].y / 10000.0;
+        lspf[2]=lspf[1]+qcelp_lspvq2[lspv[1]].x / 10000.0;
+        lspf[3]=lspf[2]+qcelp_lspvq2[lspv[1]].y / 10000.0;
+        lspf[4]=lspf[3]+qcelp_lspvq3[lspv[2]].x / 10000.0;
+        lspf[5]=lspf[4]+qcelp_lspvq3[lspv[2]].y / 10000.0;
+        lspf[6]=lspf[5]+qcelp_lspvq4[lspv[3]].x / 10000.0;
+        lspf[7]=lspf[6]+qcelp_lspvq4[lspv[3]].y / 10000.0;
+        lspf[8]=lspf[7]+qcelp_lspvq5[lspv[4]].x / 10000.0;
+        lspf[9]=lspf[8]+qcelp_lspvq5[lspv[4]].y / 10000.0;
     }
 }
 



More information about the FFmpeg-soc mailing list