From 05a35532b48ad9e998043633d6eb918346542dc0 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Fri, 27 Jan 2023 08:55:55 +0100 Subject: [PATCH] [fix] for issue 309 - distortion in ISM, mem_preemph_enc was overwritten in ivas preprocessing for tcxonly modes --- lib_com/options.h | 1 + lib_enc/ivas_core_pre_proc.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1efe925fe0..57928ed19a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,6 +162,7 @@ #define SET_TNS_FLAG_IN_EVERY_FRAME /* FhG: issue 288 - mismatch between encoder and decoder wrt TNS usage in unified stereo with frameloss */ #define FIX_FOR_TEST /* allows tests to pass using old TD binary file, to be removed after merge*/ #define FIX_299_ISM_BWS /* VA: issue 299 - fix Band-width switching issues in ISM format */ +#define FIX_309_PREMPH_MEM_SCE /* FhG: issue 309 - fix overwriting of mem_preemph_enc in ivas preprocessing for SCE and tcxonly modes*/ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index 90d000cdf1..77b31fac12 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -659,7 +659,11 @@ ivas_error ivas_compute_core_buffers( * Perform fixed preemphasis (16kHz signal) through 1 - g*z^-1 *-----------------------------------------------------------------*/ - if ( !( ( element_mode == IVAS_CPE_TD && st->idchan == 1 ) || element_mode == IVAS_CPE_MDCT ) ) + if ( +#ifdef FIX_309_PREMPH_MEM_SCE + st->tcxonly == 0 && +#endif + !( ( element_mode == IVAS_CPE_TD && st->idchan == 1 ) || element_mode == IVAS_CPE_MDCT ) ) { st->mem_preemph_enc = new_inp_16k[L_frame_tmp - 1]; } -- GitLab