Loading lib_dec/init_dec.c +0 −6 Original line number Diff line number Diff line Loading @@ -613,14 +613,8 @@ ivas_error init_decoder( } /* TCX config. data structure */ #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" ) ); Loading lib_dec/ivas_cpe_dec.c +8 −0 Original line number Diff line number Diff line Loading @@ -850,6 +850,14 @@ void destroy_cpe_dec( int16_t n; Decoder_State *st; #ifdef MC_BITRATE_SWITCHING /* make sure we deallocate a potential distinct hTcxCfg for a MCT LFE channel (can only happen in rs) */ if ( hCPE->hCoreCoder[1]->mct_chan_mode == MCT_CHAN_MODE_LFE && hCPE->hCoreCoder[1]->hTcxCfg != hCPE->hCoreCoder[0]->hTcxCfg ) { hCPE->hCoreCoder[1]->mct_chan_mode = MCT_CHAN_MODE_IGNORE; } #endif for ( n = 0; n < CPE_CHANNELS; n++ ) { st = hCPE->hCoreCoder[n]; Loading lib_dec/ivas_dec.c +7 −4 Original line number Diff line number Diff line Loading @@ -354,10 +354,13 @@ ivas_error ivas_dec( /* LFE channel decoder */ if ( st_ivas->mc_mode == MC_MODE_MCT ) { #ifndef MC_BITRATE_SWITCHING /* bay: this really killed the MC bitrate switching and took me one day to find it, at least a comment here why the messing with this pointers happens would have been nice */ #ifdef MC_BITRATE_SWITCHING if ( st_ivas->hCPE[1]->hCoreCoder[1]->hTcxCfg == NULL ) { #endif st_ivas->hCPE[1]->hCoreCoder[1]->hTcxCfg = st_ivas->hCPE[1]->hCoreCoder[0]->hTcxCfg; #ifdef MC_BITRATE_SWITCHING } #endif ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); } Loading lib_dec/ivas_init_dec.c +1 −5 Original line number Diff line number Diff line Loading @@ -1422,11 +1422,7 @@ void destroy_core_dec( hCoreCoder->hTcxDec = NULL; } if ( hCoreCoder->hTcxCfg != NULL #ifndef MC_BITRATE_SWITCHING && hCoreCoder->mct_chan_mode != MCT_CHAN_MODE_LFE #endif ) if ( hCoreCoder->hTcxCfg != NULL && hCoreCoder->mct_chan_mode != MCT_CHAN_MODE_LFE ) { count_free( hCoreCoder->hTcxCfg ); hCoreCoder->hTcxCfg = NULL; Loading lib_dec/ivas_mct_dec.c +9 −0 Original line number Diff line number Diff line Loading @@ -894,6 +894,15 @@ static ivas_error ivas_mc_dec_reconfig( HQ_core_dec_init( st->hHQ_core ); } /* check if we have a doubly used hTxcCfg, if so, allocate a distint one for the old MCT LFE channel */ if ( st->hTcxCfg == st_ivas->hCPE[1]->hCoreCoder[0]->hTcxCfg ) { 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" ) ); } } st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st_ivas->hDecoderConfig->ivas_total_brate, st->igf, st->element_mode, st->mct_chan_mode ); } else if ( last_mc_mode == MC_MODE_PARAMMC && st_ivas->mc_mode == MC_MODE_MCT && nchan_transport_old > 2 ) Loading Loading
lib_dec/init_dec.c +0 −6 Original line number Diff line number Diff line Loading @@ -613,14 +613,8 @@ ivas_error init_decoder( } /* TCX config. data structure */ #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" ) ); Loading
lib_dec/ivas_cpe_dec.c +8 −0 Original line number Diff line number Diff line Loading @@ -850,6 +850,14 @@ void destroy_cpe_dec( int16_t n; Decoder_State *st; #ifdef MC_BITRATE_SWITCHING /* make sure we deallocate a potential distinct hTcxCfg for a MCT LFE channel (can only happen in rs) */ if ( hCPE->hCoreCoder[1]->mct_chan_mode == MCT_CHAN_MODE_LFE && hCPE->hCoreCoder[1]->hTcxCfg != hCPE->hCoreCoder[0]->hTcxCfg ) { hCPE->hCoreCoder[1]->mct_chan_mode = MCT_CHAN_MODE_IGNORE; } #endif for ( n = 0; n < CPE_CHANNELS; n++ ) { st = hCPE->hCoreCoder[n]; Loading
lib_dec/ivas_dec.c +7 −4 Original line number Diff line number Diff line Loading @@ -354,10 +354,13 @@ ivas_error ivas_dec( /* LFE channel decoder */ if ( st_ivas->mc_mode == MC_MODE_MCT ) { #ifndef MC_BITRATE_SWITCHING /* bay: this really killed the MC bitrate switching and took me one day to find it, at least a comment here why the messing with this pointers happens would have been nice */ #ifdef MC_BITRATE_SWITCHING if ( st_ivas->hCPE[1]->hCoreCoder[1]->hTcxCfg == NULL ) { #endif st_ivas->hCPE[1]->hCoreCoder[1]->hTcxCfg = st_ivas->hCPE[1]->hCoreCoder[0]->hTcxCfg; #ifdef MC_BITRATE_SWITCHING } #endif ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); } Loading
lib_dec/ivas_init_dec.c +1 −5 Original line number Diff line number Diff line Loading @@ -1422,11 +1422,7 @@ void destroy_core_dec( hCoreCoder->hTcxDec = NULL; } if ( hCoreCoder->hTcxCfg != NULL #ifndef MC_BITRATE_SWITCHING && hCoreCoder->mct_chan_mode != MCT_CHAN_MODE_LFE #endif ) if ( hCoreCoder->hTcxCfg != NULL && hCoreCoder->mct_chan_mode != MCT_CHAN_MODE_LFE ) { count_free( hCoreCoder->hTcxCfg ); hCoreCoder->hTcxCfg = NULL; Loading
lib_dec/ivas_mct_dec.c +9 −0 Original line number Diff line number Diff line Loading @@ -894,6 +894,15 @@ static ivas_error ivas_mc_dec_reconfig( HQ_core_dec_init( st->hHQ_core ); } /* check if we have a doubly used hTxcCfg, if so, allocate a distint one for the old MCT LFE channel */ if ( st->hTcxCfg == st_ivas->hCPE[1]->hCoreCoder[0]->hTcxCfg ) { 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" ) ); } } st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st_ivas->hDecoderConfig->ivas_total_brate, st->igf, st->element_mode, st->mct_chan_mode ); } else if ( last_mc_mode == MC_MODE_PARAMMC && st_ivas->mc_mode == MC_MODE_MCT && nchan_transport_old > 2 ) Loading