diff --git a/lib_com/options.h b/lib_com/options.h index 5813f5f372d6c9105693b1a9bc3f3cce568a36a0..4db69235caef2f9cb91878a659b6ffa8b4de955f 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 4ee9187e7b0f2ed7b90bfa33f590f08f92338554..85583cffd5e7e6200c5081235f182014adbf8a60 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 ) ); }