diff --git a/lib_com/options.h b/lib_com/options.h index 47e6a27216ae7db1d4d98942f69dfcd977aa87a6..88443281916acfada966be18a6411fce186b5fda 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -70,7 +70,8 @@ #define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO /* Eri: Issue 1010: Division by zero in Stereo CNG */ #define NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES /* FhG: issue 1133: skip de-whitening of bg noise shape after frameloss period if the first good frame is an SID */ #define NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID /* FhG: issue 1133: in TCX PLC, don't scale hHQ_core->old_out after applying fade to noise in burst frame error */ -#define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */ +#define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */ +#define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ /* #################### End FIXES switches ############################ */ diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index c858a80af42f4afc9194c47758dad0f4b5b44513..8ac934f44fa544102ec1150fd5f18c8580a87d47 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -325,6 +325,15 @@ void wb_tbe_dec( prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 ); curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 ); +#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE + if ( st->element_mode > EVS_MONO ) + { + /* prevent too low values of energy */ + prev_pow = max( 0.00001f, prev_pow ); + curr_pow = max( 0.00001f, curr_pow ); + } +#endif + if ( voice_factors[0] > 0.75f ) { curr_pow *= 0.25; @@ -1059,6 +1068,15 @@ void swb_tbe_dec( prev_pow = sum2_f( shaped_shb_excitation, L_SHB_LAHEAD + 10 ); curr_pow = sum2_f( shaped_shb_excitation + L_SHB_LAHEAD + 10, L_SHB_LAHEAD + 10 ); +#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE + if ( st->element_mode > EVS_MONO ) + { + /* prevent too low values of energy */ + prev_pow = max( 0.00001f, prev_pow ); + curr_pow = max( 0.00001f, curr_pow ); + } +#endif + if ( voice_factors[0] > 0.75f ) { curr_pow *= 0.25; diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index e8573d96b1142a05a22c44450b186e612696bcc2..cef5e338dfb196719f910a48333e8262269cb0ec 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -373,6 +373,15 @@ void wb_tbe_enc( prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 ); curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 ); +#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE + if ( st->element_mode > EVS_MONO ) + { + /* prevent too low values of energy */ + prev_pow = max( 0.00001f, prev_pow ); + curr_pow = max( 0.00001f, curr_pow ); + } +#endif + if ( voice_factors[0] > 0.75f ) { curr_pow = (float) ( curr_pow * 0.25 ); @@ -1050,6 +1059,15 @@ void swb_tbe_enc( prev_pow = sum2_f( shaped_shb_excitation, L_SHB_LAHEAD + 10 ); curr_pow = sum2_f( shaped_shb_excitation + L_SHB_LAHEAD + 10, L_SHB_LAHEAD + 10 ); +#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE + if ( st->element_mode > EVS_MONO ) + { + /* prevent too low values of energy */ + prev_pow = max( 0.00001f, prev_pow ); + curr_pow = max( 0.00001f, curr_pow ); + } +#endif + if ( voice_factors[0] > 0.75f ) { curr_pow = (float) ( curr_pow * 0.25 );