From 49545061124d23fe13a9f3cde86b801d9fa3d9df Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 19 Aug 2025 20:32:03 +0200 Subject: [PATCH] port float R 2214 to ivas-float-update --- lib_com/options.h | 1 + lib_dec/hq_lr_dec.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 5813f5f37..4db69235c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -204,6 +204,7 @@ #define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ #define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ +#define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/hq_lr_dec.c b/lib_dec/hq_lr_dec.c index 4ee9187e7..85583cffd 100644 --- a/lib_dec/hq_lr_dec.c +++ b/lib_dec/hq_lr_dec.c @@ -260,7 +260,15 @@ void hq_lr_dec( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); +#ifdef FIX_1348_OVERFLOW +#ifdef BASOP_NOGLOB + Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ +#else + Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ +#endif +#else Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ +#endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); } -- GitLab