Commit 6f134ab7 authored by bayers's avatar bayers
Browse files

small fix for the MCT encoder common update fix

fix MCT->ParamMC switch, TNS flag in the decoder TCX cfg was not set correctly
parent 419faaf9
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -831,8 +831,7 @@ ivas_error ivas_mc_dec_reconfig(
    /* re-configure core coder*/
    /* special case: MCT->ParamMC with more than 2 TC, CPE 1 stays, but has the wrong mct_chan_mode in channel 1
       and might have IGF static memory not allocated and the bit stream index list not set,
       set correct mct_chan_mode and init missing static mem
       do it here since it is _very_ MC specific */
       set correct mct_chan_mode and init missing static mem (IGF, HQ)  and some config (TNS)  do it here since it is _very_ MC specific */
    if ( last_mc_mode == MC_MODE_MCT && st_ivas->mc_mode == MC_MODE_PARAMMC && st_ivas->nchan_transport > CPE_CHANNELS )
    {
        Decoder_State *st = st_ivas->hCPE[1]->hCoreCoder[1];
@@ -868,21 +867,8 @@ ivas_error ivas_mc_dec_reconfig(
            HQ_core_dec_init( st->hHQ_core );
        }

#if 0
        if ( st->element_mode == EVS_MONO )
        {
            /* HQ NB FEC initialization */
            if ( ( st->hHQ_nbfec = (HQ_NBFEC_HANDLE) count_malloc( sizeof( HQ_NBFEC_DATA ) ) ) == NULL )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ NB FEC\n" ) );
            }
            HQ_nbfec_init( st->hHQ_nbfec );
        }
        else
        {
            st->hHQ_nbfec = NULL;
        }
#endif
        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 )
    {
@@ -891,6 +877,7 @@ ivas_error ivas_mc_dec_reconfig(
#endif
        Decoder_State *st = st_ivas->hCPE[1]->hCoreCoder[1];
        st->mct_chan_mode = MCT_CHAN_MODE_LFE;
        st->hTcxCfg->fIsTNSAllowed = 0;
    }

    if ( st_ivas->mc_mode == MC_MODE_MCMASA )
@@ -919,7 +906,6 @@ ivas_error ivas_mc_dec_reconfig(
    {
        Decoder_State *st = st_ivas->hCPE[1]->hCoreCoder[1];

#if 1
        /* TCX-LTP */
        if ( st->hTcxLtpDec == NULL )
        {
@@ -929,7 +915,6 @@ ivas_error ivas_mc_dec_reconfig(
            }
            tcxltp_dec_init( st->hTcxLtpDec, 0, st->last_codec_mode, st->element_mode, st->pit_max, st->sr_core );
        }
#endif
    }

    /* re-configure hp20 memories */
+1 −1
Original line number Diff line number Diff line
@@ -410,9 +410,9 @@ ivas_error ivas_core_enc(
 *---------------------------------------------------------------------*/
#ifdef FIX_MC_BR_SW_MCT_UPDT_ENC_COMMON
        /* for MCT do this later, otherwise there can be a problem because TCX quant happens later and might get the wrong last_core on a bit rate switch */
        st->hNoiseEst->Etot_last = Etot[n];
        if ( !MCT_flag )
        {
            st->hNoiseEst->Etot_last = Etot[n];
            updt_enc_common( st );
        }
#else