diff --git a/lib_basop/basop32.c b/lib_basop/basop32.c index 4f601911bbe1536ca6a951e51875a5e3d7094473..1b9ef845d8792aba2a0b89569d297bc7d1f8e8ca 100644 --- a/lib_basop/basop32.c +++ b/lib_basop/basop32.c @@ -896,7 +896,21 @@ Word16 shr_o( Word16 var1, Word16 var2, Flag *Overflow ) Word16 shr( Word16 var1, Word16 var2 ) { +#ifdef FIX_BASOP_2563_CRASH_HQ_GENERIC_DEC + Flag Overflow; + Word16 result; + + Overflow = 0; + + result = shr_o( var1, var2, &Overflow ); + if ( Overflow ) + { + assert( 0 ); + } + return result; +#else return shr_o( var1, var2, NULL ); +#endif } Word16 shr_sat( Word16 var1, Word16 var2 ) { diff --git a/lib_com/options.h b/lib_com/options.h index 53bfa8a2e83a3edf1b7837dc2a6487ba95c2c38a..5ed2086a04947fb3b037bb7f13b2e321e53ef6e0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -107,6 +107,7 @@ #define FIX_BASOP_2555_FRAMELEN_CALC /* FhG: BASOP issue 2555: Simplify (sub-)framelength calculation in ivas_mdct_core_tns_ns_fx() */ #define FIX_BASOP_2095_REMOVE_TABLES_PT01 /* FhG: BASOP issue 2095: remove unused tables, part 01 */ #define FIX_2346_DUPLICATED_IGF_FUNCTIONS_2 /* FhG: part 2 of basop issue 2346: Review potentially duplicated IGF functions */ +#define FIX_BASOP_2563_CRASH_HQ_GENERIC_DEC /* Eri: BASOP issue 2563: Crash in hq_generic decoding. EVS code --> solve with _sat operator */ #define FIX_2095_REMOVE_UNUSED_ISAR_TABLES /* Dolby: remove unused ISAR */ #define FIX_BASOP_2560_STEREO_DFT_DEC_RESET /* FhG: BASOP issue 2560: align reset of hStereoDft->res_gains_ind_fx[][] between BASOP and float */ #define HARMONIZE_2539_cng_energy /* FhG: basop issue 2539: harmonize cng_energy with its ivas derivate */ diff --git a/lib_com/swb_bwe_com_fx.c b/lib_com/swb_bwe_com_fx.c index bd1c35e3ea19b5322829b46e53e0c52b99bc3d7a..434dd6a800d96c0398b76f1d17f2939971135382 100644 --- a/lib_com/swb_bwe_com_fx.c +++ b/lib_com/swb_bwe_com_fx.c @@ -2747,8 +2747,12 @@ void hq_generic_decoding_fx( exp2 = sub( norm_l( L_tmp2 ), 1 ); tmp1_fx = extract_h( L_shl( L_tmp1, exp1 ) ); tmp2_fx = extract_h( L_shl( L_tmp2, exp2 ) ); - tmp3_fx = div_s( tmp2_fx, tmp1_fx ); /*15 + exp2 + 15 - (exp1 + 15) */ + tmp3_fx = div_s( tmp2_fx, tmp1_fx ); /*15 + exp2 + 15 - (exp1 + 15) */ +#ifdef FIX_BASOP_2563_CRASH_HQ_GENERIC_DEC + tmp3_fx = shr_sat( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */ +#else tmp3_fx = shr( tmp3_fx, add( 5, sub( exp2, exp1 ) ) ); /*10 */ +#endif if ( LT_16( tmp3_fx, 307 /*0.3 in Q10 */ ) ) {