diff --git a/lib_com/options.h b/lib_com/options.h index 9765329e56ad40a1bfa16352294d7a7878e48c36..7b51293004d6beb400195755d86382c86eb864e4 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 f7e992add4e05280b5872fd53b0a87765df4b537..4d5dbf83a4a361f055d27c2041ecbd408b4f5ba3 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1630,14 +1630,26 @@ 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, 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 */