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

📄 decg722.c

📁 C__ code For Audio Coding
💻 C
📖 第 1 页 / 共 3 页
字号:
{-167, -67},{-331,-530},{ 244, 245},{ 246, 247},
{ 248, 249},{ 250, 251},{ 252, 253},{ 254, 255},
{ 256, 257},{ 258, 259},{ 260, 261},{ 262,-336},
{ 263,-171},{-192,-207},{-258,-138},{ 264, 265},
{ 266, 267},{ 268, 269},{ 270, 271},{ 272, 273},
{ 274, -45},{-335,-411},{ -43, -18},{-265, -71},
{-316,-326},{-350,-407},{-146, -14},{ 275, 276},
{ 277, 278},{ 279, 280},{ 281,-216},{ -34,-283},
{-291,-312},{-410,-168},{-555, 282},{ -70, -53},
{-235, -87},{ -77,-183},{-315,-332},{-178, -58},
{ 283, 284},{ 285, 286},{ 287, 288},{ 289, 290},
{ 291, 292},{ 293, 294},{ 295, 296},{ 297, 298},
{-202,-226},{-170,-267},{-134,-290},{-355,-385},
{-386, -47},{-526,-196},{ 299, 300},{ 301, 302},
{ 303, 304},{ 305, 306},{ 307, 308},{ 309, 310},
{ 311, 312},{ 313, 314},{ 315, 316},{ 317, 318},
{ 319, 320},{ 321, 322},{ 323, 324},{ 325,-111},
{-231,-253},{ -91, -82},{-172,-145},{ -22,-317},
{ -90,-356},{-382,-159},{ 326, 327},{ 328, 329},
{ 330, 331},{ 332, 333},{ 334, 335},{-106,-263},
{-278,-215},{-110, -39},{-101,-377},{-129, -63},
{-436,-195},{-506,-531},{ 336,-212},{-154,-266},
{ -59,-288},{-292,-303},{-337,-432},{-188,-451},
{-456,-460},{-501,-236},{-551, 337},{ 338, 339},
{ 340, 341},{ 342, 343},{ 344, 345},{ 346, 347},
{ 348, 349},{ 350, 351},{ 352, 353},{ 354, 355},
{ 356, 357},{ 358, 359},{ 360, 361},{ 362, 363},
{ 364, 365},{ 366, 367},{ 368, 369},{ 370, 371},
{ 372, 373},{ 374, 375},{ 376, 377},{ 378, 379},
{ 380, 381},{ 382, 383},{ 384, 385},{ 386, 387},
{ 388, 389},{ 390, 391},{ 392, 393},{ 394, 395},
{ 396, 397},{ 398, 399},{ 400, 401},{ 402, 403},
{ 404, 405},{ 406, 407},{ -72,-272},{-309,-333},
{-340,-360},{ -68,-387},{-184,-416},{-427,-147},
{-435,-437},{-115,-480},{-510,-532},{-164,-556},
{ 408,-295},{-296,-297},{-107,-313},{-193,-173},
{-320,-327},{-341,-351},{-352,-143},{-378, -19},
{-403,-412},{-268, -54},{ -83,-441},{-442,-457},
{-475, -44},{ -97,-511},{-515,-208},{-527,-528},
{-237,-536},{-552, 409},{ 410, 411},{ 412, 413},
{ 414, 415},{ 416, 417},{ 418, 419},{ 420, 421},
{ 422, 423},{ 424, 425},{ 426, 427},{ 428, 429},
{ 430, 431},{ 432, 433},{ 434, 435},{ 436, 437},
{ 438, 439},{ 440, 441},{ 442, 443},{ 444, 445},
{ 446, 447},{ 448, 449},{ 450, 451},{ 452, 453},
{ 454, 455},{ 456, 457},{ 458, 459},{ 460, 461},
{ 462, 463},{ 464, 465},{ 466, 467},{ 468, 469},
{ 470, 471},{ 472, 473},{ 474, 475},{ 476, 477},
{ 478, 479},{ 480, 481},{ 482, 483},{ 484, 485},
{ 486, 487},{ 488, 489},{ 490, 491},{ 492, 493},
{ 494, 495},{ 496, 497},{ 498, 499},{ 500, 501},
{ 502, 503},{ 504, 505},{ 506, 507},{ 508, 509},
{ 510, 511},{ 512, 513},{ 514, 515},{ 516, 517},
{ 518,-104},{ -84,-218},{-318,-319},{-117,-321},
{-322,-323},{-219,-174},{-243,-328},{-329, -94},
{-228,-194},{-240,-334},{-102,-229},{-169,-338},
{-339,-116},{-289,-342},{-343,-345},{-346,-347},
{ -23,-203},{-214,-353},{-204,-220},{-357,-358},
{-264,-361},{-362,-363},{-365,-366},{-367, -92},
{-245,-121},{-293,-379},{-108,-232},{-221,-383},
{-384,-233},{-294,-241},{-388,-389},{-390,-391},
{-392,-393},{-394,-395},{-396,-397},{-398, -24},
{-109,-149},{-242,-404},{ -64, -79},{ -89,-408},
{-409,-213},{-120,-113},{-413,-414},{-415, -96},
{-417,-418},{-419,-420},{-421,-422},{-423,-298},
{ -69,-269},{-428,-429},{ -78,-270},{ -88,-433},
{-434,-271},{-234,-259},{-438,-439},{-440,-227},
{-179,-443},{-445,-446},{-447,-223},{-238,-452},
{-453,-454},{-273,-254},{-246,-458},{-459, -48},
{-461,-462},{-463,-465},{-466,-467},{-468,-470},
{-471,-304},{-476,-477},{-478,-112},{-481,-482},
{-483,-485},{-486,-487},{-490,-491},{-103,-118},
{-502,-503},{-504,-189},{ -93,-507},{-508,-509},
{-148,-139},{-512,-513},{-308,-516},{-517,-518},
{-520,-521},{ -73, -98},{ -95, -49},{-529,-222},
{-217,-197},{-533,-534},{-535,-284},{-537,-538},
{-540,-541},{-542,-543},{-545,-546},{-144,-198},
{-314,-553},{-209,-279},{-557,-558},{-560,-561},
{-562,-563},{-565,-566},{-567,-575},{-576,-577},
{-578,-580},{-581,-582},{-583,-585},{-586,-587},
{-590,-591},{-600,-601},{-605,-606}
};
static __ALIGN32 CONST Ipp16s  cnstDecMLTTreeCtg4_G722[208][2] = {
{   1,   2},{   3,   0},{   4,   5},{   6,   7},
{   8,   9},{  10,  11},{  12, -64},{  -1,  13},
{  14, -16},{  -4,  15},{  16,  17},{  18, -80},
{  -5,  19},{  20,  21},{ -20,  22},{  23, -65},
{ -84, -21},{ -68,  24},{ -17,  25},{  26,  27},
{  28, -81},{ -69, -85},{  29,  30},{  31,  32},
{-128,  33},{  34,  35},{  -2,  36},{  37,  38},
{-144,  39},{  40,  -6},{  41,  42},{ -32,  43},
{  44,  -8},{  45, -25},{ -96,  46},{  47,-100},
{  -9,  48},{  49, -36},{  50, -24},{  51,  52},
{  53,-148},{  54,  55},{ -22,  56},{  57,  58},
{-132, -89},{  59,  60},{-101,  61},{ -37,  62},
{ -18,  63},{ -88,-129},{ -66, -70},{ -97,  64},
{ -72, -73},{  65,-145},{-149, -86},{  66, -33},
{  67,-133},{  68,  69},{  70,  71},{-192,  72},
{  73,-160},{ -82,  74},{-164,  75},{ -10,  76},
{  77,-208},{  78, -40},{  79,  80},{  -3,  81},
{  -7,  82},{  83,  84},{-104,  85},{  86, -26},
{  87,-105},{  88,-112},{  89,  90},{  91, -41},
{  92,  93},{  94,  95},{ -48,  96},{ -90,  97},
{  98, -28},{ -52,  99},{ -12, 100},{ 101, -74},
{ -13,-116},{-161, 102},{ 103, -29},{-102, 104},
{-152,-165},{ 105, 106},{ 107, 108},{ 109, 110},
{ 111,-212},{ 112, 113},{-136, 114},{ 115,-137},
{ 116, -23},{ -19,-153},{ -98,-134},{-196, 117},
{ 118, 119},{ -38,-193},{-113,-150},{-209, 120},
{ 121, -93},{ -83, 122},{ 123, 124},{ 125, 126},
{ 127, 128},{ 129, 130},{ 131, -34},{-146, -53},
{ 132, 133},{ 134, 135},{ 136, 137},{ 138,-130},
{ -49, 139},{ 140, 141},{-117, -42},{ -67, -92},
{ 142, -87},{ -77,-197},{ -71, 143},{ 144, 145},
{ 146, 147},{ 148, 149},{ 150, 151},{ 152, 153},
{ 154, 155},{ 156, 157},{ 158, 159},{ 160, 161},
{ 162, 163},{ 164, 165},{ 166, 167},{ 168, 169},
{-108, -76},{-168,-169},{-176, -44},{-224, -56},
{ -45,-180},{ -11,-106},{-213, 170},{ 171, 172},
{ 173, 174},{ 175, 176},{ 177, 178},{ 179, 180},
{ 181, 182},{ 183, 184},{ 185, 186},{ 187, 188},
{ 189, 190},{ 191, 192},{ 193, 194},{ 195, 196},
{ 197, 198},{ 199, 200},{ 201, 202},{ 203, 204},
{ 205, 206},{ 207,-131},{ -30, -27},{ -43,-151},
{ -75,-154},{-156,-162},{-109,-194},{-198,-201},
{-114,-225},{-228,-229},{-141,-142},{ -94,-124},
{ -95,-147},{-115,-125},{ -54, -55},{-107, -58},
{ -39,-155},{-121,-157},{-158,-103},{ -14,-122},
{-163, -51},{ -57,-166},{-167, -46},{-110,-170},
{-172,-173},{ -61,-177},{-178, -99},{-181,-182},
{-184,-185},{-118, -35},{ -15,-195},{ -31, -60},
{-135,-199},{-200, -79},{-202,-204},{-205,-119},
{ -91,-210},{-211, -78},{-120,-214},{-215,-216},
{-217,-218},{-220,-221},{ -50,-138},{-226,-139},
{-140,-230},{-232,-233},{-240,-241},{-244,-245}
};
static __ALIGN32 CONST Ipp16s  cnstDecMLTTreeCtg5_G722[191][2] = {
{   1,   2},{   0,   3},{   4,   5},{   6,   7},
{   8,   9},{  10,  11},{ -81,  -1},{  12,  13},
{  14, -27},{  -3,  -9},{  15,  16},{  17,  18},
{  19,  20},{-108,  21},{  -4,  22},{  23, -36},
{ -12,  24},{ -82,  25},{  26, -84},{  27, -90},
{ -10, -30},{  28,  29},{  30, -28},{  31,-117},
{ -13,  32},{ -39,  33},{  34,-109},{  35, -93},
{ -85,-111},{ -37,  36},{ -31,  37},{ -91,  38},
{  39,  40},{ -40,-120},{  41,  42},{-118,  43},
{ -94,  44},{-112,-162},{  45,  46},{  -2,  47},
{  48,  49},{-121,-189},{  50, -54},{  51,  52},
{  53, -18},{  54,  55},{  -6,  56},{  57,  -5},
{-135,  58},{  59,  60},{  61,  62},{ -63,  63},
{  64,  -7},{ -15,  65},{  66,  67},{ -45,  68},
{  69,  70},{  71, -21},{  72,  73},{  74,  75},
{  76,  77},{-163,  78},{  79,-171},{-144,  80},
{ -48,  81},{ -57,  82},{  83,  84},{-165,  85},
{ -16,-198},{  86,  87},{ -11,  88},{  89, -99},
{  90, -83},{ -19,  91},{  92,  93},{  94,  95},
{  96,  97},{  98,  99},{ -87, 100},{ 101, 102},
{-190, -66},{ -33,-192},{ 103, 104},{ 105, 106},
{-102, -42},{ 107,-126},{ 108, -29},{-129, -46},
{ -86, -14},{-114, -32},{-172, 109},{ 110, -58},
{ -34,-138},{ 111, 112},{ 113, 114},{ 115, 116},
{ 117, 118},{ 119, 120},{-127,-166},{-174, 121},
{ 122, 123},{ 124, 125},{ -88, -96},{ 126,-100},
{ -38,-110},{ -22,-136},{ -55,-139},{-201, 127},
{ -64,-193},{ 128, -49},{-175,-199},{ 129, 130},
{ 131, 132},{ 133, 134},{ 135, 136},{ 137, 138},
{ 139, 140},{ 141, 142},{ 143, 144},{ 145, 146},
{ 147, 148},{ 149, 150},{-103, -92},{ -43,-130},
{-145,-147},{-148, -41},{-216,-115},{-119,-123},
{ -95, 151},{ 152, 153},{ 154, 155},{ 156, 157},
{ 158, 159},{ 160, 161},{ 162, 163},{ 164, 165},
{ 166, 167},{ 168, 169},{ 170, 171},{ 172, 173},
{ 174, 175},{ 176, 177},{ 178, 179},{ 180, 181},
{ 182, 183},{ 184, 185},{ 186, 187},{ 188, 189},
{ 190,-153},{-180,  -8},{ -97, -24},{-122,-113},
{-124,-125},{ -67, -44},{-128, -69},{-106,-131},
{-132,-133},{ -61, -73},{-137,-116},{ -89,-140},
{-141,-142},{ -23, -25},{-146, -17},{-104,-149},
{-150,-151},{ -52,-154},{-156,-157},{ -76, -70},
{-164, -51},{ -72,-167},{-168,-169},{ -47, -20},
{-173, -59},{-101,-176},{-177,-178},{ -68,-181},
{-183,-184},{ -35, -60},{-191, -98},{ -56,-194},
{-195,-196},{ -75, -65},{-200,-105},{-202,-203},
{-204,-205},{-207,-208},{-210,-211},{ -50,-217},
{-219,-220},{-225,-226},{-228,-229}
};
static __ALIGN32 CONST Ipp16s  cnstDecMLTTreeCtg6_G722[31][2] = {
{   1,   0},{   2,   3},{   4,   5},{   6,   7},
{   8, -16},{  -1,  -8},{  -2,  -4},{   9,  10},
{  11,  12},{  13,  14},{  15,  16},{  17, -24},
{  -3, -12},{  -6,  18},{  19, -20},{ -10,  -5},
{ -17,  -9},{ -18,  20},{  21,  22},{  23,  24},
{  25, -28},{  26,  -7},{ -14, -22},{ -26, -11},
{  27, -19},{ -25, -13},{ -21,  28},{  29, -30},
{ -27,  30},{ -15, -29},{ -23, -31}
};

static __ALIGN32 CONST Ipp16s  cnstMLTQuantCentroid_G722[NUM_CATEGORIES-1][MAX_NUM_BINS] = {
{   0, 1606, 3119, 4586, 6049, 7502, 8941,
10406,11851,13292,14736,16146,17566,19351},
{   0, 2229, 4341, 6401, 8471,10531,12583,
14588,16673,18924,    0,    0,    0,    0},
{   0, 3055, 5998, 8929,11806,14680,17680,
    0,    0,    0,    0,    0,    0,    0},
{   0, 4121, 8192,12259,16322,    0,    0,
    0,    0,    0,    0,    0,    0,    0},
{   0, 5413,11071,16315,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0},
{   0, 6785,14300,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0},
{   0, 8044,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0}
};

static __ALIGN32 CONST Ipp16s  *cnstDecoderTreeTable_G722[NUM_CATEGORIES-1] = {
    (Ipp16s*)cnstDecMLTTreeCtg0_G722,
    (Ipp16s*)cnstDecMLTTreeCtg1_G722,
    (Ipp16s*)cnstDecMLTTreeCtg2_G722,
    (Ipp16s*)cnstDecMLTTreeCtg3_G722,
    (Ipp16s*)cnstDecMLTTreeCtg4_G722,
    (Ipp16s*)cnstDecMLTTreeCtg5_G722,
    (Ipp16s*)cnstDecMLTTreeCtg6_G722,
};

static __ALIGN32 CONST Ipp16s cnstNoiseFactors_G722[3] = {5793, 8192, 23170};


void DecodeFrame(SBitObj* pBitObj, Ipp16s* pRandVec, Ipp16s* pMlt,
         Ipp16s* pScale, Ipp16s* pOldScale, Ipp16s* pOldMlt, Ipp16s errFlag){
   Ipp16s absRegPowerIndices[REG_NUM];
   Ipp16s powerCategories[REG_NUM];
   Ipp16s categoryBalances[CAT_CONTROL_MAX-1];
   Ipp16u ctgCtrl;
   Ipp16s stdDeviations[REG_NUM];

   if (errFlag == 0) {
      /* convert the bits to absolute region power index and region standard deviation */
      RecoveStdDeviations(pBitObj, stdDeviations, absRegPowerIndices, pScale);
      /* fill the categorization control with CAT_CONTROL_BITS */
      ctgCtrl = GetNextBits(pBitObj, CAT_CONTROL_BITS);
      /* obtain decoder power categories and category balances */
      CategorizeFrame(pBitObj->curBitsNumber, absRegPowerIndices,
           powerCategories, categoryBalances);
      /* adjustments to the power categories and category balances */
      ArrangePowerCategories(ctgCtrl, powerCategories, categoryBalances);
      /* decode mlt */
      DecodeBitsToMlt(pBitObj, pRandVec, stdDeviations, powerCategories, pMlt);
      /* test for frame errors */
      TestFrame(pBitObj, errFlag, ctgCtrl, absRegPowerIndices);
   }
   /* perform error handling  */
   ProcessErrors(&errFlag, pMlt, pOldMlt, pScale, pOldScale);
}

/*F*
//  Name:      RecoveStdDeviations

⌨️ 快捷键说明

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