diff --git a/lib_com/options.h b/lib_com/options.h index 10649419f741d49c9a83d1b6616ef9696e5edebb..95acf097772968d9db2d5c1370fd8a2c1f04cb70 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -95,6 +95,7 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.251 V3.0 */ +#define FIX_BASOP_2451_HQ_FEC_SELECTOR /* Eri: Resolve basop issue 2451, wrong condition on env_stab_plc_fx */ #define FIX_2398_PRECISSION_ORIENTATION_TRACKING /* FhG: use refinement of Sqrt32 within certain functions*/ diff --git a/lib_com/window_ola_fx.c b/lib_com/window_ola_fx.c index 1808bf71cee10523b027d25c740b8bf5b8ba4708..e53c9f49ab634c0a5acb48361d75075b986a1fa4 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++; diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index b760376539aadbad2b5af27c37639a595505aef2..f1c3ab88bdb16db69c9981a6b50efd0ce491dac2 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -3301,10 +3301,18 @@ void 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 ) { @@ -3327,6 +3335,7 @@ void 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();