Loading lib_com/options.h +2 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ #define ISSUE_1836_FILEACTIVE_igf_base_fx_c #define ISSUE_1836_FILEACTIVE_interpol_fx_c // #define ISSUE_1836_FILEACTIVE_log2_c //nothing done #if 1 #define ISSUE_1836_FILEACTIVE_low_rate_band_att_fx_c #define ISSUE_1836_FILEACTIVE_lpc_tools_fx_c #define ISSUE_1836_FILEACTIVE_lsf_tools_fx_c Loading @@ -181,6 +181,7 @@ #define ISSUE_1836_FILEACTIVE_swb_bwe_com_lr_fx_c #define ISSUE_1836_FILEACTIVE_swb_tbe_com_fx_c #define ISSUE_1836_FILEACTIVE_syn_filt_fx_c #if 1 #define ISSUE_1836_FILEACTIVE_tcx_ltp_fx_c #define ISSUE_1836_FILEACTIVE_tcx_mdct_fx_c Loading lib_com/residu_fx.c +45 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,12 @@ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" #ifndef ISSUE_1836_FILEACTIVE_residu_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*--------------------------------------------------------------------* * residu_ivas_fx() * Loading Loading @@ -62,9 +68,11 @@ void Residu3_lc_fx( Word16 i, j; Word32 s; Word16 q; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif q = add( norm_s( a[0] ), 1 ); Loading @@ -72,11 +80,37 @@ void Residu3_lc_fx( { q = add( q, shift ); } #ifdef ISSUE_1796_replace_shl_o *y++ = shl_sat( x[0], shift ); #ifdef ISSUE_1836_replace_overflow_libcom *y++ = shl_sat( x[0], shift ); //??sat move16(); FOR( i = 1; i < m; i++ ) { s = L_mult_sat( x[i], a[0] ); //??sat /* Stop at i to Avoid Mults with Zeros */ FOR( j = 1; j <= i; j++ ) { s = L_mac_sat( s, x[i - j], a[j] ); //??sat } s = L_shl_sat( s, q ); //??sat *y++ = round_fx_sat( s ); //??sat } FOR( ; i < lg; i++ ) { s = L_mult_sat( x[i], a[0] ); //??sat FOR( j = 1; j <= m; j++ ) { s = L_mac_sat( s, x[i - j], a[j] ); //??sat } s = L_shl_sat( s, q ); //??sat *y++ = round_fx_sat( s ); //??sat } #else *y++ = shl_o( x[0], shift, &Overflow ); #endif move16(); FOR( i = 1; i < m; i++ ) Loading @@ -103,6 +137,8 @@ void Residu3_lc_fx( s = L_shl_o( s, q, &Overflow ); *y++ = round_fx_o( s, &Overflow ); } #endif } /*--------------------------------------------------------------------* Loading Loading @@ -155,9 +191,11 @@ void Residu3_fx( Word64 s64; Word32 s32; Word16 q; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif q = add( norm_s( a[0] ), 1 ); if ( shift != 0 ) Loading @@ -174,7 +212,11 @@ void Residu3_fx( } s64 = W_mac_16_16( s64, x[i - 16], a[16] ); s32 = W_shl_sat_l( s64, q ); #ifdef ISSUE_1836_replace_overflow_libcom y[i] = round_fx_sat( s32 ); //??sat #else y[i] = round_fx_o( s32, &Overflow ); #endif move16(); } } Loading lib_com/stat_noise_uv_mod_fx.c +31 −9 Original line number Diff line number Diff line Loading @@ -16,6 +16,12 @@ #define P1 ( 32768 - ISP_SMOOTHING_QUANT_A1_FX - 1 ) #define P9 ( 32767 - P1 ) #ifndef ISSUE_1836_FILEACTIVE_stat_noise_uv_mod_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*---------------------------------------------------------* * Local functions *---------------------------------------------------------*/ Loading Loading @@ -74,9 +80,11 @@ void stat_noise_uv_mod_fx( Word16 En_shift, Tmp; Word16 Exc2_local[L_FRAME]; /* local_copy in scaled Q_local*/ #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*---------------------------------------------------------* Loading Loading @@ -109,7 +117,11 @@ void stat_noise_uv_mod_fx( move16(); tmp_res = div_l( L_tmp_res, tmp_den ); move16(); #ifdef ISSUE_1836_replace_overflow_libcom min_alpha = add_sat( tmp_res, 16384 ); //??sat #else min_alpha = add_o( tmp_res, 16384, &Overflow ); #endif move16(); /**st_min_alpha = sub(*st_min_alpha, 1638); move16();*/ Loading Loading @@ -161,8 +173,8 @@ void stat_noise_uv_mod_fx( FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ #ifdef ISSUE_1796_replace_shl_o exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ //??Sat #else exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ #endif Loading Loading @@ -190,8 +202,8 @@ void stat_noise_uv_mod_fx( tmp_shift = norm_s( tmp_den ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); #ifdef ISSUE_1796_replace_shl_o tmp_res = shl_sat( tmp_res, tmp_shift ); #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = shl_sat( tmp_res, tmp_shift ); //??Sat #else tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); #endif Loading Loading @@ -258,7 +270,11 @@ void stat_noise_uv_mod_fx( L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ L_tmp_res = L_add_sat( L_shl_sat( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = extract_h( L_shl_sat( L_tmp_res, 15 ) ); /* 15+15-16=14 */ //??sat #else tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ #endif Noimix_fract = extract_l( Mult_32_16( L_tmp_res, Noimix_fract ) ); /*15+15-15 */ Loading Loading @@ -392,9 +408,11 @@ void stat_noise_uv_mod_ivas_fx( Word16 En_shift, Tmp; Word16 Exc2_local[L_FRAME]; /* local_copy in scaled Q_local*/ Word32 L_Exc2_local[L_FRAME]; /* local_copy in scaled Q_local*/ #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*---------------------------------------------------------* Loading Loading @@ -424,7 +442,11 @@ void stat_noise_uv_mod_ivas_fx( L_tmp_res = L_shl( L_tmp_res, sub( tmp_shift, 1 ) ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_l( L_tmp_res, tmp_den ); #ifdef ISSUE_1836_replace_overflow_libcom min_alpha = add_sat( tmp_res, 16384 ); //??sat #else min_alpha = add_o( tmp_res, 16384, &Overflow ); #endif /**st_min_alpha = sub(*st_min_alpha, 1638); move16();*/ min_alpha = s_max( min_alpha, sub( *st_min_alpha, 1638 ) ); Loading Loading @@ -475,8 +497,8 @@ void stat_noise_uv_mod_ivas_fx( FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ #ifdef ISSUE_1796_replace_shl_o exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ //??sat #else exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ #endif Loading Loading @@ -504,8 +526,8 @@ void stat_noise_uv_mod_ivas_fx( tmp_shift = norm_s( tmp_den ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); #ifdef ISSUE_1796_replace_shl_o tmp_res = shl_sat( tmp_res, tmp_shift ); #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = shl_sat( tmp_res, tmp_shift ); //??sat #else tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); #endif Loading lib_com/swb_bwe_com_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ #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 @@ -613,12 +619,21 @@ 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 +112 −82 Original line number Diff line number Diff line Loading @@ -38,6 +38,12 @@ #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 @@ -927,9 +933,11 @@ 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 @@ -986,7 +994,11 @@ 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 @@ -1008,10 +1020,19 @@ void SpectrumSmoothing_fx( outBuf_pss_fx[j] = 0; move16(); } ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ) { IF( L_inBuf_pss[j] >= 0 ) 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 { 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 @@ -1020,6 +1041,7 @@ 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 @@ -2225,9 +2247,11 @@ 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 @@ -2338,7 +2362,7 @@ void ton_ene_est_fx( move16(); /* 0.06=15729(Q18) */ exp_shift = sub( 18, QE_r ); #ifdef ISSUE_1796_replace_shl_o #ifdef ISSUE_1836_replace_overflow_libcom //??sat 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 @@ -2380,13 +2404,19 @@ 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 @@ -3213,7 +3243,7 @@ void noiseinj_hf_fx( Word16 exp_normn, exp_normd; Word16 div_fx; Word16 Qdiv; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -3252,8 +3282,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_1796_replace_shl_o *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ #ifdef ISSUE_1836_replace_overflow_libcom *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ //??sat #else *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ #endif Loading Loading @@ -3326,8 +3356,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_1796_replace_shl_o ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); #ifdef ISSUE_1836_replace_overflow_libcom ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); //??sat #else ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); #endif Loading Loading
lib_com/options.h +2 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ #define ISSUE_1836_FILEACTIVE_igf_base_fx_c #define ISSUE_1836_FILEACTIVE_interpol_fx_c // #define ISSUE_1836_FILEACTIVE_log2_c //nothing done #if 1 #define ISSUE_1836_FILEACTIVE_low_rate_band_att_fx_c #define ISSUE_1836_FILEACTIVE_lpc_tools_fx_c #define ISSUE_1836_FILEACTIVE_lsf_tools_fx_c Loading @@ -181,6 +181,7 @@ #define ISSUE_1836_FILEACTIVE_swb_bwe_com_lr_fx_c #define ISSUE_1836_FILEACTIVE_swb_tbe_com_fx_c #define ISSUE_1836_FILEACTIVE_syn_filt_fx_c #if 1 #define ISSUE_1836_FILEACTIVE_tcx_ltp_fx_c #define ISSUE_1836_FILEACTIVE_tcx_mdct_fx_c Loading
lib_com/residu_fx.c +45 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,12 @@ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" #ifndef ISSUE_1836_FILEACTIVE_residu_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*--------------------------------------------------------------------* * residu_ivas_fx() * Loading Loading @@ -62,9 +68,11 @@ void Residu3_lc_fx( Word16 i, j; Word32 s; Word16 q; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif q = add( norm_s( a[0] ), 1 ); Loading @@ -72,11 +80,37 @@ void Residu3_lc_fx( { q = add( q, shift ); } #ifdef ISSUE_1796_replace_shl_o *y++ = shl_sat( x[0], shift ); #ifdef ISSUE_1836_replace_overflow_libcom *y++ = shl_sat( x[0], shift ); //??sat move16(); FOR( i = 1; i < m; i++ ) { s = L_mult_sat( x[i], a[0] ); //??sat /* Stop at i to Avoid Mults with Zeros */ FOR( j = 1; j <= i; j++ ) { s = L_mac_sat( s, x[i - j], a[j] ); //??sat } s = L_shl_sat( s, q ); //??sat *y++ = round_fx_sat( s ); //??sat } FOR( ; i < lg; i++ ) { s = L_mult_sat( x[i], a[0] ); //??sat FOR( j = 1; j <= m; j++ ) { s = L_mac_sat( s, x[i - j], a[j] ); //??sat } s = L_shl_sat( s, q ); //??sat *y++ = round_fx_sat( s ); //??sat } #else *y++ = shl_o( x[0], shift, &Overflow ); #endif move16(); FOR( i = 1; i < m; i++ ) Loading @@ -103,6 +137,8 @@ void Residu3_lc_fx( s = L_shl_o( s, q, &Overflow ); *y++ = round_fx_o( s, &Overflow ); } #endif } /*--------------------------------------------------------------------* Loading Loading @@ -155,9 +191,11 @@ void Residu3_fx( Word64 s64; Word32 s32; Word16 q; #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif q = add( norm_s( a[0] ), 1 ); if ( shift != 0 ) Loading @@ -174,7 +212,11 @@ void Residu3_fx( } s64 = W_mac_16_16( s64, x[i - 16], a[16] ); s32 = W_shl_sat_l( s64, q ); #ifdef ISSUE_1836_replace_overflow_libcom y[i] = round_fx_sat( s32 ); //??sat #else y[i] = round_fx_o( s32, &Overflow ); #endif move16(); } } Loading
lib_com/stat_noise_uv_mod_fx.c +31 −9 Original line number Diff line number Diff line Loading @@ -16,6 +16,12 @@ #define P1 ( 32768 - ISP_SMOOTHING_QUANT_A1_FX - 1 ) #define P9 ( 32767 - P1 ) #ifndef ISSUE_1836_FILEACTIVE_stat_noise_uv_mod_fx_c #ifdef ISSUE_1836_replace_overflow_libcom #undef ISSUE_1836_replace_overflow_libcom #endif #endif /*---------------------------------------------------------* * Local functions *---------------------------------------------------------*/ Loading Loading @@ -74,9 +80,11 @@ void stat_noise_uv_mod_fx( Word16 En_shift, Tmp; Word16 Exc2_local[L_FRAME]; /* local_copy in scaled Q_local*/ #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*---------------------------------------------------------* Loading Loading @@ -109,7 +117,11 @@ void stat_noise_uv_mod_fx( move16(); tmp_res = div_l( L_tmp_res, tmp_den ); move16(); #ifdef ISSUE_1836_replace_overflow_libcom min_alpha = add_sat( tmp_res, 16384 ); //??sat #else min_alpha = add_o( tmp_res, 16384, &Overflow ); #endif move16(); /**st_min_alpha = sub(*st_min_alpha, 1638); move16();*/ Loading Loading @@ -161,8 +173,8 @@ void stat_noise_uv_mod_fx( FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ #ifdef ISSUE_1796_replace_shl_o exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ //??Sat #else exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ #endif Loading Loading @@ -190,8 +202,8 @@ void stat_noise_uv_mod_fx( tmp_shift = norm_s( tmp_den ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); #ifdef ISSUE_1796_replace_shl_o tmp_res = shl_sat( tmp_res, tmp_shift ); #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = shl_sat( tmp_res, tmp_shift ); //??Sat #else tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); #endif Loading Loading @@ -258,7 +270,11 @@ void stat_noise_uv_mod_fx( L_tmp_res = Mult_32_16( *ge_sm, tmp_res ); /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */ L_tmp_res = Mult_32_16( L_tmp_res, sub( 32767, beta ) ); /*30-Q_local-tmp_shift+15-15 */ L_tmp_res = L_add_sat( L_shl_sat( L_tmp_res, sub( add( Q_local, tmp_shift ), 15 ) ), beta ); /* Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = extract_h( L_shl_sat( L_tmp_res, 15 ) ); /* 15+15-16=14 */ //??sat #else tmp_res = extract_h( L_shl_o( L_tmp_res, 15, &Overflow ) ); /* 15+15-16=14 */ #endif Noimix_fract = extract_l( Mult_32_16( L_tmp_res, Noimix_fract ) ); /*15+15-15 */ Loading Loading @@ -392,9 +408,11 @@ void stat_noise_uv_mod_ivas_fx( Word16 En_shift, Tmp; Word16 Exc2_local[L_FRAME]; /* local_copy in scaled Q_local*/ Word32 L_Exc2_local[L_FRAME]; /* local_copy in scaled Q_local*/ #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*---------------------------------------------------------* Loading Loading @@ -424,7 +442,11 @@ void stat_noise_uv_mod_ivas_fx( L_tmp_res = L_shl( L_tmp_res, sub( tmp_shift, 1 ) ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_l( L_tmp_res, tmp_den ); #ifdef ISSUE_1836_replace_overflow_libcom min_alpha = add_sat( tmp_res, 16384 ); //??sat #else min_alpha = add_o( tmp_res, 16384, &Overflow ); #endif /**st_min_alpha = sub(*st_min_alpha, 1638); move16();*/ min_alpha = s_max( min_alpha, sub( *st_min_alpha, 1638 ) ); Loading Loading @@ -475,8 +497,8 @@ void stat_noise_uv_mod_ivas_fx( FOR( i_subfr = 0; i_subfr < L_FRAME; i_subfr += L_SUBFR ) { exctilt = calc_tilt_fx( &Exc2_local[i_subfr], En_shift, L_SUBFR ); /*Q15 */ #ifdef ISSUE_1796_replace_shl_o exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ #ifdef ISSUE_1836_replace_overflow_libcom exctilt = mult( shl_sat( sub( TILT_COMP_LIM_FX, min_alpha ), 2 ), exctilt ); /*Q15 */ //??sat #else exctilt = mult( shl_o( sub( TILT_COMP_LIM_FX, min_alpha ), 2, &Overflow ), exctilt ); /*Q15 */ #endif Loading Loading @@ -504,8 +526,8 @@ void stat_noise_uv_mod_ivas_fx( tmp_shift = norm_s( tmp_den ); tmp_den = shl( tmp_den, tmp_shift ); tmp_res = div_s( tmp_nom, tmp_den ); #ifdef ISSUE_1796_replace_shl_o tmp_res = shl_sat( tmp_res, tmp_shift ); #ifdef ISSUE_1836_replace_overflow_libcom tmp_res = shl_sat( tmp_res, tmp_shift ); //??sat #else tmp_res = shl_o( tmp_res, tmp_shift, &Overflow ); #endif Loading
lib_com/swb_bwe_com_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ #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 @@ -613,12 +619,21 @@ 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 +112 −82 Original line number Diff line number Diff line Loading @@ -38,6 +38,12 @@ #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 @@ -927,9 +933,11 @@ 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 @@ -986,7 +994,11 @@ 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 @@ -1008,10 +1020,19 @@ void SpectrumSmoothing_fx( outBuf_pss_fx[j] = 0; move16(); } ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ) { IF( L_inBuf_pss[j] >= 0 ) 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 { 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 @@ -1020,6 +1041,7 @@ 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 @@ -2225,9 +2247,11 @@ 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 @@ -2338,7 +2362,7 @@ void ton_ene_est_fx( move16(); /* 0.06=15729(Q18) */ exp_shift = sub( 18, QE_r ); #ifdef ISSUE_1796_replace_shl_o #ifdef ISSUE_1836_replace_overflow_libcom //??sat 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 @@ -2380,13 +2404,19 @@ 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 @@ -3213,7 +3243,7 @@ void noiseinj_hf_fx( Word16 exp_normn, exp_normd; Word16 div_fx; Word16 Qdiv; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1836_replace_overflow_libcom #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -3252,8 +3282,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_1796_replace_shl_o *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ #ifdef ISSUE_1836_replace_overflow_libcom *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ //??sat #else *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */ #endif Loading Loading @@ -3326,8 +3356,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_1796_replace_shl_o ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); #ifdef ISSUE_1836_replace_overflow_libcom ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); //??sat #else ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow ); #endif Loading