diff --git a/lib_com/options.h b/lib_com/options.h index 3cc52a0acbdf5a7a0e252e82212955c011384ea1..2a218e87d9e1dd693a2936430337590a86b2e762 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -89,8 +89,8 @@ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ #define FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX #define FIX_ISSUE_987 -#define FIX_1054_IF_ELSE_CMPLX /* VA: Fix 1054 incorrect counting of complexity when ELSE-IF sequence is encoutered in two functions */ -#define FIX_1052_COPY_CMPLX_DISCREPANCY /* VA: modify IF-ELSE statements used in Copy*() functions to avoid dependency on x[] and y[] in RAM */ +#define FIX_1054_IF_ELSE_CMPLX /* VA: Fix 1054 incorrect counting of complexity when ELSE-IF sequence is encoutered in two functions */ +#define FIX_1052_COPY_CMPLX_DISCREPANCY /* VA: modify IF-ELSE statements used in Copy*() functions to avoid dependency on x[] and y[] in RAM */ #define FIX_1049_SHR_RO_COMPLEXITY /* VA: fix for issue 1049: incorrect counting of complexity in the shr_ro() function */ #define NONBE_IMPROVE_DIRAC_INTENSITY_PREC #define FIX_1103_OPT_L_NORM_ARR /* FhG: Optimize L_norm_arr(), avoid IF */ @@ -108,7 +108,7 @@ #define FIX_1132_STACK_CORRUPTION /* Stack corruption issue due of extending index access*/ #define FIX_ISSUE_1092 /* Ittiam: Fix for Issue 1092: BASOP asserts in stereo fx encoder for selection test inputs*/ #define FIX_ISSUE_1148 -#define FIX_ISSUE_1147 /*Ittiam: Fix for issue 1147: Added saturation in DetectTnsFilt_fx.*/ +#define FIX_ISSUE_1147 /* Ittiam: Fix for issue 1147: Added saturation in DetectTnsFilt_fx.*/ #define FIX_ISSUE_1150 /* Ittiam: Fix for Issue 1150: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from tcx_ltp_find_gain function*/ #define FIX_ISSUE_1151 /* Ittiam: Fix for Issue 1151: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from sp_mus_classif_gmm_fx function*/ #define FIX_ISSUE_1153 /* Ittiam: Fix for Issue 1153: Assertion error observed in stereo_dmx_evs_enc_fx from calc_poc_fx function*/ @@ -116,5 +116,6 @@ #define FIX_ISSUE_1157 /* Ittiam: Fix for Issue 1157: Encoder crash for Stereo at 48/64kbps DTX on/off in kernel_switch_trafo_fx() */ #define FIX_ISSUE_1152 /* Ittiam: Fix for issue 1152: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from find_tilt_fx function*/ #define FIX_ISSUE_1156 /* Ittiam: Fix for Issue 1156: Encoder crash for Stereo at 32kbps in SWB_BWE_encoding_ivas_fx() */ -#define FIX_DISCLAIMER /* VA: Add disclaimer for external renderer + Add info about IVAS reference version (FLP issue 1225) */ +#define FIX_DISCLAIMER /* VA: Add disclaimer for external renderer + Add info about IVAS reference version (FLP issue 1225) */ +#define FIX_ISSUE_1167 /* Ittiam: Fix for Issue 1167: Encoder crash for OSBA ISM3SBA1 at 13.2 and 16.4 kbps in gauss_L2_ivas_fx() */ #endif diff --git a/lib_enc/cod_uv_fx.c b/lib_enc/cod_uv_fx.c index 22b51541755628ab629d9f73f3ca25292aa64637..a8e57391ab2cf9ca1e9e14352edb3b5b9bdcd95a 100644 --- a/lib_enc/cod_uv_fx.c +++ b/lib_enc/cod_uv_fx.c @@ -143,14 +143,24 @@ void gauss_L2_ivas_fx( *gain = L_deposit_l( 0 ); move32(); /*Update correlations for gains coding */ +#ifdef FIX_ISSUE_1167 + tmp32 = L_shr( 21474836l /*0.01f Q31*/, 31 - 16 ); /* Q16 */ + tmp32_2 = L_shr( 21474836l /*0.01f Q31*/, 31 - 16 ); /* Q16 */ + FOR( i = 0; i < L_SUBFR; i++ ) + { + tmp16 = shr( y11[i], 1 ); + tmp32 = L_mac0( tmp32, tmp16, tmp16 ); /* Q16 */ + tmp32_2 = L_mac0( tmp32_2, tmp16, shr( y2[i], 1 ) ); /* Q16 */ + } +#else tmp32 = L_shr( 21474836l /*0.01f Q31*/, 31 - 18 ); /* Q18 */ tmp32_2 = L_shr( 21474836l /*0.01f Q31*/, 31 - 18 ); /* Q18 */ - FOR( i = 0; i < L_SUBFR; i++ ) { tmp32 = L_mac0( tmp32, y11[i], y11[i] ); /* Q18 */ tmp32_2 = L_mac0( tmp32_2, y11[i], y2[i] ); /* Q18 */ } +#endif tmp16 = norm_l( tmp32 ); // To be checked @@ -159,13 +169,21 @@ void gauss_L2_ivas_fx( #else g_corr->y1y1 = round_fx( L_shl( tmp32, tmp16 ) ); #endif +#ifdef FIX_ISSUE_1167 + g_corr->y1y1_e = sub( 31 - 16, tmp16 ); +#else g_corr->y1y1_e = sub( 31 - 18, tmp16 ); +#endif move16(); move16(); tmp16 = norm_l( tmp32_2 ); g_corr->y1y2 = round_fx_sat( L_shl( tmp32_2, tmp16 ) ); +#ifdef FIX_ISSUE_1167 + g_corr->y1y2_e = sub( 31 - 16, tmp16 ); +#else g_corr->y1y2_e = sub( 31 - 18, tmp16 ); +#endif move16(); move16(); }