Commit 32d0a3c0 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_221_BR_SWITCH_STEREO

parent 239778f4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@
#define SBA_BR_SWITCHING                                /* Issue 114: Changes for sba bit rate switching*/
#define FIX_ITD                                         /* Contribution 16: TD renderer ITD improvement and code cleanup */
#define BRATE_SWITCHING_RENDERING                       /* Bitrate switching changes related to the renderers */
#define FIX_221_BR_SWITCH_STEREO                        /* Issue 221: Fix missing initialization when switchin from TD to MDCT stereo*/
#define FIX_DTX_RANGE                                   /* Issue 118: fix the DTX usage: default DTX up to 64 kbps, otherwise only in silence */
#define FIX_ISM_METADATA_READER                         /* Issue 211: make ISM metadata file reader robust against invalid files */
#define FIX_GET_DELAY_RETURN                            /* Issue 223: change return data type in function get_delay() */
+0 −14
Original line number Diff line number Diff line
@@ -1469,24 +1469,12 @@ void stereo_switching_dec(
        {
            sts[1]->last_core = sts[0]->last_core;
            sts[1]->last_coder_type = sts[0]->last_coder_type;
#ifndef FIX_221_BR_SWITCH_STEREO
            sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo;
            sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode;
#endif

            mvr2r( sts[0]->hHQ_core->old_out, sts[1]->hHQ_core->old_out, L_FRAME48k );
            mvr2r( sts[0]->delay_buf_out, sts[1]->delay_buf_out, HQ_DELTA_MAX * HQ_DELAY_COMP );
            mvr2r( sts[0]->hTcxDec->old_syn_Overl, sts[1]->hTcxDec->old_syn_Overl, 256 );
            /* Todo: apply panning to buffers instead of simply using dmx in left and right channel */

#ifndef FIX_221_BR_SWITCH_STEREO
            sts[1]->fscale = sts[0]->fscale;
            sts[1]->hTcxCfg->tcx_mdct_window_length = sts[0]->hTcxCfg->tcx_mdct_window_length;
            sts[1]->pit_res_max = sts[0]->pit_res_max;
            sts[1]->pit_res_max_past = sts[0]->pit_res_max_past;
            sts[1]->hTcxDec->L_frameTCX = sts[0]->hTcxDec->L_frameTCX;
            sts[1]->hTcxDec->conceal_eof_gain = sts[0]->hTcxDec->conceal_eof_gain;
#endif
        }
    }
    else if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_MDCT )
@@ -1495,7 +1483,6 @@ void stereo_switching_dec(
        set_f( sts[1]->old_exc, 0.0f, L_EXC_MEM_DEC );
    }

#ifdef FIX_221_BR_SWITCH_STEREO
    /* TD/DFT -> MDCT stereo switching (there is no TCX in the TD stereo secondary channel, or DFT stereo) */
    if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->last_element_mode != IVAS_CPE_MDCT )
    {
@@ -1508,7 +1495,6 @@ void stereo_switching_dec(
        sts[1]->hTcxDec->L_frameTCX = sts[0]->hTcxDec->L_frameTCX;
        sts[1]->hTcxDec->conceal_eof_gain = sts[0]->hTcxDec->conceal_eof_gain;
    }
#endif

    return;
}
+0 −6
Original line number Diff line number Diff line
@@ -815,10 +815,6 @@ void stereo_switching_enc(
            sts[1]->last_core = sts[0]->last_core;
            sts[1]->last_coder_type = sts[0]->last_coder_type;
            sts[1]->last_bwidth = sts[0]->last_bwidth;
#ifndef FIX_221_BR_SWITCH_STEREO
            sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo;
            sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode;
#endif
        }
    }
    else if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_MDCT )
@@ -827,14 +823,12 @@ void stereo_switching_enc(
        set_f( sts[1]->hLPDmem->old_exc, 0.0f, L_EXC_MEM );
    }

#ifdef FIX_221_BR_SWITCH_STEREO
    /* TD/DFT -> MDCT stereo switching (there is no TCX in the TD stereo secondary channel, or DFT stereo) */
    if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->last_element_mode != IVAS_CPE_MDCT )
    {
        sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo;
        sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode;
    }
#endif

    return;
}