From bd299063195d7a359e0156d5791c2d81e3a09f54 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 7 Dec 2022 09:57:29 +0100 Subject: [PATCH 1/2] move part of FIX_124 to IMDCT to avoid rate sw problem --- lib_dec/dec_tcx.c | 7 +++++++ lib_dec/ivas_core_dec.c | 13 ++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index 5b74ca0f6f..afd10ad0ce 100755 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -334,6 +334,13 @@ void IMDCT( /* number of zero for ALDO windows*/ nz = NS2SA( st->output_Fs, N_ZERO_MDCT_NS ) * L_frame / L_frameTCX; +#ifdef FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS + if ( frame_cnt == 0 && !bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && !hTcxCfg->last_aldo ) + { + v_multc(old_syn_overl, hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, old_syn_overl, overlap); + } +#endif + if ( ( L_frameTCX == hTcxDec->L_frameTCX >> 1 || st->mct_chan_mode == MCT_CHAN_MODE_LFE ) && ( st->tcxonly ) ) { /* Mode decision in PLC diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 1d98e39e2b..e014555c06 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -188,17 +188,8 @@ ivas_error ivas_core_dec( if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL && hMCT == NULL ) #endif { - float gain; - - gain = st->hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph; - 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 ) - { - 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, st->hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, st->hHQ_core->old_out, st->hTcxDec->L_frameTCX ); + v_multc( st->hHQ_core->old_outLB, st->hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, st->hHQ_core->old_outLB, st->L_frame ); } #else /* PLC: [TCX: Fade-out-recovery] - overlapping part needs to be attenuated for first good frame */ -- GitLab From 4cd9fe479aa4b152e51a398fa36c7fce2080b60f Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 7 Dec 2022 13:46:14 +0100 Subject: [PATCH 2/2] apply formatter --- lib_dec/dec_tcx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 lib_dec/dec_tcx.c diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c old mode 100755 new mode 100644 index 67c2c280f2..07d676002c --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -337,7 +337,7 @@ void IMDCT( #ifdef FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS if ( frame_cnt == 0 && !bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && !hTcxCfg->last_aldo ) { - v_multc(old_syn_overl, hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, old_syn_overl, overlap); + v_multc( old_syn_overl, hTcxDec->conceal_eof_gain * st->last_concealed_gain_syn_deemph, old_syn_overl, overlap ); } #endif -- GitLab