diff --git a/lib_com/options.h b/lib_com/options.h index cc0544fbbc2f844205909e5d6ce05c60298ea0d0..aabe2a67b5f30470adeae49ed9d3a04de6e527ad 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -142,6 +142,8 @@ #define FIX_BASOP_2548_ProcessIGF_fx_PREDICTIONGAIN /* FhG: fixes obvious bug for IVAS path. For EVS path, issue is still not resolved */ #define FIX_FMSW_DEC /* float issue 1542: fix JBM issue in format switching */ #define FIX_FMSW_DEC_2 /* float issue 1575: fix crash for format switching when bitsream starts with EVS */ +#define FIX_BASOP_2561_STEREO_DFT_ENC_COMPUTE_ITD /* BASOP issue 2561: fix diffs in stereo_dft_enc_compute_itd() between float and BASOP */ + /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd_fx.c b/lib_enc/ivas_stereo_dft_enc_itd_fx.c index 485421e78548ff118131865df65b2ae4a922d070..850b40f612a6d420a32494e8dfda26cc5617a523 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_itd_fx.c @@ -1492,8 +1492,13 @@ void stereo_dft_enc_compute_itd_fx( L_temp2_e = sub( 31, q_temp ); L_temp = Mpy_32_32( L_temp, L_temp2 ); L_temp_e = add( L_temp_e, L_temp2_e ); +#ifdef FIX_BASOP_2561_STEREO_DFT_ENC_COMPUTE_ITD + sfm_R = BASOP_Util_Divide3232_Scale_newton( L_temp, sum_abs_R, &sfm_R_e ); + sfm_R_e = add( sfm_R_e, sub( L_temp_e, sum_abs_R_e ) ); +#else sfm_R = BASOP_Util_Divide3232_Scale_newton( L_temp, sum_abs_R, &sfm_L_e ); sfm_R_e = add( sfm_L_e, sub( L_temp_e, sum_abs_R_e ) ); +#endif // sfm_R = L_shl_r( sfm_R, sfm_R_e ); // Q31 sfm_R = L_shl_sat( sfm_R, sfm_R_e ); // Q31 } @@ -1686,7 +1691,11 @@ void stereo_dft_enc_compute_itd_fx( hStereoDft->currentNumUpdates = add( hStereoDft->currentNumUpdates, 1 ); move16(); +#ifdef FIX_BASOP_2561_STEREO_DFT_ENC_COMPUTE_ITD + FOR( i = 1; i < NFFT / 2; i++ ) +#else FOR( i = 1; i < NFFT / 4; i++ ) +#endif { /* Low pass filter cross L/R power spectrum */ // hStereoDft->xspec_smooth[2 * i] = ( 1.f - cng_xcorr_filt ) * hStereoDft->xspec_smooth[2 * i] + cng_xcorr_filt * xcorr[2 * i];