Commit 2c60a620 authored by reutelhuber's avatar reutelhuber
Browse files

fix bug where wrong number of bands is used in ITD estimator function...

fix bug where wrong number of bands is used in ITD estimator function calc_mean_E_ratio() if bandwidth is limited on commandline
parent e613a765
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+3 −1
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@

#define LBR_SBA_CORE_CODING_TUNING                      /* Contribution "3 Core Coder Tuning for low bitrate SBA with 2 TCs" */

#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*/

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+4 −0
Original line number Diff line number Diff line
@@ -467,7 +467,11 @@ 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++ )