diff --git a/lib_com/options.h b/lib_com/options.h index e1bc66274dacf8eb163ac4403300260dd75064d0..69cfbb4df43a71adb05ce347801c5e67c546d061 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -195,6 +195,7 @@ #define NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX /* Ericsson: Issue 1246: High level input which triggers DTX can lead to numerical overflow in coherence calculation */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_1113_EXTREND_ISAR /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */ +#define FIX_1166_TDREND_DIV0 /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */ #define NONBE_1203_MDCT2DFT_SWITCHING /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */ #define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 2f49c9319ff6e97d7b5f2b6f71be46cfb82def6e..3bc5c52f61bb20844972163799f23aab4d7f45f6 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -218,8 +218,13 @@ static void GenerateFilter( ESynL += modelEval->BMEnergiesL[modelEval->UseIndsL[i]].val; ESynR += modelEval->BMEnergiesR[modelEval->UseIndsR[i]].val; } +#ifdef FIX_1166_TDREND_DIV0 + ScaleL = sqrtf( ETotL / ( ESynL + EPSILON ) ); + ScaleR = sqrtf( ETotR / ( ESynR + EPSILON ) ); +#else ScaleL = sqrtf( ETotL / ESynL ); ScaleR = sqrtf( ETotR / ESynR ); +#endif /* Build using only the most energetic components. */ for ( k = model->iSecFirst[iSec]; k <= model->iSecLast[iSec]; k++ )