diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 12274f87629538d63a3871323bf78ddc7bcecd1d..b3d5b60eca844a169c71bd2045398f05e9f6c0d7 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -201,33 +201,26 @@ ivas_error ivas_core_dec( } #else /* PLC: [TCX: Fade-out-recovery] - overlapping part needs to be attenuated for first good frame */ - if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && hMCT == NULL ) + if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) ) { float gain; - if ( st->hPlcInfo != NULL ) - { - gain = st->hPlcInfo->recovery_gain; - } - else if ( st->hTcxDec != NULL ) - { - gain = st->hTcxDec->conceal_eof_gain; - } - else - { - gain = 0.f; - assert( !"This should never happen." ); - } - v_multc( st->hHQ_core->old_out, gain, st->hHQ_core->old_out, st->hTcxDec->L_frameTCX ); - v_multc( st->hHQ_core->old_outLB, gain, st->hHQ_core->old_outLB, st->L_frame ); + gain = ( st->element_mode == IVAS_CPE_MDCT ) ? st->hTcxDec->conceal_eof_gain : + ( st->hPlcInfo != NULL ) ? st->hPlcInfo->recovery_gain : 0.0f; - if ( !st->hTcxCfg->last_aldo && st->hTcxDec != NULL ) + if ( ( st->element_mode == IVAS_CPE_MDCT && hMCT == NULL ) || ( st->hPlcInfo != NULL ) ) { - v_multc( st->hTcxDec->syn_OverlFB, gain, st->hTcxDec->syn_OverlFB, st->hTcxCfg->tcx_mdct_window_lengthFB ); - v_multc( st->hTcxDec->syn_Overl, gain, st->hTcxDec->syn_Overl, st->hTcxCfg->tcx_mdct_window_length ); + v_multc( st->hHQ_core->old_out, gain, st->hHQ_core->old_out, st->hTcxDec->L_frameTCX ); + v_multc( st->hHQ_core->old_outLB, gain, st->hHQ_core->old_outLB, st->L_frame ); + + if ( !st->hTcxCfg->last_aldo && st->hTcxDec != NULL ) + { + v_multc( st->hTcxDec->syn_OverlFB, gain, st->hTcxDec->syn_OverlFB, st->hTcxCfg->tcx_mdct_window_lengthFB ); + v_multc( st->hTcxDec->syn_Overl, gain, st->hTcxDec->syn_Overl, st->hTcxCfg->tcx_mdct_window_length ); + } } } -#endif +#endif set_f( voice_factors[n], 0.f, NB_SUBFR16k ); set_f( hb_synth[n], 0.0f, L_FRAME48k );