Commit d9890418 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_MDCT_AND_MC_MONO_ISSUES

parent 696f7dc6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@
#define BRATE_SWITCHING_RENDERING                       /* Bitrate switching changes related to the renderers */
#define FIX_150                                         /* Issue 150: Crash in EVS mono, HQ_HARMONIC mode, related to BASOP_NOGLOB */
#define FIX_VBR_COMPLEXITY                              /* Issue 234: fix extremely high complexity numbers for IVAS EVS mode */
#define FIX_MDCT_AND_MC_MONO_ISSUES                     /* Issue 242: Fix some issues with TCX-LTP and delay alignement for mono output */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+0 −12
Original line number Diff line number Diff line
@@ -444,12 +444,6 @@ ivas_error ivas_cpe_dec(
            }
        }
    }
#ifndef FIX_MDCT_AND_MC_MONO_ISSUES
    else if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) )
    {
        applyDmxMdctStereo( hCPE, output, output_frame );
    }
#endif

    /*----------------------------------------------------------------*
     * Update parameters for stereo CNA
@@ -463,12 +457,10 @@ ivas_error ivas_cpe_dec(

    synchro_synthesis( ivas_total_brate, hCPE, output, output_frame, 0 );

#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
    if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->nchan_out == 1 && ( is_DTXrate( ivas_total_brate ) == 0 || ( is_DTXrate( ivas_total_brate ) == 1 && is_DTXrate( st_ivas->hDecoderConfig->last_ivas_total_brate ) == 0 ) ) )
    {
        applyDmxMdctStereo( hCPE, output, output_frame );
    }
#endif

#ifndef DEBUG_STEREO_DFT_OUTRESPRED
    /*----------------------------------------------------------------*
@@ -590,11 +582,7 @@ ivas_error create_cpe_dec(
    hCPE->lt_es_em = 0.0f;

    /* Note: nchan_out is considered to be related to the structure. This is nchan_out for CPE and for MASA_format is always 2. */
#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
    if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MC_FORMAT )
#else
    if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) )
#endif
    {
        hCPE->nchan_out = CPE_CHANNELS;
    }
+0 −4
Original line number Diff line number Diff line
@@ -655,11 +655,7 @@ void applyDmxMdctStereo(
        fade = 0.f;
        dmx_len = crossfade_len;
    }
#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
    else if ( hCPE->last_element_mode == IVAS_CPE_DFT && hCPE->last_element_brate <= IVAS_32k )
#else
    else if ( hCPE->last_element_mode == IVAS_CPE_DFT && hCPE->last_element_brate <= IVAS_24k4 )
#endif
    {
        crossfade_len = NS2SA( hCPE->hCoreCoder[0]->output_Fs, DELAY_CLDFB_NS );
        step /= crossfade_len;
+0 −18
Original line number Diff line number Diff line
@@ -716,7 +716,6 @@ ivas_error stereo_memory_dec(

            if ( hCPE->last_element_mode == IVAS_CPE_DFT )
            {
#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
                if ( hCPE->nchan_out == 1 )
                {
                    cpy_tcx_ltp_data( hCPE->hCoreCoder[0]->hTcxLtpDec, hCPE->hCoreCoder[1]->hTcxLtpDec, output_Fs );
@@ -725,9 +724,6 @@ ivas_error stereo_memory_dec(
                {
                    cpy_tcx_ltp_data( &tcxLtpTmp, hCPE->hCoreCoder[1]->hTcxLtpDec, output_Fs );
                }
#else
                cpy_tcx_ltp_data( &tcxLtpTmp, hCPE->hCoreCoder[1]->hTcxLtpDec, output_Fs );
#endif
            }

            if ( hCPE->last_element_mode == IVAS_CPE_TD )
@@ -986,9 +982,7 @@ void synchro_synthesis(
    int16_t dft_mono_brate_switch;
    int16_t delay_diff;
    float tmpF;
#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
    int16_t nChannels;
#endif

    sts = hCPE->hCoreCoder;
    output_Fs = sts[0]->output_Fs;
@@ -1058,13 +1052,11 @@ void synchro_synthesis(
            }
        }

#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
        if ( hCPE->nchan_out == 1 && hCPE->last_element_mode == IVAS_CPE_MDCT )
        {
            v_add( sts[0]->prev_synth_buffer, sts[1]->prev_synth_buffer, sts[0]->prev_synth_buffer, delay_comp_DFT );
            v_multc( sts[0]->prev_synth_buffer, INV_SQRT_2, sts[0]->prev_synth_buffer, delay_comp_DFT );
        }
#endif

        if ( use_cldfb_for_last_dft )
        {
@@ -1161,7 +1153,6 @@ void synchro_synthesis(
            }
        }

#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
        /* if previous frame had only one channel copy buffers to other channel */
        if ( hCPE->nchan_out == 1 && hCPE->element_mode == IVAS_CPE_MDCT && hCPE->last_element_mode == IVAS_CPE_DFT )
        {
@@ -1169,7 +1160,6 @@ void synchro_synthesis(
            mvr2r( tmp_out[0], tmp_out[1], delay_cldfb );
            mvr2r( p_output_mem[0], p_output_mem[1], delay_diff );
        }
#endif

        /*----------------------------------------------------------------*
         * update DFT synthesis overlap memory @output_Fs; needed for TD->DFT stereo switching
@@ -1254,12 +1244,8 @@ void synchro_synthesis(
            }
        }

#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
        nChannels = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? 2 : hCPE->nchan_out;
        for ( n = 0; n < nChannels; n++ )
#else
        for ( n = 0; n < hCPE->nchan_out; n++ )
#endif
        {
            if ( hCPE->element_mode == IVAS_CPE_MDCT )
            {
@@ -1292,11 +1278,7 @@ void synchro_synthesis(
            }

            /* cross-fading between DFT OLA memory and TD output */
#ifdef FIX_MDCT_AND_MC_MONO_ISSUES
            for ( n = 0; n < nChannels; n++ )
#else
            for ( n = 0; n < hCPE->nchan_out; n++ )
#endif
            {
                if ( hCPE->element_mode == IVAS_CPE_MDCT )
                {