Loading lib_com/tcx_utils.c +7 −1 Original line number Diff line number Diff line Loading @@ -848,7 +848,9 @@ void mdct_shaping( Word32 * px = x; Word16 const * pgains = gains; Word16 const * pgainsexp = gains_exp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif /* FDNS_NPTS = 64 */ k = shr(lg, 6); Loading Loading @@ -918,7 +920,11 @@ void mdct_shaping( gains_exp = pgainsexp; FOR (i=0; i<FDNS_NPTS; i++) { #ifdef BASOP_NOGLOB *x = L_shl_o(Mpy_32_16_r(*x, *gains), *gains_exp, &Overflow); #else *x = L_shl(Mpy_32_16_r(*x, *gains), *gains_exp); #endif move32(); x += k; gains++; Loading lib_com/window.c +4 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ void ham_cos_window( { /* fh_f[i] = 0.54f - 0.46f * (Float32)cos(cc); */ BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB fh[i] = sub_o(P54_0Q15, mult_r(getCosWord16(round_fx_o(L_shl_o(cc,9, &Overflow), &Overflow)),P92_0Q15), &Overflow); /*0Q15*/ move16(); #else fh[i] = sub(P54_0Q15, mult_r(getCosWord16(round_fx(L_shl(cc,9))),P92_0Q15)); /*0Q15*/ move16(); #endif BASOP_SATURATE_WARNING_ON_EVS cc = L_add(cc, cte); /*0Q15*/ } Loading lib_dec/dec_post.c +9 −1 Original line number Diff line number Diff line Loading @@ -1546,12 +1546,20 @@ void blend_subfr2( Word16 fac2 = 0 + 512; Word16 step = 1024; Word16 i; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif FOR( i=0; i<L_SUBFR/2; i++ ) { #ifdef BASOP_NOGLOB sigOut[i] = mac_ro(L_mult_o(fac1, sigIn1[i], &Overflow), fac2, sigIn2[i], &Overflow); fac1 = sub_o(fac1, step, &Overflow); fac2 = add_o(fac2, step, &Overflow); #else sigOut[i] = mac_r(L_mult(fac1, sigIn1[i]), fac2, sigIn2[i]); fac1 = sub(fac1, step); fac2 = add(fac2, step); #endif } return; Loading lib_dec/dec_tcx.c +24 −1 Original line number Diff line number Diff line Loading @@ -573,7 +573,11 @@ void decoder_tcx( tmp32 = Dot_productSq16HQ( 0, h1, L_SUBFR, &st->last_gain_syn_deemph_e)/*Q15, st->last_gain_syn_deemph_e*/; st->last_gain_syn_deemph_e = add(st->last_gain_syn_deemph_e,10/*scaling of h1[0] and E_UTIL_synthesis * 2*/); tmp32 = Sqrt32(tmp32,&st->last_gain_syn_deemph_e); #ifdef BASOP_NOGLOB st->last_gain_syn_deemph = round_fx_o(tmp32, &Overflow); #else st->last_gain_syn_deemph = round_fx(tmp32); #endif /*for avoiding compiler warnings*/ hTcxDec->gainHelper = 32768/2; move16(); Loading Loading @@ -1608,20 +1612,39 @@ static Word32 CalculateAbsEnergy( /* o : normalized result Q31 */ Carry = 0; L_c = 0; move32(); #ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_sum = L_macNs_co(L_off,0,0, &Carry, &Overflow); if (L_sum > 0) { L_c = L_macNs_co(L_c, 0, 0, &Carry, &Overflow); } if (L_sum < 0) { L_c = L_msuNs_co(L_c, 0, 0, &Carry, &Overflow); } #else L_sum = L_macNs(L_off,0,0); if (L_sum > 0) L_c = L_macNs(L_c,0,0); if (L_sum < 0) L_c = L_msuNs(L_c,0,0); #endif FOR (i=0; i < lg; i+=2) { Carry = 0; BASOP_SATURATE_WARNING_OFF_EVS /*multiplication of -32768 * -32768 throws an overflow, but is not critical*/ #ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_sum = L_macNs_co(L_sum, x[i], x[i], &Carry, &Overflow); #else L_sum = L_macNs(L_sum, x[i], x[i]); #endif BASOP_SATURATE_WARNING_ON_EVS Overflow = 0; /* to avoid useless warning in L_macNs calling L_mult */ #ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_c = L_macNs_co(L_c,0,0, &Carry, &Overflow); #else L_c = L_macNs(L_c,0,0); #endif } L_sum = norm_llQ31(L_c,L_sum,exp); return L_sum; Loading lib_dec/er_dec_tcx.c +13 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,11 @@ static void calcGainc(Word16* exc, Word16 Q_exc, Word32 old_fpitch, Word16 L_sub tmp16 = round_fx(old_fpitch);/*Q0*/ tmp_loop = shl(L_subfr,1); BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB tmp16_2 = round_fx_o(L_shl_o(lp_gainp,2, &Overflow), &Overflow); /*Q31->Q15, no severe saturation, because st->lp_gainp here is [0,1]*/ #else tmp16_2 = round_fx(L_shl(lp_gainp,2)); /*Q31->Q15, no severe saturation, because st->lp_gainp here is [0,1]*/ #endif BASOP_SATURATE_WARNING_ON_EVS FOR ( i=0; i< tmp_loop; i++ ) Loading Loading @@ -516,7 +520,11 @@ void con_tcx( } ELSE { #ifdef BASOP_NOGLOB st->cummulative_damping = shl_o(mult_ro(st->cummulative_damping/*Q15*/,alpha/*Q14*/, &Overflow),1, &Overflow)/*Q15*/; #else st->cummulative_damping = shl(mult_r(st->cummulative_damping/*Q15*/,alpha/*Q14*/),1)/*Q15*/; #endif } gain32 = L_add(2147483647l/*1.f Q31*/, 0); /*Q31*/ Loading @@ -541,11 +549,14 @@ void con_tcx( { #ifdef BASOP_NOGLOB exc[i] = mult_r(exc[i], round_fx_o(gain32, &Overflow))/*Q1*/; move16(); gain32 = L_sub_o(gain32, step32, &Overflow); #else exc[i] = mult_r(exc[i],round_fx(gain32))/*Q1*/; #endif move16(); gain32 = L_sub(gain32, step32); #endif } /* update old exc without random part */ Loading Loading
lib_com/tcx_utils.c +7 −1 Original line number Diff line number Diff line Loading @@ -848,7 +848,9 @@ void mdct_shaping( Word32 * px = x; Word16 const * pgains = gains; Word16 const * pgainsexp = gains_exp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif /* FDNS_NPTS = 64 */ k = shr(lg, 6); Loading Loading @@ -918,7 +920,11 @@ void mdct_shaping( gains_exp = pgainsexp; FOR (i=0; i<FDNS_NPTS; i++) { #ifdef BASOP_NOGLOB *x = L_shl_o(Mpy_32_16_r(*x, *gains), *gains_exp, &Overflow); #else *x = L_shl(Mpy_32_16_r(*x, *gains), *gains_exp); #endif move32(); x += k; gains++; Loading
lib_com/window.c +4 −0 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ void ham_cos_window( { /* fh_f[i] = 0.54f - 0.46f * (Float32)cos(cc); */ BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB fh[i] = sub_o(P54_0Q15, mult_r(getCosWord16(round_fx_o(L_shl_o(cc,9, &Overflow), &Overflow)),P92_0Q15), &Overflow); /*0Q15*/ move16(); #else fh[i] = sub(P54_0Q15, mult_r(getCosWord16(round_fx(L_shl(cc,9))),P92_0Q15)); /*0Q15*/ move16(); #endif BASOP_SATURATE_WARNING_ON_EVS cc = L_add(cc, cte); /*0Q15*/ } Loading
lib_dec/dec_post.c +9 −1 Original line number Diff line number Diff line Loading @@ -1546,12 +1546,20 @@ void blend_subfr2( Word16 fac2 = 0 + 512; Word16 step = 1024; Word16 i; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif FOR( i=0; i<L_SUBFR/2; i++ ) { #ifdef BASOP_NOGLOB sigOut[i] = mac_ro(L_mult_o(fac1, sigIn1[i], &Overflow), fac2, sigIn2[i], &Overflow); fac1 = sub_o(fac1, step, &Overflow); fac2 = add_o(fac2, step, &Overflow); #else sigOut[i] = mac_r(L_mult(fac1, sigIn1[i]), fac2, sigIn2[i]); fac1 = sub(fac1, step); fac2 = add(fac2, step); #endif } return; Loading
lib_dec/dec_tcx.c +24 −1 Original line number Diff line number Diff line Loading @@ -573,7 +573,11 @@ void decoder_tcx( tmp32 = Dot_productSq16HQ( 0, h1, L_SUBFR, &st->last_gain_syn_deemph_e)/*Q15, st->last_gain_syn_deemph_e*/; st->last_gain_syn_deemph_e = add(st->last_gain_syn_deemph_e,10/*scaling of h1[0] and E_UTIL_synthesis * 2*/); tmp32 = Sqrt32(tmp32,&st->last_gain_syn_deemph_e); #ifdef BASOP_NOGLOB st->last_gain_syn_deemph = round_fx_o(tmp32, &Overflow); #else st->last_gain_syn_deemph = round_fx(tmp32); #endif /*for avoiding compiler warnings*/ hTcxDec->gainHelper = 32768/2; move16(); Loading Loading @@ -1608,20 +1612,39 @@ static Word32 CalculateAbsEnergy( /* o : normalized result Q31 */ Carry = 0; L_c = 0; move32(); #ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_sum = L_macNs_co(L_off,0,0, &Carry, &Overflow); if (L_sum > 0) { L_c = L_macNs_co(L_c, 0, 0, &Carry, &Overflow); } if (L_sum < 0) { L_c = L_msuNs_co(L_c, 0, 0, &Carry, &Overflow); } #else L_sum = L_macNs(L_off,0,0); if (L_sum > 0) L_c = L_macNs(L_c,0,0); if (L_sum < 0) L_c = L_msuNs(L_c,0,0); #endif FOR (i=0; i < lg; i+=2) { Carry = 0; BASOP_SATURATE_WARNING_OFF_EVS /*multiplication of -32768 * -32768 throws an overflow, but is not critical*/ #ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_sum = L_macNs_co(L_sum, x[i], x[i], &Carry, &Overflow); #else L_sum = L_macNs(L_sum, x[i], x[i]); #endif BASOP_SATURATE_WARNING_ON_EVS Overflow = 0; /* to avoid useless warning in L_macNs calling L_mult */ #ifdef BASOP_NOGLOB /* Critical Overflow/Carry */ L_c = L_macNs_co(L_c,0,0, &Carry, &Overflow); #else L_c = L_macNs(L_c,0,0); #endif } L_sum = norm_llQ31(L_c,L_sum,exp); return L_sum; Loading
lib_dec/er_dec_tcx.c +13 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,11 @@ static void calcGainc(Word16* exc, Word16 Q_exc, Word32 old_fpitch, Word16 L_sub tmp16 = round_fx(old_fpitch);/*Q0*/ tmp_loop = shl(L_subfr,1); BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB tmp16_2 = round_fx_o(L_shl_o(lp_gainp,2, &Overflow), &Overflow); /*Q31->Q15, no severe saturation, because st->lp_gainp here is [0,1]*/ #else tmp16_2 = round_fx(L_shl(lp_gainp,2)); /*Q31->Q15, no severe saturation, because st->lp_gainp here is [0,1]*/ #endif BASOP_SATURATE_WARNING_ON_EVS FOR ( i=0; i< tmp_loop; i++ ) Loading Loading @@ -516,7 +520,11 @@ void con_tcx( } ELSE { #ifdef BASOP_NOGLOB st->cummulative_damping = shl_o(mult_ro(st->cummulative_damping/*Q15*/,alpha/*Q14*/, &Overflow),1, &Overflow)/*Q15*/; #else st->cummulative_damping = shl(mult_r(st->cummulative_damping/*Q15*/,alpha/*Q14*/),1)/*Q15*/; #endif } gain32 = L_add(2147483647l/*1.f Q31*/, 0); /*Q31*/ Loading @@ -541,11 +549,14 @@ void con_tcx( { #ifdef BASOP_NOGLOB exc[i] = mult_r(exc[i], round_fx_o(gain32, &Overflow))/*Q1*/; move16(); gain32 = L_sub_o(gain32, step32, &Overflow); #else exc[i] = mult_r(exc[i],round_fx(gain32))/*Q1*/; #endif move16(); gain32 = L_sub(gain32, step32); #endif } /* update old exc without random part */ Loading