Loading lib_com/basop32.c +2 −2 Original line number Diff line number Diff line Loading @@ -3582,13 +3582,13 @@ Word16 i_mult_o( Word16 a, Word16 b, Flag *Overflow ) #ifdef ORIGINAL_G7231 return a * b; #else register Word32 c = a * b; register Word32 c = (Word32) a * b; return saturate_o( c, Overflow ); #endif } Word16 i_mult( Word16 a, Word16 b ) { return i_mult_o( a, b, NULL ); return i_mult_sat( a, b ); } Word16 i_mult_sat( Word16 a, Word16 b ) { 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/ivas_prot_fx.h +14 −1 Original line number Diff line number Diff line Loading @@ -1575,7 +1575,12 @@ void ivas_mdct_core_tns_ns_fx( Word32 *x_fx[CPE_CHANNELS][NB_DIV], /* o : synthesis @internal_FS */ Word32 Aq_fx[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )], /* o : LP coefficients */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ Word16 x_e[CPE_CHANNELS][NB_DIV] ); #ifdef OPT_SBA_DEC_V2_NBE Word16 x_e #else /* OPT_SBA_DEC_V2_NBE */ Word16 x_e[CPE_CHANNELS][NB_DIV] #endif /* OPT_SBA_DEC_V2_NBE */ ); void decoder_tcx_imdct_fx( Decoder_State *st, /* i/o: coder memory state */ Loading Loading @@ -1936,9 +1941,17 @@ void ivas_mdct_core_invQ_fx( Word16 fUseTns[CPE_CHANNELS][NB_DIV], /* i : flag TNS enabled */ STnsData tnsData[CPE_CHANNELS][NB_DIV], /* i : TNS parameter */ Word32 *x_0[CPE_CHANNELS][NB_DIV], /* i/o: signal buffer */ #ifdef OPT_SBA_DEC_V2_NBE Word16 x_0_e, #else /* OPT_SBA_DEC_V2_NBE */ Word16 x_0_e[CPE_CHANNELS][NB_DIV], #endif /* OPT_SBA_DEC_V2_NBE */ Word32 *x[CPE_CHANNELS][NB_DIV], /* i/o: signal buffer */ #ifdef OPT_SBA_DEC_V2_NBE Word16 x_e, #else /* OPT_SBA_DEC_V2_NBE */ Word16 x_e[CPE_CHANNELS][NB_DIV], #endif /* OPT_SBA_DEC_V2_NBE */ Word16 x_len[CPE_CHANNELS][NB_DIV], Word16 Aq[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )], /* i : LP coefficients */ Word16 ms_mask[NB_DIV][MAX_SFB], /* i : M/S mask */ 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 +6 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,9 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_MCH_DEC_V1_BE #define OPT_MCT_ENC_V2_NBE #define OPT_SBA_DEC_V2_NBE #define OPT_MCT_ENC_V1_NBE #define OPT_MCT_ENC_V1_BE #define OPT_SBA_REND_V1_BE Loading @@ -104,5 +107,8 @@ #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() */ #endif Loading
lib_com/basop32.c +2 −2 Original line number Diff line number Diff line Loading @@ -3582,13 +3582,13 @@ Word16 i_mult_o( Word16 a, Word16 b, Flag *Overflow ) #ifdef ORIGINAL_G7231 return a * b; #else register Word32 c = a * b; register Word32 c = (Word32) a * b; return saturate_o( c, Overflow ); #endif } Word16 i_mult( Word16 a, Word16 b ) { return i_mult_o( a, b, NULL ); return i_mult_sat( a, b ); } Word16 i_mult_sat( Word16 a, Word16 b ) { 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/ivas_prot_fx.h +14 −1 Original line number Diff line number Diff line Loading @@ -1575,7 +1575,12 @@ void ivas_mdct_core_tns_ns_fx( Word32 *x_fx[CPE_CHANNELS][NB_DIV], /* o : synthesis @internal_FS */ Word32 Aq_fx[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )], /* o : LP coefficients */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ Word16 x_e[CPE_CHANNELS][NB_DIV] ); #ifdef OPT_SBA_DEC_V2_NBE Word16 x_e #else /* OPT_SBA_DEC_V2_NBE */ Word16 x_e[CPE_CHANNELS][NB_DIV] #endif /* OPT_SBA_DEC_V2_NBE */ ); void decoder_tcx_imdct_fx( Decoder_State *st, /* i/o: coder memory state */ Loading Loading @@ -1936,9 +1941,17 @@ void ivas_mdct_core_invQ_fx( Word16 fUseTns[CPE_CHANNELS][NB_DIV], /* i : flag TNS enabled */ STnsData tnsData[CPE_CHANNELS][NB_DIV], /* i : TNS parameter */ Word32 *x_0[CPE_CHANNELS][NB_DIV], /* i/o: signal buffer */ #ifdef OPT_SBA_DEC_V2_NBE Word16 x_0_e, #else /* OPT_SBA_DEC_V2_NBE */ Word16 x_0_e[CPE_CHANNELS][NB_DIV], #endif /* OPT_SBA_DEC_V2_NBE */ Word32 *x[CPE_CHANNELS][NB_DIV], /* i/o: signal buffer */ #ifdef OPT_SBA_DEC_V2_NBE Word16 x_e, #else /* OPT_SBA_DEC_V2_NBE */ Word16 x_e[CPE_CHANNELS][NB_DIV], #endif /* OPT_SBA_DEC_V2_NBE */ Word16 x_len[CPE_CHANNELS][NB_DIV], Word16 Aq[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )], /* i : LP coefficients */ Word16 ms_mask[NB_DIV][MAX_SFB], /* i : M/S mask */ 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 +6 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,9 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_MCH_DEC_V1_BE #define OPT_MCT_ENC_V2_NBE #define OPT_SBA_DEC_V2_NBE #define OPT_MCT_ENC_V1_NBE #define OPT_MCT_ENC_V1_BE #define OPT_SBA_REND_V1_BE Loading @@ -104,5 +107,8 @@ #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() */ #endif