Loading lib_com/basop_util.c +7 −2 Original line number Diff line number Diff line Loading @@ -224,8 +224,9 @@ void BASOP_Util_Divide_MantExp (Word16 a_m, /*!< Mantissa of dividend Word16 preShift, postShift; Word16 m; Word32 m32; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif assert(b_m != 0); Loading Loading @@ -256,7 +257,11 @@ void BASOP_Util_Divide_MantExp (Word16 a_m, /*!< Mantissa of dividend /* normalize result */ postShift = norm_l(m32); #ifdef BASOP_NOGLOB m = round_fx_o(L_shl(m32, postShift), &Overflow); #else m = round_fx(L_shl(m32, postShift)); #endif /* exponent */ *ptrResult_e = sub(add(add(a_e, sub(1, b_e)), preShift), postShift); Loading lib_com/window.c +7 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,9 @@ void ham_cos_window( { Word16 i; Word32 cte, cc; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif assert( n1>=102 ); /* if n1 is too low -> overflow in div_l */ Loading Loading @@ -59,7 +61,11 @@ void ham_cos_window( FOR (i = n1; i < n1+n2; i++) { /* fh_f[i] = (Float32)cos(cc); */ #ifdef BASOP_NOGLOB fh[i] = shl_o(getCosWord16(round_fx(L_shl(cc, 10))), 1, &Overflow); /*0Q15*/ move16(); #else fh[i] = shl(getCosWord16(round_fx(L_shl(cc,10))),1); /*0Q15*/ move16(); #endif cc = L_add(cc, cte); } BASOP_SATURATE_WARNING_ON Loading lib_com/window_ola_fx.c +10 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ void sinq_fx( Word16 i; Word16 tmp1, tmp2; Word32 L_tmp, A32,tmp_old,tmp_old_old; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif x[0]= phi; move16(); /*sin(x) approximated by x; Q15 */ Loading Loading @@ -57,8 +60,14 @@ void sinq_fx( L_tmp = Mult_32_32(A32,tmp_old); /*Q30 */ L_tmp= L_sub(L_tmp,L_shr(tmp_old_old,1)); /*Q30 */ tmp_old_old = L_add(tmp_old, 0); /*Q31 */ #ifdef BASOP_NOGLOB tmp_old = L_shl_o(L_tmp, 1, &Overflow); /*Q31 */ x[i] = round_fx_o(tmp_old, &Overflow); /*Q15 */ #else tmp_old= L_shl(L_tmp,1); /*Q31 */ x[i] = round_fx(tmp_old); /*Q15 */ #endif } return; Loading lib_dec/FEC_HQ_core_fx.c +14 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,9 @@ static void Regression_Anal_fx( Word32 L_tmp1, L_tmp2; Word16 aindex_fx[MAX_PGF+1]; Word32 b_p_fx[MAX_PGF+1]; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif /* Initialize */ FOR (i=0; i<num_pgf+1; i++) Loading Loading @@ -70,7 +73,11 @@ static void Regression_Anal_fx( FOR (i=0; i<num_pgf; i++) { b_p_fx[0] = L_add(b_p_fx[0], L_shr(values_fx[i], 2));/*10 */ #ifdef BASOP_NOGLOB b_p_fx[1] = L_add(b_p_fx[1], Mult_32_16(values_fx[i], shl_o(sub(num_pgf, i), 13, &Overflow)));/*10 */ #else b_p_fx[1] = L_add(b_p_fx[1], Mult_32_16(values_fx[i], shl(sub(num_pgf, i), 13)));/*10 */ #endif } tmp = sub(i_mult(aindex_fx[0], aindex_fx[2]), i_mult(aindex_fx[1], aindex_fx[1])); Loading Loading @@ -146,6 +153,9 @@ void HQ_FEC_processing_fx( Word16 energy_diff_fx; HQ_NBFEC_HANDLE hHQ_nbfec; HQ_DEC_HANDLE hHQ_core; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; Loading Loading @@ -355,7 +365,11 @@ void HQ_FEC_processing_fx( FOR ( j=0; j<Num_bands_p[i]; j++ ) { #ifdef BASOP_NOGLOB hHQ_nbfec->Norm_gain_fx[k++] = shl_o(tmp_fx, 1, &Overflow); #else hHQ_nbfec->Norm_gain_fx[k++] = shl(tmp_fx, 1); #endif move16(); } } Loading lib_dec/FEC_fx.c +18 −1 Original line number Diff line number Diff line Loading @@ -96,6 +96,9 @@ void FEC_exc_estim_fx( Word32 cond3; Word32 predPitchLag; GSC_DEC_HANDLE hGSCDec; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hGSCDec = st_fx->hGSCDec; AMRWB_IO_DEC_HANDLE hAmrwb_IO; Loading Loading @@ -293,7 +296,11 @@ void FEC_exc_estim_fx( IF( LE_16(st_fx->nbLostCmpt,1)) { /* if stable, do not decrease the energy, pitch_gain = 0 */ #ifdef BASOP_NOGLOB alpha = mac_ro((1L << 16) * 2 * _ALPHA_U_FX, st_fx->stab_fac_fx, 32768 - 2 * _ALPHA_U_FX, &Overflow); /*st_fx->stab_fac_fx in Q15*/ #else alpha = mac_r((1L<<16)*2*_ALPHA_U_FX, st_fx->stab_fac_fx, 32768-2*_ALPHA_U_FX); /*st_fx->stab_fac_fx in Q15*/ #endif } ELSE IF ( EQ_16(st_fx->nbLostCmpt,2)) { Loading Loading @@ -341,8 +348,11 @@ void FEC_exc_estim_fx( L_tmp = L_deposit_h(tmp); L_tmp = Isqrt_lc(L_tmp, &exp); #ifdef BASOP_NOGLOB gain = extract_h(L_shl_o(L_tmp, exp, &Overflow)); #else gain = extract_h(L_shl(L_tmp, exp)); #endif gain = s_min(gain, 32113); /*0.98 */ gain = s_max(gain, 27853); /*0.85 */ Loading Loading @@ -743,6 +753,9 @@ static void pulseRes_preCalc(Word16* cond1, Word16* cond2, Word32* cond3 ,Word16 { Word16 tmp_pit, tmp_pit_e, tmp_frame, tmp_frame_e; Word32 tmp_pit2; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif tmp_pit = BASOP_Util_Divide1616_Scale(new_pit/*Q0*/,Tc/*Q0*/,&tmp_pit_e)/*Q15*/; tmp_frame = add( extract_l(L_mult0(L_frame , 64/*1.f/L_SUBFR Q12*/)/*Q12*/) , 4096/*1.f Q12*/ );/*Q12*/ Loading @@ -751,7 +764,11 @@ static void pulseRes_preCalc(Word16* cond1, Word16* cond2, Word32* cond3 ,Word16 tmp_frame = sub(32767/*1.f Q15*/, tmp_frame);/*Q15*/ BASOP_SATURATE_WARNING_OFF /*To calc Q15 threshold, overflow may happen - do negation and compare with negated value to check also highest possible value*/ #ifdef BASOP_NOGLOB tmp_pit = shl_o(negate(tmp_pit), tmp_pit_e, &Overflow); #else tmp_pit = shl(negate(tmp_pit),tmp_pit_e); #endif BASOP_SATURATE_WARNING_ON *cond1 = sub(tmp_pit, negate(tmp_frame)); Loading Loading
lib_com/basop_util.c +7 −2 Original line number Diff line number Diff line Loading @@ -224,8 +224,9 @@ void BASOP_Util_Divide_MantExp (Word16 a_m, /*!< Mantissa of dividend Word16 preShift, postShift; Word16 m; Word32 m32; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif assert(b_m != 0); Loading Loading @@ -256,7 +257,11 @@ void BASOP_Util_Divide_MantExp (Word16 a_m, /*!< Mantissa of dividend /* normalize result */ postShift = norm_l(m32); #ifdef BASOP_NOGLOB m = round_fx_o(L_shl(m32, postShift), &Overflow); #else m = round_fx(L_shl(m32, postShift)); #endif /* exponent */ *ptrResult_e = sub(add(add(a_e, sub(1, b_e)), preShift), postShift); Loading
lib_com/window.c +7 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,9 @@ void ham_cos_window( { Word16 i; Word32 cte, cc; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif assert( n1>=102 ); /* if n1 is too low -> overflow in div_l */ Loading Loading @@ -59,7 +61,11 @@ void ham_cos_window( FOR (i = n1; i < n1+n2; i++) { /* fh_f[i] = (Float32)cos(cc); */ #ifdef BASOP_NOGLOB fh[i] = shl_o(getCosWord16(round_fx(L_shl(cc, 10))), 1, &Overflow); /*0Q15*/ move16(); #else fh[i] = shl(getCosWord16(round_fx(L_shl(cc,10))),1); /*0Q15*/ move16(); #endif cc = L_add(cc, cte); } BASOP_SATURATE_WARNING_ON Loading
lib_com/window_ola_fx.c +10 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ void sinq_fx( Word16 i; Word16 tmp1, tmp2; Word32 L_tmp, A32,tmp_old,tmp_old_old; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif x[0]= phi; move16(); /*sin(x) approximated by x; Q15 */ Loading Loading @@ -57,8 +60,14 @@ void sinq_fx( L_tmp = Mult_32_32(A32,tmp_old); /*Q30 */ L_tmp= L_sub(L_tmp,L_shr(tmp_old_old,1)); /*Q30 */ tmp_old_old = L_add(tmp_old, 0); /*Q31 */ #ifdef BASOP_NOGLOB tmp_old = L_shl_o(L_tmp, 1, &Overflow); /*Q31 */ x[i] = round_fx_o(tmp_old, &Overflow); /*Q15 */ #else tmp_old= L_shl(L_tmp,1); /*Q31 */ x[i] = round_fx(tmp_old); /*Q15 */ #endif } return; Loading
lib_dec/FEC_HQ_core_fx.c +14 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,9 @@ static void Regression_Anal_fx( Word32 L_tmp1, L_tmp2; Word16 aindex_fx[MAX_PGF+1]; Word32 b_p_fx[MAX_PGF+1]; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif /* Initialize */ FOR (i=0; i<num_pgf+1; i++) Loading Loading @@ -70,7 +73,11 @@ static void Regression_Anal_fx( FOR (i=0; i<num_pgf; i++) { b_p_fx[0] = L_add(b_p_fx[0], L_shr(values_fx[i], 2));/*10 */ #ifdef BASOP_NOGLOB b_p_fx[1] = L_add(b_p_fx[1], Mult_32_16(values_fx[i], shl_o(sub(num_pgf, i), 13, &Overflow)));/*10 */ #else b_p_fx[1] = L_add(b_p_fx[1], Mult_32_16(values_fx[i], shl(sub(num_pgf, i), 13)));/*10 */ #endif } tmp = sub(i_mult(aindex_fx[0], aindex_fx[2]), i_mult(aindex_fx[1], aindex_fx[1])); Loading Loading @@ -146,6 +153,9 @@ void HQ_FEC_processing_fx( Word16 energy_diff_fx; HQ_NBFEC_HANDLE hHQ_nbfec; HQ_DEC_HANDLE hHQ_core; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; Loading Loading @@ -355,7 +365,11 @@ void HQ_FEC_processing_fx( FOR ( j=0; j<Num_bands_p[i]; j++ ) { #ifdef BASOP_NOGLOB hHQ_nbfec->Norm_gain_fx[k++] = shl_o(tmp_fx, 1, &Overflow); #else hHQ_nbfec->Norm_gain_fx[k++] = shl(tmp_fx, 1); #endif move16(); } } Loading
lib_dec/FEC_fx.c +18 −1 Original line number Diff line number Diff line Loading @@ -96,6 +96,9 @@ void FEC_exc_estim_fx( Word32 cond3; Word32 predPitchLag; GSC_DEC_HANDLE hGSCDec; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hGSCDec = st_fx->hGSCDec; AMRWB_IO_DEC_HANDLE hAmrwb_IO; Loading Loading @@ -293,7 +296,11 @@ void FEC_exc_estim_fx( IF( LE_16(st_fx->nbLostCmpt,1)) { /* if stable, do not decrease the energy, pitch_gain = 0 */ #ifdef BASOP_NOGLOB alpha = mac_ro((1L << 16) * 2 * _ALPHA_U_FX, st_fx->stab_fac_fx, 32768 - 2 * _ALPHA_U_FX, &Overflow); /*st_fx->stab_fac_fx in Q15*/ #else alpha = mac_r((1L<<16)*2*_ALPHA_U_FX, st_fx->stab_fac_fx, 32768-2*_ALPHA_U_FX); /*st_fx->stab_fac_fx in Q15*/ #endif } ELSE IF ( EQ_16(st_fx->nbLostCmpt,2)) { Loading Loading @@ -341,8 +348,11 @@ void FEC_exc_estim_fx( L_tmp = L_deposit_h(tmp); L_tmp = Isqrt_lc(L_tmp, &exp); #ifdef BASOP_NOGLOB gain = extract_h(L_shl_o(L_tmp, exp, &Overflow)); #else gain = extract_h(L_shl(L_tmp, exp)); #endif gain = s_min(gain, 32113); /*0.98 */ gain = s_max(gain, 27853); /*0.85 */ Loading Loading @@ -743,6 +753,9 @@ static void pulseRes_preCalc(Word16* cond1, Word16* cond2, Word32* cond3 ,Word16 { Word16 tmp_pit, tmp_pit_e, tmp_frame, tmp_frame_e; Word32 tmp_pit2; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif tmp_pit = BASOP_Util_Divide1616_Scale(new_pit/*Q0*/,Tc/*Q0*/,&tmp_pit_e)/*Q15*/; tmp_frame = add( extract_l(L_mult0(L_frame , 64/*1.f/L_SUBFR Q12*/)/*Q12*/) , 4096/*1.f Q12*/ );/*Q12*/ Loading @@ -751,7 +764,11 @@ static void pulseRes_preCalc(Word16* cond1, Word16* cond2, Word32* cond3 ,Word16 tmp_frame = sub(32767/*1.f Q15*/, tmp_frame);/*Q15*/ BASOP_SATURATE_WARNING_OFF /*To calc Q15 threshold, overflow may happen - do negation and compare with negated value to check also highest possible value*/ #ifdef BASOP_NOGLOB tmp_pit = shl_o(negate(tmp_pit), tmp_pit_e, &Overflow); #else tmp_pit = shl(negate(tmp_pit),tmp_pit_e); #endif BASOP_SATURATE_WARNING_ON *cond1 = sub(tmp_pit, negate(tmp_frame)); Loading