From 5506be3c55313c1220ca322f6e3827a0a5babfcf Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 5 Dec 2024 19:41:14 +0530 Subject: [PATCH] Revert changes for issue 1013 which got overwritten, and a bug fix in pvq_core_enc --- lib_com/options.h | 1 + lib_com/trans_inv_fx.c | 4 ++++ lib_enc/pvq_core_enc_fx.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 64fcbf193..c7407e532 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -79,4 +79,5 @@ #define SIMPLIFY_CODE_BE // Simplify synthesis loop #define CR_2109_to_2112_cd0_ce0 /* This is related to the CRs include in the 26.444 package of 21-12. Concerns lead_deindexing and */ #define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */ +#define FIX_1013_CRASH_HQ_CORE_DEC /* Ittiam: Saturation added on the lines of EVS */ #endif diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index 050548bc3..cc562c899 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -543,7 +543,11 @@ void preecho_sb_fx( tmp_fx1 = norm_l( es_mdct_hb_fx[i] ); tmp_fxL1 = L_shl( es_mdct_hb_fx[i], tmp_fx1 ); tmp_fxL2 = L_shl( mean_prev_hb_fx_loc, tmp_fx1 ); +#ifdef FIX_1013_CRASH_HQ_CORE_DEC + tmp_fx1 = round_fx_sat( tmp_fxL1 ); +#else tmp_fx1 = round_fx( tmp_fxL1 ); +#endif tmp_fx2 = round_fx( tmp_fxL2 ); tmp_fx3 = div_s( tmp_fx2, tmp_fx1 ); min_g_hb_fx[i] = Frac_sqrt( tmp_fx3 ); diff --git a/lib_enc/pvq_core_enc_fx.c b/lib_enc/pvq_core_enc_fx.c index 0ad1d3192..3b20e82c3 100644 --- a/lib_enc/pvq_core_enc_fx.c +++ b/lib_enc/pvq_core_enc_fx.c @@ -521,7 +521,7 @@ Word16 pvq_core_enc_ivas_fx( R_upd = shl( bits_tot, 3 ); - gain_bits_tot = assign_gain_bits_fx( core, nb_sfm, sfmsize, R, gain_bits_array, &R_upd ); + gain_bits_tot = ivas_assign_gain_bits_fx( core, nb_sfm, sfmsize, R, gain_bits_array, &R_upd ); pvq_bits = shr( R_upd, 3 ); pvq_encode_frame_ivas_fx( hBstr, coefs_norm, *Q_coefs, coefs_quant, gopt, npulses, pulse_vector, sfm_start, sfm_end, sfmsize, nb_sfm, R, pvq_bits, core ); -- GitLab