diff --git a/lib_com/options.h b/lib_com/options.h index 929ae2b05d72c8b69d4afd8116cb90f16d6346ae..4a5a53c9875ce1551eab189919b257c3f28c64e9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ +#define FIX_1831_REVERB_REGRESSION /* Philips: fixes reverb regression issues */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index b4b9f7d1ef02a7c2cbea89c3043d5a77ec49a6e8..5156911f327f550c558d1169dad100ffb7afde06 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -2426,6 +2426,10 @@ ivas_error ivas_binaural_reverb_init( Word32 t60[CLDFB_NO_CHANNELS_MAX]; Word32 ene[CLDFB_NO_CHANNELS_MAX]; Word16 preDelay; +#ifdef FIX_1831_REVERB_REGRESSION + Word16 temp16, s; + Word32 temp32; +#endif error = IVAS_ERR_OK; @@ -2442,7 +2446,14 @@ ivas_error ivas_binaural_reverb_init( return error; } +#ifdef FIX_1831_REVERB_REGRESSION + temp16 = BASOP_Util_Divide3216_Scale( 48000, CLDFB_NO_CHANNELS_MAX, &s ); + temp16 = shl( temp16, s ); // Q0 + temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, temp16 ); // Q11 + preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0 +#else preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); +#endif #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT floatToFixed_arrL( t60_temp, t60, Q26, CLDFB_NO_CHANNELS_MAX ); #else