Commit 53de6f38 authored by multrus's avatar multrus
Browse files

BASOP issue 2561: fix diffs in stereo_dft_enc_compute_itd() between float and BASOP

parent 8ff889f8
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -139,6 +139,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 ########################### */

+9 −0
Original line number Diff line number Diff line
@@ -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];