diff --git a/lib_com/options.h b/lib_com/options.h old mode 100755 new mode 100644 index ff06f7b58aa8ae9247f6950baadedb69d6b0836c..964bcd18b4afb7544d18b7c7790566b42fdb9ed1 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,6 +158,7 @@ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ #define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ +#define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index 135e856a990dee3f7efa2aae09c465498791ed4a..9fab9da4387e73525ba716365cd318da73135165 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -2738,6 +2738,12 @@ void fb_tbe_enc( hBWE_TD->prev_fb_energy = sum2_f( input_fhb + L_FRAME48k / 2, L_FRAME48k / 2 ); fb_exc_energy = sum2_f( fb_exc, L_FRAME16k ) + EPSILON; ratio = (float) sqrt( temp2 / fb_exc_energy ); +#ifdef FIX_971_LOG2_IDX_GAIN_0 + if ( ratio < 1.0f ) + { + ratio = 1.0f; + } +#endif idxGain = (int16_t) ( log2_f( (float) ratio ) + 0.5f ); idxGain = max( 0, min( 15, idxGain ) ); ratio = (float) ( 1 << idxGain );