Loading lib_com/deemph_fx.c +5 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,11 @@ void E_UTIL_deemph2( Word16 shift, Word16 *x, const Word16 mu, const Word16 L, W { FOR( i = 0; i < L; i++ ) { #ifdef ISSUE_1772_replace_shr_o L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_sat( x[i], shift ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/ #else L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_o( x[i], shift, &Overflow ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/ #endif x[i] = round_fx_o( L_tmp, &Overflow ); /*Qx-shift*/ move16(); } Loading lib_com/low_rate_band_att_fx.c +10 −2 Original line number Diff line number Diff line Loading @@ -97,7 +97,11 @@ void ivas_fine_gain_pred_fx( /*gp *= 1.0f - 0.05f / accuracy; */ tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ #ifdef ISSUE_1772_replace_shr_o tmp = shr_sat( tmp, sub( 34, exp ) ); /*15+18-exp+16-15=34-exp */ #else tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ #endif tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ gp = mult_r( tmp, gp ); /*15+12+1-16=12 */ Loading Loading @@ -205,7 +209,11 @@ void fine_gain_pred_fx( /*gp *= 1.0f - 0.05f / accuracy; */ tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ #ifdef ISSUE_1772_replace_shr_o tmp = shr_sat( tmp, sub( 34, exp ) ); /*15+18-exp+16-15=34-exp */ #else tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ #endif tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ gp = mult_r( tmp, gp ); /*15+12+1-16=12 */ Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ #define FIX_1762_COMPILER_ISSUE /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */ #define ISSUE_1751_replace_shl_ro /*FhG: replace shl_ro by overflow-free alternatives*/ #define ISSUE_1770_replace_shr_ro /* FhG: replace by non-overflow-alternative - BE */ #define ISSUE_1772_replace_shr_o /* FhG: replace by non-overflow-alternative - BE */ #define FIX_1735_W_SHL_SAT_L /* FhG: Usage of W_shl_sat_l() */ Loading lib_com/syn_filt_fx.c +10 −0 Original line number Diff line number Diff line Loading @@ -188,14 +188,20 @@ void syn_filt_fx( Word16 *yy; Word32 s; Word16 q; #ifndef ISSUE_1772_replace_shr_o Flag Overflow = 0; move16(); #endif Word16 a0; yy = &buf[0]; q = add( norm_s( a[0] ), 1 ); #ifdef ISSUE_1772_replace_shr_o a0 = shr_sat( a[0], shift ); /* input / 2^shift */ #else a0 = shr_o( a[0], shift, &Overflow ); /* input / 2^shift */ #endif /*------------------------------------------------------------------* * copy initial filter states into synthesis buffer and do synthesis Loading Loading @@ -373,7 +379,11 @@ void E_UTIL_synthesis( const Word16 shift, const Word16 a[], const Word16 x[], W *-----------------------------------------------------------------------*/ mem += m; /*move16();*/ #ifdef ISSUE_1772_replace_shr_o a0 = shr_sat( a[0], shift ); /* input / 2^shift */ #else a0 = shr_o( a[0], shift, &Overflow ); /* input / 2^shift */ #endif /*-----------------------------------------------------------------------* * Do the filtering *-----------------------------------------------------------------------*/ Loading lib_dec/FEC_HQ_core_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -638,7 +638,11 @@ void ivas_HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1772_replace_shr_o *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_o( tmp_fx, sub( exp, 5 ), &Overflow ), &Overflow ); #endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading @@ -924,7 +928,11 @@ void HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1772_replace_shr_o *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_o( tmp_fx, sub( exp, 5 ), &Overflow ), &Overflow ); #endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading
lib_com/deemph_fx.c +5 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,11 @@ void E_UTIL_deemph2( Word16 shift, Word16 *x, const Word16 mu, const Word16 L, W { FOR( i = 0; i < L; i++ ) { #ifdef ISSUE_1772_replace_shr_o L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_sat( x[i], shift ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/ #else L_tmp = L_msu_o( Mpy_32_16_1( L_tmp, mu ), shr_o( x[i], shift, &Overflow ), -32768 /*1.0f in Q15*/, &Overflow ); /*Qx-shift+16*/ #endif x[i] = round_fx_o( L_tmp, &Overflow ); /*Qx-shift*/ move16(); } Loading
lib_com/low_rate_band_att_fx.c +10 −2 Original line number Diff line number Diff line Loading @@ -97,7 +97,11 @@ void ivas_fine_gain_pred_fx( /*gp *= 1.0f - 0.05f / accuracy; */ tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ #ifdef ISSUE_1772_replace_shr_o tmp = shr_sat( tmp, sub( 34, exp ) ); /*15+18-exp+16-15=34-exp */ #else tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ #endif tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ gp = mult_r( tmp, gp ); /*15+12+1-16=12 */ Loading Loading @@ -205,7 +209,11 @@ void fine_gain_pred_fx( /*gp *= 1.0f - 0.05f / accuracy; */ tmp = div_s( 13107, accuracy ); /* 0.05 in Q18 */ #ifdef ISSUE_1772_replace_shr_o tmp = shr_sat( tmp, sub( 34, exp ) ); /*15+18-exp+16-15=34-exp */ #else tmp = shr_o( tmp, sub( 34, exp ), &Overflow ); /*15+18-exp+16-15=34-exp */ #endif tmp = sub( 32767, tmp ); tmp = s_max( 27554, tmp ); /* Limit attenuation to norm quantizer error, 2^-0.25 in Q15 */ gp = mult_r( tmp, gp ); /*15+12+1-16=12 */ Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ #define FIX_1762_COMPILER_ISSUE /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */ #define ISSUE_1751_replace_shl_ro /*FhG: replace shl_ro by overflow-free alternatives*/ #define ISSUE_1770_replace_shr_ro /* FhG: replace by non-overflow-alternative - BE */ #define ISSUE_1772_replace_shr_o /* FhG: replace by non-overflow-alternative - BE */ #define FIX_1735_W_SHL_SAT_L /* FhG: Usage of W_shl_sat_l() */ Loading
lib_com/syn_filt_fx.c +10 −0 Original line number Diff line number Diff line Loading @@ -188,14 +188,20 @@ void syn_filt_fx( Word16 *yy; Word32 s; Word16 q; #ifndef ISSUE_1772_replace_shr_o Flag Overflow = 0; move16(); #endif Word16 a0; yy = &buf[0]; q = add( norm_s( a[0] ), 1 ); #ifdef ISSUE_1772_replace_shr_o a0 = shr_sat( a[0], shift ); /* input / 2^shift */ #else a0 = shr_o( a[0], shift, &Overflow ); /* input / 2^shift */ #endif /*------------------------------------------------------------------* * copy initial filter states into synthesis buffer and do synthesis Loading Loading @@ -373,7 +379,11 @@ void E_UTIL_synthesis( const Word16 shift, const Word16 a[], const Word16 x[], W *-----------------------------------------------------------------------*/ mem += m; /*move16();*/ #ifdef ISSUE_1772_replace_shr_o a0 = shr_sat( a[0], shift ); /* input / 2^shift */ #else a0 = shr_o( a[0], shift, &Overflow ); /* input / 2^shift */ #endif /*-----------------------------------------------------------------------* * Do the filtering *-----------------------------------------------------------------------*/ Loading
lib_dec/FEC_HQ_core_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -638,7 +638,11 @@ void ivas_HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1772_replace_shr_o *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_o( tmp_fx, sub( exp, 5 ), &Overflow ), &Overflow ); #endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading @@ -924,7 +928,11 @@ void HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1772_replace_shr_o *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_o( tmp_fx, sub( exp, 5 ), &Overflow ), &Overflow ); #endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading