Commit 3fb86383 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Increase precision of y_gainQ_fx calculation

parent 1961a83a
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ void ivas_fill_spectrum_fx(
    test();
    test();
    test();
    if ( EQ_16( length, L_FRAME32k ) && ( ( LT_16( env_stab, 16384 /*0.5.Q15*/ ) && *no_att_hangover == 0 ) || EQ_16( HQ_mode, HQ_HVQ ) ) )
    if ( EQ_16( length, L_FRAME32k ) && ( ( LE_16( env_stab, 16384 /*0.5.Q15*/ ) && *no_att_hangover == 0 ) || EQ_16( HQ_mode, HQ_HVQ ) ) )
    {
        flag_32K_env_hangover = 1;
        move16();
+10 −5
Original line number Diff line number Diff line
@@ -1220,16 +1220,21 @@ Word16 gsc_gaindec_ivas_fx( /* o : average frequenc
            IF( EQ_16( st_fx->L_frame, L_FRAME ) )
            {
                idx_g_fx = (Word16) get_next_indice_fx( st_fx, 6 );
                VDQ_vec_fx( y_gainQ_fx, YG_mean16_fx, YG_dicMR_1_fx, idx_g_fx, 4 );
                VDQ_vec_fx( y_gainQ_fx, YG_mean16_fx2, YG_dicMR_1_fx2, idx_g_fx, 4 );
                //VDQ_vec_fx( y_gainQ_fx, YG_mean16_fx, YG_dicMR_1_fx, idx_g_fx, 4 );
                
                idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 );
                VDQ_vec_fx( y_gainQ_fx + 4, YG_mean16_fx + 4, YG_dicMR_2_fx, idx_g_fx, 4 );
                VDQ_vec_fx( y_gainQ_fx + 4, YG_mean16_fx2 + 4, YG_dicMR_2_fx2, idx_g_fx, 4 );
                //VDQ_vec_fx( y_gainQ_fx + 4, YG_mean16_fx + 4, YG_dicMR_2_fx, idx_g_fx, 4 );

                idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 );
                VDQ_vec_fx( y_gainQ_fx + 8, YG_mean16_fx + 8, YG_dicMR_3_fx, idx_g_fx, 4 );
                VDQ_vec_fx( y_gainQ_fx + 8, YG_mean16_fx2 + 8, YG_dicMR_3_fx2, idx_g_fx, 4 );
                //VDQ_vec_fx( y_gainQ_fx + 8, YG_mean16_fx + 8, YG_dicMR_3_fx, idx_g_fx, 4 );

                idx_g_fx = (Word16) get_next_indice_fx( st_fx, 4 );
                VDQ_vec_fx( y_gainQ_fx + 12, YG_mean16_fx + 12, YG_dicMR_4_fx, idx_g_fx, 4 );
                VDQ_vec_fx( y_gainQ_fx + 12, YG_mean16_fx2 + 12, YG_dicMR_4_fx2, idx_g_fx, 4 );
                //VDQ_vec_fx( y_gainQ_fx + 12, YG_mean16_fx + 12, YG_dicMR_4_fx, idx_g_fx, 4 );
                scale_sig( y_gainQ_fx, 16, -3 );
            }
            ELSE
            {
+6 −0
Original line number Diff line number Diff line
@@ -1027,6 +1027,12 @@ extern const Word16 YG_dicMR_2_fx[]; /*Q12 */
extern const Word16 YG_dicMR_3_fx[]; /*Q12 */
extern const Word16 YG_dicMR_4_fx[]; /*Q12 */

extern const Word16 YG_mean16_fx2[];  /*Q15 */
extern const Word16 YG_dicMR_1_fx2[]; /*Q15 */
extern const Word16 YG_dicMR_2_fx2[]; /*Q15 */
extern const Word16 YG_dicMR_3_fx2[]; /*Q15 */
extern const Word16 YG_dicMR_4_fx2[]; /*Q15 */

extern const Word16 mean_m_fx[];        /*Q12 */
extern const Word16 mean_gain_dic_fx[]; /*Q12 */

+21 −1
Original line number Diff line number Diff line
@@ -17665,6 +17665,11 @@ const Word16 YG_mean16_fx[1 * 16] = /*Q12 */
    120,	    81,	    90,	    67,	    147,	    34,	   163,	    184
};
const Word16 YG_mean16_fx2[1 * 16] =  /*Q15 */
{
-3172,-1534,-1340,-1088,-482,-138,364,315,960,649,718,537,1173,272,1304,1468
};
const Word16 YG_dicMR_1_fx[4 * 64] =  /*Q12 */
{
    -1879,	826,	539,	-210,
@@ -17732,6 +17737,10 @@ const Word16 YG_dicMR_1_fx[4 * 64] = /*Q12 */
    -297,	645,	-864,	-805,
    -46,	-326,	412,	-296
};
const Word16 YG_dicMR_1_fx2[4 * 64] =  /*Q15 */
{
-15034,6606,4309,-1681,-963,2136,-1098,-1137,-6383,-3781,3470,1946,2372,-7170,2952,2458,-15063,-10663,3326,4076,-15643,-5279,-3772,1796,-7242,-6429,-4135,3460,-7687,164,-2068,-1792,1671,7818,-1701,-138,4286,-1950,1271,780,-2120,6196,3293,-2618,2697,-3129,-1897,-3775,-15696,-14687,-5535,3765,4997,1383,-3703,-121,-7720,2107,495,4804,-6259,7111,-3460,1684,-14329,6819,-3624,-6210,-1458,-1419,-8621,639,-2913,2802,2238,2343,-7212,8949,2356,-9549,125,3516,-2736,3673,-14598,-12675,-11059,-6386,5780,459,-9880,-5285,7101,-13104,2218,1874,2723,2759,1130,-4882,10237,-180,138,1153,-5115,-6819,-4158,-4424,8254,6747,1193,3477,4647,6262,4148,-1570,3654,7563,3985,-10309,-15175,-331,3401,4112,6295,1288,4050,3083,-4473,8634,2556,4122,3998,2720,478,845,2012,-7976,-9306,-7681,2091,-10302,-5046,2677,9925,-4961,-3093,-5299,1334,1553,3811,534,6642,-2084,3437,-9611,-3831,-983,570,-9296,1802,-11855,1055,-6416,5436,6101,-8081,3434,1599,-996,2091,4722,6167,-5921,-1465,1832,-14883,-2785,2222,-4391,-14146,7740,2251,4755,-13818,-13576,698,-6115,9349,5046,-914,-3772,-13088,-809,-10591,-724,6567,-5960,3667,-2110,8110,-4607,3116,3758,8326,-4132,-8146,2939,6606,138,3408,-2612,-3736,-13130,1609,2602,-15247,3424,-2700,1773,-8166,5043,3352,-600,-691,-3034,-1622,1874,5272,4214,-3929,-12059,-4515,-13962,-7828,-1383,-14110,-3460,-5941,-8723,1933,5675,2153,3975,5731,590,-1661,4941,-2372,5158,-6911,-6439,-367,-2612,3296,-2369
};
const Word16 YG_dicMR_2_fx[4 * 32] =  /*Q12 */
{
    93,	    217,	-122,	37,
@@ -17767,6 +17776,10 @@ const Word16 YG_dicMR_2_fx[4 * 32] = /*Q12 */
    -552,	-166,	772,	861,
    -159,	120,	-215,	775
};
const Word16 YG_dicMR_2_fx2[4 * 32] =  /*Q15 */
{
747,1733,-976,298,-105,-665,842,-3929,-3185,-4738,3188,-1278,4342,-646,-3758,3267,3156,-5043,-754,-2064,-5318,1065,-1085,-999,3178,-2808,5040,-1183,-9326,3251,-6917,4434,-1091,-2415,-2104,649,-5394,-5259,-4565,-5531,-1648,3047,-5593,976,2179,-12049,2844,118,3611,-7687,5102,-9060,2530,-6298,1324,4679,2497,-1153,1478,2189,311,-5646,-7972,2002,-7324,-6970,-914,3663,-6668,2782,2910,-9506,3598,5780,-2048,3300,2956,3745,-10964,3326,2756,1314,2317,-8756,5315,973,269,-1743,4440,2035,4473,6603,2497,3935,3968,-216,-3192,2523,5521,-2641,-3663,5682,1648,3319,2323,711,-5292,-3732,-577,4745,-865,-3677,-1740,370,2549,1511,-10928,1593,2923,498,-4417,-1327,6173,6891,-1268,963,-1720,6203
};
const Word16 YG_dicMR_3_fx[4 * 32] =  /*Q12 */
{
    -103,	-143,	-85,	-19,
@@ -17802,6 +17815,10 @@ const Word16 YG_dicMR_3_fx[4 * 32] = /*Q12 */
    816,	-665,	-1741,	-671,
    274,	93,	    -617,	-433
};
const Word16 YG_dicMR_3_fx2[4 * 32] =  /*Q15 */
{
-822,-1147,-678,-154,-3231,1455,-6364,672,3185,-4748,-439,-2045,2264,1026,-3778,2235,-1966,-5020,2248,2379,-6822,3745,2864,-7324,2176,1189,1671,-3542,-1340,-4034,3618,-4198,4994,-3414,6229,937,8631,3234,-786,642,1088,1324,1137,-11154,4103,-4532,-1203,6573,990,5164,1596,2176,-1321,-5620,-4922,1324,2667,6482,-3657,8300,-2877,839,-878,4293,-1796,999,4496,-206,5590,-8841,6475,-10587,-9834,6731,-6134,4565,-2477,3493,-911,-1842,-8359,5040,4512,2579,2258,9362,-5784,-2444,-2621,-1979,-2005,-4787,2831,2657,-12743,3994,2654,-180,1750,2435,2602,-12091,3021,2395,-754,-433,5430,7645,4057,6639,6891,-5915,-7163,-1078,131,-272,5420,5204,7687,5715,6531,-5322,-13930,-5367,2195,744,-4935,-3464
};
const Word16 YG_dicMR_4_fx[4 * 16] =  /*Q12 */
{
    -163,	-44,	-108,	32,
@@ -17821,7 +17838,10 @@ const Word16 YG_dicMR_4_fx[4 * 16] = /*Q12 */
    -37,	661,	-75,	289,
    -835,	243,	85,	    -105
};
const Word16 YG_dicMR_4_fx2[4 * 16] =  /*Q15 */
{
-1304,-354,-862,259,4450,1222,921,960,4938,6544,6416,5754,-5112,-5318,973,5308,2828,-4437,-2818,-685,-9293,6665,-8274,2608,-4086,-3247,-3824,-4181,3926,-11783,3234,-167,1186,2300,-364,-4352,-485,1376,-6328,-354,5718,-3588,6891,4030,-865,2100,4879,947,7694,6606,-8104,-298,-252,-3958,2893,-1714,-298,5289,-600,2313,-6681,1943,678,-839
};
const Word16 mean_m_fx[1 * 1] =  /*Q12 */
{