Loading lib_com/swb_bwe_com_fx.c +0 −15 Original line number Diff line number Diff line Loading @@ -36,12 +36,6 @@ #include "basop_util.h" #include "rom_com.h" #ifndef ISSUE_1836_FILEACTIVE_swb_bwe_com_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*==========================================================================*/ /* FUNCTION : Word16 WB_BWE_gain_pred_fx () */ Loading Loading @@ -619,21 +613,12 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 } L_ener_tot = L_add_o( L_ener_tot, L_ener, &Overflow ); } #ifdef ISSUE_1836_replace_overflow_libcom L_ener = L_deposit_l( abs_s( sub_sat( sp[1], sp[0] ) ) ); //??sat #else L_ener = L_deposit_l( abs_s( sub_o( sp[1], sp[0], &Overflow ) ) ); #endif FOR( i = 2; i < N; i++ ) { /* Eq to (sp[i] - sp[i-1]) * (sp[i-1] - sp[i-2]) < 0 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp1 = sub_sat( sp[i], sp[i - 1] ); //??sat tmp2 = sub_sat( sp[i - 1], sp[i - 2] ); //??sat #else tmp1 = sub_o( sp[i], sp[i - 1], &Overflow ); tmp2 = sub_o( sp[i - 1], sp[i - 2], &Overflow ); #endif tmp2 = mult( tmp1, tmp2 ); tmp1 = abs_s( tmp1 ); /* to Get either 0 or -1 in 'tmp2' */ Loading lib_com/swb_bwe_com_lr_fx.c +82 −112 Original line number Diff line number Diff line Loading @@ -38,12 +38,6 @@ #include <assert.h> #ifndef ISSUE_1836_FILEACTIVE_swb_bwe_com_lr_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*-------------------------------------------------------------------* * GetPredictedSignal() * Loading Loading @@ -933,11 +927,9 @@ void SpectrumSmoothing_fx( Word16 reset_flag; Word16 pp, pk; Word16 exp_norm; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif *Qss = 10; Loading Loading @@ -994,11 +986,7 @@ void SpectrumSmoothing_fx( IF( GT_32( L_max_val[i], 0x1L ) ) { exp_normd = norm_l( L_max_val[i] ); #ifdef ISSUE_1836_replace_overflow_libcom max_val_norm_fx = div_s( 0x2800, round_fx_sat( L_shl( L_max_val[i], exp_normd ) ) ); /* Q10-(Qs+exp_normd-16) */ //??sat #else max_val_norm_fx = div_s( 0x2800, round_fx_o( L_shl_o( L_max_val[i], exp_normd, &Overflow ), &Overflow ) ); /* Q10-(Qs+exp_normd-16) */ #endif Qmax_val_norm[i] = sub( 10 - 12 + 16 + 15, exp_normd ); move16(); /* 10 - (12+exp_normd-16) +15 */ ; Loading @@ -1020,19 +1008,10 @@ void SpectrumSmoothing_fx( outBuf_pss_fx[j] = 0; move16(); } ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ){ #ifdef ISSUE_1836_replace_overflow_libcom IF( L_inBuf_pss[j] >= 0 ){ outBuf_pss_fx[j] = round_fx_sat( L_shl_sat( Mpy_32_16_r( L_shl( L_inBuf_pss[j], exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ); //??sat //??sat move32(); } ELSE ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ) { IF( L_inBuf_pss[j] >= 0 ) { outBuf_pss_fx[j] = negate( round_fx_sat( L_shl_sat( Mpy_32_16_r( L_shl_sat( L_abs( L_inBuf_pss[j] ), exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ) ); //??sat //??sat //??sat move16(); } #else IF( L_inBuf_pss[j] >= 0 ){ outBuf_pss_fx[j] = round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_inBuf_pss[j], exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ); move32(); } Loading @@ -1041,7 +1020,6 @@ void SpectrumSmoothing_fx( outBuf_pss_fx[j] = negate( round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_abs( L_inBuf_pss[j] ), exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ) ); move16(); } #endif } ELSE { Loading Loading @@ -2247,11 +2225,9 @@ void ton_ene_est_fx( Word16 temp2_fx, Qtemp2; Word16 temp_fx; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif *QbeL = 3; Loading Loading @@ -2362,7 +2338,7 @@ void ton_ene_est_fx( move16(); /* 0.06=15729(Q18) */ exp_shift = sub( 18, QE_r ); #ifdef ISSUE_1836_replace_overflow_libcom //??sat #ifdef ISSUE_1796_replace_shl_o E_r_shift_fx = shl_sat( E_r_fx, exp_shift ); #else E_r_shift_fx = shl_o( E_r_fx, exp_shift, &Overflow ); Loading Loading @@ -2404,19 +2380,13 @@ void ton_ene_est_fx( L_temp = Mult_32_16( L_temp, E_r_fx ); /* 0.12f: 257698038 (Q31) */ #ifdef ISSUE_1836_replace_overflow_libcom IF( GE_32( L_shl_sat( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ) ), 257698038 ) ) //??sat #else if ( GE_32( L_shl_o( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ), &Overflow ), 257698038 ) ) #endif { ni_gain_fx[k] = mult_r( 1638, ni_gain_fx[k] ); /* 0.05 : 1638(Q15) */ move16(); } #ifndef ISSUE_1836_replace_overflow_libcom Overflow = 0; move16(); #endif ni_gain_fx[k] = shl( ni_gain_fx[k], sub( Qni_gain, Qavg_pe[k] ) ); move16(); assert( Qni_gain == 8 ); /* 358 is '(short)(1.4*pow(2,Qni_gain))' */ Loading Loading @@ -3243,7 +3213,7 @@ void noiseinj_hf_fx( Word16 exp_normn, exp_normd; Word16 div_fx; Word16 Qdiv; #ifndef ISSUE_1836_replace_overflow_libcom #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -3282,8 +3252,8 @@ void noiseinj_hf_fx( move32(); /**p_L_En = (float)sqrt(*p_En);*/ sqrt_32n_16_fx( *p_L_En, QbeL, p_sqrt_En_fx, &Qtemp ); #ifdef ISSUE_1836_replace_overflow_libcom *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ //??sat #ifdef ISSUE_1796_replace_shl_o *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ #else *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ #endif Loading Loading @@ -3356,8 +3326,8 @@ FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ ) /* SQRT Part */ sqrt_32n_16_fx( L_deposit_h( div_fx ), add( Qdiv, 16 ), &ni_scale_fx, &Qtemp ); #ifdef ISSUE_1836_replace_overflow_libcom ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); //??sat #ifdef ISSUE_1796_replace_shl_o ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); #else ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); #endif Loading lib_com/swb_tbe_com_fx.c +49 −212 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
lib_com/swb_bwe_com_fx.c +0 −15 Original line number Diff line number Diff line Loading @@ -36,12 +36,6 @@ #include "basop_util.h" #include "rom_com.h" #ifndef ISSUE_1836_FILEACTIVE_swb_bwe_com_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*==========================================================================*/ /* FUNCTION : Word16 WB_BWE_gain_pred_fx () */ Loading Loading @@ -619,21 +613,12 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 } L_ener_tot = L_add_o( L_ener_tot, L_ener, &Overflow ); } #ifdef ISSUE_1836_replace_overflow_libcom L_ener = L_deposit_l( abs_s( sub_sat( sp[1], sp[0] ) ) ); //??sat #else L_ener = L_deposit_l( abs_s( sub_o( sp[1], sp[0], &Overflow ) ) ); #endif FOR( i = 2; i < N; i++ ) { /* Eq to (sp[i] - sp[i-1]) * (sp[i-1] - sp[i-2]) < 0 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp1 = sub_sat( sp[i], sp[i - 1] ); //??sat tmp2 = sub_sat( sp[i - 1], sp[i - 2] ); //??sat #else tmp1 = sub_o( sp[i], sp[i - 1], &Overflow ); tmp2 = sub_o( sp[i - 1], sp[i - 2], &Overflow ); #endif tmp2 = mult( tmp1, tmp2 ); tmp1 = abs_s( tmp1 ); /* to Get either 0 or -1 in 'tmp2' */ Loading
lib_com/swb_bwe_com_lr_fx.c +82 −112 Original line number Diff line number Diff line Loading @@ -38,12 +38,6 @@ #include <assert.h> #ifndef ISSUE_1836_FILEACTIVE_swb_bwe_com_lr_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*-------------------------------------------------------------------* * GetPredictedSignal() * Loading Loading @@ -933,11 +927,9 @@ void SpectrumSmoothing_fx( Word16 reset_flag; Word16 pp, pk; Word16 exp_norm; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif *Qss = 10; Loading Loading @@ -994,11 +986,7 @@ void SpectrumSmoothing_fx( IF( GT_32( L_max_val[i], 0x1L ) ) { exp_normd = norm_l( L_max_val[i] ); #ifdef ISSUE_1836_replace_overflow_libcom max_val_norm_fx = div_s( 0x2800, round_fx_sat( L_shl( L_max_val[i], exp_normd ) ) ); /* Q10-(Qs+exp_normd-16) */ //??sat #else max_val_norm_fx = div_s( 0x2800, round_fx_o( L_shl_o( L_max_val[i], exp_normd, &Overflow ), &Overflow ) ); /* Q10-(Qs+exp_normd-16) */ #endif Qmax_val_norm[i] = sub( 10 - 12 + 16 + 15, exp_normd ); move16(); /* 10 - (12+exp_normd-16) +15 */ ; Loading @@ -1020,19 +1008,10 @@ void SpectrumSmoothing_fx( outBuf_pss_fx[j] = 0; move16(); } ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ){ #ifdef ISSUE_1836_replace_overflow_libcom IF( L_inBuf_pss[j] >= 0 ){ outBuf_pss_fx[j] = round_fx_sat( L_shl_sat( Mpy_32_16_r( L_shl( L_inBuf_pss[j], exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ); //??sat //??sat move32(); } ELSE ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ) { IF( L_inBuf_pss[j] >= 0 ) { outBuf_pss_fx[j] = negate( round_fx_sat( L_shl_sat( Mpy_32_16_r( L_shl_sat( L_abs( L_inBuf_pss[j] ), exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ) ); //??sat //??sat //??sat move16(); } #else IF( L_inBuf_pss[j] >= 0 ){ outBuf_pss_fx[j] = round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_inBuf_pss[j], exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ); move32(); } Loading @@ -1041,7 +1020,6 @@ void SpectrumSmoothing_fx( outBuf_pss_fx[j] = negate( round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_abs( L_inBuf_pss[j] ), exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ) ); move16(); } #endif } ELSE { Loading Loading @@ -2247,11 +2225,9 @@ void ton_ene_est_fx( Word16 temp2_fx, Qtemp2; Word16 temp_fx; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif *QbeL = 3; Loading Loading @@ -2362,7 +2338,7 @@ void ton_ene_est_fx( move16(); /* 0.06=15729(Q18) */ exp_shift = sub( 18, QE_r ); #ifdef ISSUE_1836_replace_overflow_libcom //??sat #ifdef ISSUE_1796_replace_shl_o E_r_shift_fx = shl_sat( E_r_fx, exp_shift ); #else E_r_shift_fx = shl_o( E_r_fx, exp_shift, &Overflow ); Loading Loading @@ -2404,19 +2380,13 @@ void ton_ene_est_fx( L_temp = Mult_32_16( L_temp, E_r_fx ); /* 0.12f: 257698038 (Q31) */ #ifdef ISSUE_1836_replace_overflow_libcom IF( GE_32( L_shl_sat( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ) ), 257698038 ) ) //??sat #else if ( GE_32( L_shl_o( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ), &Overflow ), 257698038 ) ) #endif { ni_gain_fx[k] = mult_r( 1638, ni_gain_fx[k] ); /* 0.05 : 1638(Q15) */ move16(); } #ifndef ISSUE_1836_replace_overflow_libcom Overflow = 0; move16(); #endif ni_gain_fx[k] = shl( ni_gain_fx[k], sub( Qni_gain, Qavg_pe[k] ) ); move16(); assert( Qni_gain == 8 ); /* 358 is '(short)(1.4*pow(2,Qni_gain))' */ Loading Loading @@ -3243,7 +3213,7 @@ void noiseinj_hf_fx( Word16 exp_normn, exp_normd; Word16 div_fx; Word16 Qdiv; #ifndef ISSUE_1836_replace_overflow_libcom #ifndef ISSUE_1796_replace_shl_o #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -3282,8 +3252,8 @@ void noiseinj_hf_fx( move32(); /**p_L_En = (float)sqrt(*p_En);*/ sqrt_32n_16_fx( *p_L_En, QbeL, p_sqrt_En_fx, &Qtemp ); #ifdef ISSUE_1836_replace_overflow_libcom *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ //??sat #ifdef ISSUE_1796_replace_shl_o *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ #else *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ #endif Loading Loading @@ -3356,8 +3326,8 @@ FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ ) /* SQRT Part */ sqrt_32n_16_fx( L_deposit_h( div_fx ), add( Qdiv, 16 ), &ni_scale_fx, &Qtemp ); #ifdef ISSUE_1836_replace_overflow_libcom ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); //??sat #ifdef ISSUE_1796_replace_shl_o ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); #else ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); #endif Loading
lib_com/swb_tbe_com_fx.c +49 −212 File changed.Preview size limit exceeded, changes collapsed. Show changes