diff --git a/lib_com/options.h b/lib_com/options.h index 974237f4c5e901644c3f82a0736009591d59bebc..2d359665cfdcf218f78d840a31f75e152761af1f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,4 +168,5 @@ #define FIX_1072_SPEEDUP_gainpanning /* FhG: Minor WMOPS tuning, nonbe */ #define FIX_1072_SPEEDUP_COMPUTEDIFUSENESS /* FhG: Minor WMOPS tuning, nonbe */ #define FIX_1320_LOWRATE_ACELP +#define FIX_1297_OVERFLOW /* VA: fixes issue with overflows in pre-processing */ #endif diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index c84fd73f1850eb4c4fd55af43f7a780acfb7f283..4913f2545a42a956b1e26f21ce074d32fd21aa7c 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -1647,7 +1647,11 @@ static void edge_detect_fx( } } +#ifndef FIX_1297_OVERFLOW *edge_str = extract_l( L_shr( edge_min, 10 ) ); // Q15 +#else + *edge_str = extract_h( L_shl_sat( edge_min, 16 - 10 ) ); // Q15 +#endif move16(); *edge_type = et; // Q0 move16(); diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index 32b521ef46060a8c68b6bdcc932f9220f458847f..295cff8a1a889597baf9340d513c08348b248002 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -2303,14 +2303,21 @@ Word16 ivas_smc_gmm_fx( *high_lpn_flag = 1; move32(); } - +#ifndef FIX_1297_OVERFLOW hSpMusClas->lpm_fx = extract_l( L_shr( lpm_fx, 11 ) ); // Q7 move16(); hSpMusClas->lps_fx = extract_l( L_shr( lps_fx, 11 ) ); // Q7 move16(); hSpMusClas->lpn_fx = extract_l( L_shr( lpn_fx, 11 ) ); // Q7 move16(); - +#else + hSpMusClas->lpm_fx = extract_h( L_shl_sat( lpm_fx, 16 - 11 ) ); // Q7 + move16(); + hSpMusClas->lps_fx = extract_h( L_shl_sat( lps_fx, 16 - 11 ) ); // Q7 + move16(); + hSpMusClas->lpn_fx = extract_h( L_shl_sat( lpn_fx, 16 - 11 ) ); // Q7 + move16(); +#endif /* determine HQ Generic speech class */ IF( st->hHQ_core != NULL ) {