Commit 7fd05ea4 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_WRONG_NBANDS_IN_ITD_ESTIMATION

parent d967323c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@



#define FIX_WRONG_NBANDS_IN_ITD_ESTIMATION              /* Issue 85: fix incorrect setting of nbands in calc_mean_E_ratio() if bwidth is limited on commandline*/
#define FIX_ADAP_STEFI_SHIFT                            /* Issue 89: fix bug in parameter shift of adaptive stereo filling */


+0 −15
Original line number Diff line number Diff line
@@ -446,9 +446,6 @@ static float calc_mean_E_ratio(
    ITD_DATA_HANDLE hItd,
    int16_t nbands,
    int16_t band_limits[],
#ifndef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
    const int16_t NFFT,
#endif
    const float sfm,
    const float nrg_L[STEREO_DFT_N_32k_ENC / 2],
    const float nrg_R[STEREO_DFT_N_32k_ENC / 2],
@@ -469,11 +466,7 @@ static float calc_mean_E_ratio(
    grand_sum_xcorr_img = 0.0f;

    /*take bands up to 32kHz bandwidth as ITD is always calculated at 32kHz sampling rate*/
#ifdef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
    nbands -= ( band_limits[nbands] > STEREO_DFT_N_32k_ENC / 2 );
#else
    nbands -= ( NFFT > STEREO_DFT_N_32k_ENC );
#endif

    sum_Er = 0;
    for ( b = 0; b < nbands; b++ )
@@ -1244,11 +1237,7 @@ void stereo_dft_enc_compute_itd(
    /*calculate mean E ratio of main to background signal for cohSNR*/
    if ( hCPE->element_mode == IVAS_CPE_DFT )
    {
#ifdef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
        mEr = calc_mean_E_ratio( hItd, hStereoDft->nbands, hStereoDft->band_limits, sfm_L, pNrgL, pNrgR, &total_mEr );
#else
        mEr = calc_mean_E_ratio( hItd, hStereoDft->nbands, hStereoDft->band_limits, hStereoDft->NFFT, sfm_L, pNrgL, pNrgR, &total_mEr );
#endif
    }
    else
    {
@@ -1257,11 +1246,7 @@ void stereo_dft_enc_compute_itd(

        set_s( band_limits, 0, STEREO_DFT_BAND_MAX + 1 );
        set_band_limits( &nbands, band_limits, hCPE->hStereoMdct->hDft_ana->NFFT );
#ifdef FIX_WRONG_NBANDS_IN_ITD_ESTIMATION
        mEr = calc_mean_E_ratio( hItd, nbands, band_limits, sfm_L, pNrgL, pNrgR, &total_mEr );
#else
        mEr = calc_mean_E_ratio( hItd, nbands, band_limits, hCPE->hStereoMdct->hDft_ana->NFFT, sfm_L, pNrgL, pNrgR, &total_mEr );
#endif
    }

    /*calculate total cohSNR for frame in dB*/