diff --git a/lib_com/options.h b/lib_com/options.h index 5390fd919b424d1cbb634d663986f69f38f87b69..3954eca5afb7453ba2b7f7de1b2342d7c079b125 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -132,6 +132,7 @@ #define FIX_FLOAT_1578_OMASA_REND_SPIKES /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */ #define FIX_1521_SBA_LOUDNESS_STEREO /* FhG: issue 1521: Fix loudness for SBA to stereo rendering */ #define FIX_1559 /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */ +#define FIX_NONBE_2579_INCORRECT_LAG_CALCULATION /* Dolby: fix 2579: Incorrect lag calculation */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index 234652072aafb5da36bdc5e843e522bd6928ad00..a5778846f1a864de266c1b2e92f168b051fb4564 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -2314,7 +2314,11 @@ static void unclr_calc_corr_features_fx( move32(); /* L/R correlation values (zero lag, maximum) */ +#ifndef FIX_NONBE_2579_INCORRECT_LAG_CALCULATION corrLagMax = maximum_l( corrEst, sub( lagSearchRange[1], add( lagSearchRange[0], 1 ) ), &corrEstMax ); +#else + corrLagMax = maximum_l( corrEst, add( sub( lagSearchRange[1], lagSearchRange[0] ), 1 ), &corrEstMax ); +#endif d_corrLagMax = sub( corrLagMax, hStereoClassif->unclr_corrLagMax_prev ); hStereoClassif->unclr_fv_fx[E_d_corrLagMax] = L_shl( d_corrLagMax, 15 );