diff --git a/lib_com/options.h b/lib_com/options.h index f9fec417bff7673d9755ca74faa570931014aca0..ea5fad27e23e96688cce2aedff3efa67053b5b3c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -80,6 +80,7 @@ #define FIX_2084_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in IVAS_ENC_FeedObjectMetadata() */ #define FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING /* FhG: Replace L_shl with L_shl_sat to prevent overflow when calculating scale factors for very small numbers in the logarithmic domain */ #define FIX_APA_EXECS_SCALING /* VA: fix scaling of JBM APA buffer */ +#define FIX_2164_ASSERT_IN_OMASA_PREPROC_FOR_EDIT /* Nokia: Issue 2164: Prevent overflow when calculating equalization coefficient for editing before clamping to safe range */ /* ################### End FIXES switches ########################### */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 0539b7b85524aacc82866eb1afc7eb7d8bc0db43..13669031e828fa773afdaacf16acafb690c4f6a5 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -6381,8 +6381,12 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( { temp = BASOP_Util_Divide3232_Scale_newton( hMasaIsmData->preprocEneTarget_fx[band_idx], L_max( 1, hMasaIsmData->preprocEneRealized_fx[band_idx] ), &temp_q ); temp_q = sub( Q31, sub( sub( Q31, temp_q ), sub( hMasaIsmData->preprocEneTarget_e[band_idx], hMasaIsmData->preprocEneRealized_e[band_idx] ) ) ); - temp = Sqrt32( temp, &temp_q ); // Q: 31-temp_q + temp = Sqrt32( temp, &temp_q ); // Q: 31-temp_q +#ifdef FIX_2164_ASSERT_IN_OMASA_PREPROC_FOR_EDIT + temp = L_shl_sat( temp, sub( temp_q, 3 ) ); // Q28 +#else temp = L_shl( temp, sub( temp_q, 3 ) ); // Q28 +#endif temp_q = Q28; move16(); }