From 3a1c7461f37a8a961b353dfe430d5c717894ca04 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 8 May 2024 09:24:02 +0200 Subject: [PATCH] Add fix for issue 737 under FIX_737_HQ_ACELP_SWITCH_SCALING_ERROR --- lib_com/options.h | 1 + lib_dec/acelp_core_dec_ivas_fx.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 366354dc8..743eae304 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -125,6 +125,7 @@ #define FIX_740_HQ_CORE_OVA // Proposed fix to solve overlap and add issue for HQ_CORE #define FIX_746 // proposed fix to solve low bit-rate frame boundaries issues #define FIX_SATURATION_725 // Propose fix for saturation in AVQ +#define FIX_737_HQ_ACELP_SWITCH_SCALING_ERROR /* Eri: Proposed fix for issue 737: scaling error in excitation memory after HQ->ACELP switch */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index 5c76a407c..078ec95e4 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -788,6 +788,9 @@ ivas_error acelp_core_dec_ivas_fx( preemph_fx( old_exc_s_fx, st->preemph_fac, L_FRAME16k, &tmpF_fx ); Copy(old_exc_s_fx + st->L_frame - M, st->mem_syn2_fx, M ); Residu3_fx( Aq_fx, old_exc_s_fx, old_exc_fx + L_EXC_MEM_DEC - st->L_frame, st->L_frame, 0 ); +#ifdef FIX_737_HQ_ACELP_SWITCH_SCALING_ERROR + Scale_sig( old_exc_fx + L_EXC_MEM_DEC - st->L_frame, st->L_frame, st->Q_exc ); +#endif } if ( st->last_core != ACELP_CORE && st->element_mode > EVS_MONO ) -- GitLab