From 57c9bdba5309019f3e07903c145091dbead7e6c4 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 12 Mar 2026 09:34:38 +0100 Subject: [PATCH 1/2] Fix HQ FEC selector under FIX_BASOP_2451_HQ_FEC_SELECTOR --- lib_com/options.h | 1 + lib_dec/FEC_HQ_phase_ecu_fx.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 0457cfa56..fffad6763 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -113,6 +113,7 @@ #define FIX_BASOP_2436_REUSED_CLDFB_IN_OMASA_SR /* FhG: basop issue 2436 (related to basop 2283): fix garbage output for >1 object OMASA with extrend as ISAR prerenderer */ #define FIX_BASOP_2472_IGF_SP_AUD_DEC_CHAN /* FhG: always use channel 1 for sp_aud_decision0[] being passed to ProcessIGF_ivas_fx() */ #define FIX_BASOP_REMOVE_SYNTH2_FX /* FhG: Replace 32bit olapBufferSynth2_fx with 16bit olapBufferSynth2 buffer */ +#define FIX_BASOP_2451_HQ_FEC_SELECTOR /* Eri: Resolve basop issue 2451, wrong condition on env_stab_plc_fx */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index 159324461..3bf07d8cd 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -5017,10 +5017,18 @@ void ivas_hq_ecu_fx( test(); test(); test(); +#ifdef FIX_BASOP_2451_HQ_FEC_SELECTOR + evs_mode_selection = ( GE_32( st_fx->total_brate, 48000 ) && ( GE_16( output_frame, L_FRAME16k ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) && + ( ph_ecu_HqVoicing || ( ( ( NE_16( hHQ_core->env_stab_plc_fx, 0 ) ) && ( LT_16( corr, 19661 ) /* 0.6 in Q15 */ ) ) || ( !( NE_16( hHQ_core->env_stab_plc_fx, 0 ) ) && ( GT_16( corr, 27853 ) /* 0.85 in Q15 */ ) ) ) ) ) ) || + ( LT_32( st_fx->total_brate, 48000 ) && ( ( ph_ecu_HqVoicing || GT_16( corr, 27853 ) /* 0.85 in Q15 */ ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) ) ); + +#else evs_mode_selection = ( GE_32( st_fx->total_brate, 48000 ) && ( GE_16( output_frame, L_FRAME16k ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) && ( ph_ecu_HqVoicing || ( ( ( GT_16( hHQ_core->env_stab_plc_fx, 16384 ) /* 0.5 in Q15 */ ) && ( LT_16( corr, 19661 ) /* 0.6 in Q15 */ ) ) || ( LT_16( hHQ_core->env_stab_plc_fx, 16384 ) /* 0.5 in Q15 */ && ( GT_16( corr, 27853 ) /* 0.85 in Q15 */ ) ) ) ) ) ) || ( LT_32( st_fx->total_brate, 48000 ) && ( ( ph_ecu_HqVoicing || GT_16( corr, 27853 ) /* 0.85 in Q15 */ ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) ) ); +#endif +#ifndef FIX_BASOP_2451_HQ_FEC_SELECTOR #ifdef HARM_HQ_CORE_KEEP_BE IF( st_fx->element_mode == EVS_MONO ) { @@ -5043,6 +5051,7 @@ void ivas_hq_ecu_fx( ( NE_16( ph_ecu_HqVoicing, 0 ) || ( ( ( NE_16( hHQ_core->env_stab_plc_fx, 0 ) ) && ( LT_16( corr, 19661 ) ) ) || ( !( NE_16( hHQ_core->env_stab_plc_fx, 0 ) ) && ( GT_16( corr, 27853 ) ) ) ) ) ) ) || ( LT_32( st_fx->total_brate, 48000 ) && ( ( ph_ecu_HqVoicing || GT_16( corr, 27853 ) ) && !prev_bfi && ( !old_is_transient[0] || old_is_transient[1] ) ) ); } +#endif #endif test(); -- GitLab From b9d19394fb02be8f57531ceb78e34a3d4cddc2d4 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Mar 2026 15:35:02 +0100 Subject: [PATCH 2/2] Add _sat to EVS OLA function --- lib_com/window_ola_fx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_com/window_ola_fx.c b/lib_com/window_ola_fx.c index 1808bf71c..e53c9f49a 100644 --- a/lib_com/window_ola_fx.c +++ b/lib_com/window_ola_fx.c @@ -304,7 +304,11 @@ void window_ola_fx( p4 = oldgapsynth + n; FOR( i = 0; i < temp; i++ ) { +#ifdef FIX_BASOP_2451_HQ_FEC_SELECTOR + *p1 = add_sat( mult( *p1, *p2 ), mult( *p4, *p3 ) ); /* auOut[i]*SS2[i]+ oldgapsynth[i+n]*(SS2[L-n-i-1]);*/ +#else *p1 = add( mult( *p1, *p2 ), mult( *p4, *p3 ) ); /* auOut[i]*SS2[i]+ oldgapsynth[i+n]*(SS2[L-n-i-1]);*/ +#endif move16(); p1++; p2++; -- GitLab