diff --git a/lib_com/options.h b/lib_com/options.h index 31c7862787b352ef04818c31775912fb439ab44d..969e28879ee5bbd6af039d9bb9e29a0af712e8db 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,6 +100,7 @@ #define FIX_ISSUE_2013_MDCT_STEREO_FER_DISCONTINUITIES /* Eri/FhG: Issue 2013 fix for FER discontinuities */ #define FIX_2000_NON_LINEARITY_OVERSHOOT /* Eri: Issue 2000: SWB TBE energy overshoot in non-linearity. Aligns with float */ +#define FIX_2010_HF_ENERGY_LOSS /* FhG: corrected bwe_exc_fx[] scaling in the decoder */ /* #################### 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/dec_gen_voic_fx.c b/lib_dec/dec_gen_voic_fx.c index ac1df74b23ec19152873c6464a294100f5ad86a0..998e157865d8311369d8905d012bbda5cc1d6e08 100644 --- a/lib_dec/dec_gen_voic_fx.c +++ b/lib_dec/dec_gen_voic_fx.c @@ -321,7 +321,13 @@ ivas_error decod_gen_voic_fx( { idx = idiv1616( i_subfr_fx, L_SUBFR ); } - +#ifdef FIX_2010_HF_ENERGY_LOSS + IF( LT_32( MIN_BRATE_AVQ_EXC, st_fx->core_brate ) ) + { + gain_code_fx = L_shl_sat( gain_code_fx, 1 ); + gain_preQ_fx = shl_sat( gain_preQ_fx, 1 ); + } +#endif prep_tbe_exc_fx( L_frame, L_SUBFR, i_subfr_fx, gain_pit_fx, gain_code_fx, code_fx, voice_fac_fx, &voice_factors_fx[idx], bwe_exc_fx, gain_preQ_fx, code_preQ_fx, st_fx->Q_exc, T0_fx, T0_frac_fx, st_fx->coder_type, st_fx->core_brate,