From 3b4931ac59d78f98dadf85b9100bf5507536df3f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 4 Oct 2025 16:45:27 +0200 Subject: [PATCH] port float MR1753 to ivas-float-update --- lib_com/options.h | 1 + lib_rend/ivas_objectRenderer_hrFilt.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 328d1aa08..25bb8b875 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -194,6 +194,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 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 2f49c9319..3bc5c52f6 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++ ) -- GitLab