Commit 5dae3704 authored by bayers's avatar bayers
Browse files

address VE comment in init_dec.c, only allocate additional TcxCfg for the LFE...

address VE comment in init_dec.c, only allocate additional TcxCfg for the LFE channel in MCT, and not for the second channel in DFT/TD stereo
parent dc15b13a
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -613,22 +613,23 @@ ivas_error init_decoder(
    }

    /* TCX config. data structure */
#ifndef MC_BITRATE_SWITCHING // !!! VE: this does not seem to be correct for DFT/TD stereo; also why the MCT_CHAN_MODE_LFE channel is now included?
    /* for correct bit rate switching in MC we at least need the TcxCfg */
#ifdef MC_BITRATE_SWITCHING 
    /* for correct bit rate switching in MC we at least need the TcxCfg for the LFE channel in MCT */
    if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) )
#else
    if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE )
    {
#endif
    {

        if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) count_malloc( sizeof( TCX_config ) ) ) == NULL )
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxCfg\n" ) );
        }
#ifndef MC_BITRATE_SWITCHING
    }
    else
    {
        st->hTcxCfg = NULL;
    }
#endif

    /* Tonal MDCT concealment data structure */
    if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE )