From a6cce468a79921dc5ab775740a98668aad82fdc4 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 24 Oct 2024 12:32:27 +0530 Subject: [PATCH] Fix for 3gpp issue 903 --- lib_com/options.h | 1 + lib_dec/ivas_mdct_core_dec.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 424110028..819f2a42f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,6 +135,7 @@ #define NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES /* FhG: issue 1133: skip de-whitening of bg noise shape after frameloss period if the first good frame is an SID */ #define NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID /* FhG: issue 1133: in TCX PLC, don't scale hHQ_core->old_out after applying fade to noise in burst frame error */ #define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL +#define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ /* ##################### End NON-BE switches ########################### */ #define FIX_740_HQ_CORE_OVA // Proposed fix to solve overlap and add issue for HQ_CORE diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 90cb85cc3..7201bad8c 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -1862,6 +1862,15 @@ void ivas_mdct_core_reconstruct( { set_f( &synth[k * L_frame[ch]], 0.f, L_frame[ch] ); set_f( &synthFB[k * L_frame[ch]], 0.f, L_frameTCX[ch] ); +#ifdef FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE + /* Note: these buffers are not subframe-based, hence no indexing with k */ + set_f( &st->hHQ_core->old_outLB[0], 0.f, L_frame[ch] ); + set_f( &st->hHQ_core->old_out[0], 0.f, L_frameTCX[ch] ); + set_f( &st->hTcxDec->syn_Overl[0], 0.f, L_frame[ch] / 2 ); + set_f( &st->hTcxDec->syn_OverlFB[0], 0.f, L_frameTCX[ch] / 2 ); + set_f( &st->hTcxDec->syn_Overl_TDAC[0], 0.f, L_frame[ch] / 2 ); + set_f( &st->hTcxDec->syn_Overl_TDACFB[0], 0.f, L_frameTCX[ch] / 2 ); +#endif } } @@ -2093,6 +2102,15 @@ void ivas_mdct_core_reconstruct_fx( { set16_fx( &synth_fx[k * L_frame[ch]], 0, L_frame[ch] ); set16_fx( &synthFB_fx[k * L_frame[ch]], 0, L_frameTCX[ch] ); +#ifdef FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE + /* Note: these buffers are not subframe-based, hence no indexing with k */ + set16_fx( &st->hHQ_core->old_out_LB_fx[0], 0, L_frame[ch] ); + set16_fx( &st->hHQ_core->old_out_fx[0], 0, L_frameTCX[ch] ); + set16_fx( &st->hTcxDec->syn_Overl[0], 0, shr( L_frame[ch], 1 ) ); + set16_fx( &st->hTcxDec->syn_OverlFB[0], 0, shr( L_frameTCX[ch], 1 ) ); + set16_fx( &st->hTcxDec->syn_Overl_TDAC[0], 0, shr( L_frame[ch], 1 ) ); + set16_fx( &st->hTcxDec->syn_Overl_TDACFB[0], 0, shr( L_frameTCX[ch], 1 ) ); +#endif } } -- GitLab