From 29c4311433714eb5363a28f109f0d2ad22300249 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Thu, 11 Sep 2025 17:59:10 +0200 Subject: [PATCH 1/2] fix for dtx discontinuities. More discontinuities caused from frame loss remain --- lib_com/options.h | 1 + lib_dec/core_switching_dec_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 9765329e5..7b5129300 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -96,6 +96,7 @@ #define FIX_ISSUE_2004_LPC_SHB_SAT /* Dolby: Issue 2004: prevent saturation of the LPC SHB filter */ #define FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC /* FhG: Corrected the q_input in the input of generate_masking_noise_dirac_ivas_fx() */ +#define FIX_ISSUE_2013_MDCT_STEREO_DTX_DISCONTINUITIES /* Eri/FhG: Issue 2013 fix for dtx discontinuities */ /* #################### Start BASOP porting switches ############################ */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index f7e992add..3d7789be1 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1637,7 +1637,11 @@ ivas_error core_switching_post_dec_ivas_fx( } Scale_sig( synth, output_frame, sub( Qtmp, *Qsynth ) ); /* Qtmp */ +#ifndef FIX_ISSUE_2013_MDCT_STEREO_DTX_DISCONTINUITIES Scale_sig( st_fx->delay_buf_out_fx, delay_comp, Qtmp ); /*delay buff_out_fx is Q0*/ +#else + Scale_sig( st_fx->delay_buf_out_fx, delay_comp, sub( Qtmp, hHQ_core->Q_old_postdec ) ); /*delay buff_out_fx is Qtmp*/ +#endif IF( hHQ_core != NULL ) { Scale_sig( hHQ_core->old_out_fx, L_FRAME48k, sub( Qtmp, hHQ_core->Q_old_wtda ) ); /* Qtmp */ -- GitLab From 86aec3c8186e34076dc443013a9875c16d65361b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 11 Sep 2025 20:15:13 +0200 Subject: [PATCH 2/2] avoid accessing NULL handle --- lib_dec/core_switching_dec_fx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 3d7789be1..4d5dbf83a 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1630,17 +1630,25 @@ ivas_error core_switching_post_dec_ivas_fx( test(); IF( EQ_16( st_fx->last_core, HQ_CORE ) || st_fx->last_core == TCX_20_CORE || st_fx->last_core == TCX_10_CORE ) /* MDCT to ACELP transition */ { +#ifdef FIX_ISSUE_2013_MDCT_STEREO_DTX_DISCONTINUITIES + Word16 Q_old_postdec = 0; + move16(); +#endif Qtmp = s_min( *Qsynth, 0 ); IF( hHQ_core != NULL ) { Qtmp = s_min( s_min( *Qsynth, hHQ_core->Q_old_postdec ), hHQ_core->Q_old_wtda ); +#ifdef FIX_ISSUE_2013_MDCT_STEREO_DTX_DISCONTINUITIES + Q_old_postdec = hHQ_core->Q_old_postdec; + move16(); +#endif } Scale_sig( synth, output_frame, sub( Qtmp, *Qsynth ) ); /* Qtmp */ #ifndef FIX_ISSUE_2013_MDCT_STEREO_DTX_DISCONTINUITIES Scale_sig( st_fx->delay_buf_out_fx, delay_comp, Qtmp ); /*delay buff_out_fx is Q0*/ #else - Scale_sig( st_fx->delay_buf_out_fx, delay_comp, sub( Qtmp, hHQ_core->Q_old_postdec ) ); /*delay buff_out_fx is Qtmp*/ + Scale_sig( st_fx->delay_buf_out_fx, delay_comp, sub( Qtmp, Q_old_postdec ) ); /* delay buff_out_fx is Qtmp */ #endif IF( hHQ_core != NULL ) { -- GitLab