Commit 823cb4db authored by fotopoulou's avatar fotopoulou
Browse files

Improvement for DFT Stereo for cases with large ITDs under HYBRID_ITD_MAX

parent 4f09f8bc
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1401,6 +1401,10 @@ int16_t read_BS_adapt_GR_sg(
void stereo_dft_hybrid_ITD_flag(
    STEREO_DFT_CONFIG_DATA_HANDLE hConfig,                      /* o  : DFT stereo configuration                */
    const int32_t input_Fs                                      /* i  : CPE element sampling rate               */
#ifdef HYBRID_ITD_MAX
    ,
    const int16_t hybrid_itd_max                                /* i  : flag for hybrid ITD for very large ITDs */
#endif
);

void stereo_dft_enc_compute_itd(
+2 −0
Original line number Diff line number Diff line
@@ -211,6 +211,8 @@
//#define HODIRAC_READ_PARAMS
#endif

#define HYBRID_ITD_MAX                                 /* FhG: Improvement for DFT-stereo for cases with large ITDs */

 /* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+6 −1
Original line number Diff line number Diff line
@@ -333,7 +333,12 @@ ivas_error ivas_cpe_enc(

    if ( hCPE->element_mode == IVAS_CPE_DFT )
    {
        stereo_dft_hybrid_ITD_flag( hCPE->hStereoDft->hConfig, input_Fs );
        stereo_dft_hybrid_ITD_flag( hCPE->hStereoDft->hConfig, input_Fs
#ifdef HYBRID_ITD_MAX
                                    ,
                                    hCPE->hStereoDft->hItd->hybrid_itd_max
#endif
        );

        /* Time Domain ITD compensation using extrapolation */
#ifdef DEBUG_MODE_DFT
+4 −0
Original line number Diff line number Diff line
@@ -81,6 +81,10 @@ typedef struct stereo_itd_data_struct
    int16_t prev_itd1;
    int16_t prev_itd2;

#ifdef HYBRID_ITD_MAX
    /*flag for hybrid ITD for very large ITDs*/
    int16_t hybrid_itd_max;
#endif
} ITD_DATA, *ITD_DATA_HANDLE;

typedef struct dft_ana_struct
+7 −1
Original line number Diff line number Diff line
@@ -998,7 +998,13 @@ void xtalk_classifier_dft(
        printf( "\nSwitch DFT-stereo -> TD-LR on frame %d\n", frame );
#endif
    }
    else if ( hCPE->element_brate >= IVAS_16k4 && hStereoClassif->xtalk_decision == 0 && abs( itd ) > STEREO_DFT_ITD_MAX && ( hCPE->hCoreCoder[0]->lp_speech - hCPE->hCoreCoder[0]->lp_noise ) > 25.0f )
    else if (
#ifdef HYBRID_ITD_MAX
        hCPE->element_brate > IVAS_16k4
#else
        hCPE->element_brate >= IVAS_16k4
#endif
        && hStereoClassif->xtalk_decision == 0 && abs( itd ) > STEREO_DFT_ITD_MAX && ( hCPE->hCoreCoder[0]->lp_speech - hCPE->hCoreCoder[0]->lp_noise ) > 25.0f )
    {
        hStereoClassif->xtalk_decision = 1;
    }
Loading