diff --git a/lib_com/options.h b/lib_com/options.h index c4646a49ca165983802fcc4608dc4353f595d28b..a72b234fcbbe23021e797e5df5ef954411586987 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -137,6 +137,7 @@ #define FIX_1053_REVERB_RECONFIGURATION #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_fx.c b/lib_rend/ivas_objectRenderer_hrFilt_fx.c index b975d83b9b2c42f4092a2d5801544f8ad6346f63..f5dbaea7350343b1967a31f3515a61a17a01ecc1 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt_fx.c +++ b/lib_rend/ivas_objectRenderer_hrFilt_fx.c @@ -330,11 +330,17 @@ static void GenerateFilter_fx( ESynL_e = sub( ESynL_e, 32 ); ESynL = W_shl_sat_l( temp1, ESynL_e ); ESynL_e = sub( BMEnergiesL_e, ESynL_e ); +#ifdef FIX_1166_TDREND_DIV0 + ESynL = BASOP_Util_Add_Mant32Exp( ESynL, ESynL_e, EPSILON_FX_M, EPSILON_FX_E, &ESynL_e ); +#endif ESynR_e = W_norm( temp2 ); ESynR_e = sub( ESynR_e, 32 ); ESynR = W_shl_sat_l( temp2, ESynR_e ); ESynR_e = sub( BMEnergiesR_e, ESynR_e ); +#ifdef FIX_1166_TDREND_DIV0 + ESynR = BASOP_Util_Add_Mant32Exp( ESynR, ESynR_e, EPSILON_FX_M, EPSILON_FX_E, &ESynR_e ); +#endif tmp32 = L_deposit_h( BASOP_Util_Divide3232_Scale( ETotL, ESynL, &ScaleL_e ) );