Loading lib_dec/d_gain2p.c +8 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,11 @@ static Word32 calc_gain_code(Word16 g_code, Word16 gcode0, Word16 exp_gcode0) L_tmp = L_mult(g_code, gcode0); /* Q11*Q15 -> Q27 */ exp_gcode0 = add(exp_gcode0,-11); #ifdef BASOP_NOGLOB L_tmp = L_shl_sat(L_tmp, exp_gcode0); /* Q27 -> Q16 */ #else L_tmp = L_shl(L_tmp, exp_gcode0); /* Q27 -> Q16 */ #endif return L_tmp; } Loading Loading @@ -79,8 +82,11 @@ static void Mode2_gain_dec_mless( /**gain_inov = 1.0f / (float)sqrt( ( dot_product( code, code, lcode ) + 0.01f ) / lcode);*/ L_tmp = calc_gain_inov(code, lcode, &L_tmp1, &exp_L_tmp1); move16(); #ifdef BASOP_NOGLOB *gain_inov = round_fx_sat(L_shl_sat(L_tmp, 15-3)); /* gain_inov in Q12 */ #else *gain_inov = round_fx(L_shl(L_tmp, 15-3)); /* gain_inov in Q12 */ #endif /*-----------------------------------------------------------------* * Select the gains quantization table *-----------------------------------------------------------------*/ Loading lib_dec/er_dec_tcx.c +9 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ static void calcGainc2(Word16 *exc, Word16 Q_exc, Word16 L_subfr, Word32* lp_gai Word16 i, cnt, tmp16 , tmp_e, tmp2_e; Word32 L_c, L_acc, L_tmp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; /* TBV !!!!! */ Flag Overflow = 0; Flag Carry = 0; #endif Loading @@ -96,9 +96,17 @@ static void calcGainc2(Word16 *exc, Word16 Q_exc, Word16 L_subfr, Word32* lp_gai FOR (i=0; i < cnt; i++) { /* *gainc += ( exc[i-2*L_subfr] ) * ( exc[i-2*L_subfr]); */ #ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_acc = L_macNs_co(L_acc, exc[i-2*L_subfr] /*Q1*/, exc[i-2*L_subfr] /*Q1*/, &Carry, &Overflow); /*Q3*/ #else L_acc = L_macNs(L_acc, exc[i-2*L_subfr] /*Q1*/, exc[i-2*L_subfr] /*Q1*/); /*Q3*/ #endif Overflow = 0; #ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_c = L_macNs_co(L_c,0,0, &Carry, &Overflow); /* Accumulate Carrys */ #else L_c = L_macNs(L_c,0,0); /* Accumulate Carrys */ #endif Carry = 0; } Loading Loading
lib_dec/d_gain2p.c +8 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,11 @@ static Word32 calc_gain_code(Word16 g_code, Word16 gcode0, Word16 exp_gcode0) L_tmp = L_mult(g_code, gcode0); /* Q11*Q15 -> Q27 */ exp_gcode0 = add(exp_gcode0,-11); #ifdef BASOP_NOGLOB L_tmp = L_shl_sat(L_tmp, exp_gcode0); /* Q27 -> Q16 */ #else L_tmp = L_shl(L_tmp, exp_gcode0); /* Q27 -> Q16 */ #endif return L_tmp; } Loading Loading @@ -79,8 +82,11 @@ static void Mode2_gain_dec_mless( /**gain_inov = 1.0f / (float)sqrt( ( dot_product( code, code, lcode ) + 0.01f ) / lcode);*/ L_tmp = calc_gain_inov(code, lcode, &L_tmp1, &exp_L_tmp1); move16(); #ifdef BASOP_NOGLOB *gain_inov = round_fx_sat(L_shl_sat(L_tmp, 15-3)); /* gain_inov in Q12 */ #else *gain_inov = round_fx(L_shl(L_tmp, 15-3)); /* gain_inov in Q12 */ #endif /*-----------------------------------------------------------------* * Select the gains quantization table *-----------------------------------------------------------------*/ Loading
lib_dec/er_dec_tcx.c +9 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ static void calcGainc2(Word16 *exc, Word16 Q_exc, Word16 L_subfr, Word32* lp_gai Word16 i, cnt, tmp16 , tmp_e, tmp2_e; Word32 L_c, L_acc, L_tmp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; /* TBV !!!!! */ Flag Overflow = 0; Flag Carry = 0; #endif Loading @@ -96,9 +96,17 @@ static void calcGainc2(Word16 *exc, Word16 Q_exc, Word16 L_subfr, Word32* lp_gai FOR (i=0; i < cnt; i++) { /* *gainc += ( exc[i-2*L_subfr] ) * ( exc[i-2*L_subfr]); */ #ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_acc = L_macNs_co(L_acc, exc[i-2*L_subfr] /*Q1*/, exc[i-2*L_subfr] /*Q1*/, &Carry, &Overflow); /*Q3*/ #else L_acc = L_macNs(L_acc, exc[i-2*L_subfr] /*Q1*/, exc[i-2*L_subfr] /*Q1*/); /*Q3*/ #endif Overflow = 0; #ifdef BASOP_NOGLOB /* Critical Carry/Overflow */ L_c = L_macNs_co(L_c,0,0, &Carry, &Overflow); /* Accumulate Carrys */ #else L_c = L_macNs(L_c,0,0); /* Accumulate Carrys */ #endif Carry = 0; } Loading