From 616d74e63ab77641a0ca42846a0b81d3a900edae Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 28 Nov 2025 09:04:58 -0500 Subject: [PATCH 1/3] Fix proposal for 2253 --- lib_com/options.h | 2 +- lib_enc/eval_pit_contr_fx.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 708e7f633..05ea72685 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -73,7 +73,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */ #define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/ - +#define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */ /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index 0aa1e1835..b46b84101 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -455,8 +455,11 @@ Word16 Pit_exc_contribution_len_ivas_fx( /* o : bin wher Mbands_loc = MBANDS_LOC; move16(); } - +#ifndef FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH minimum_fx( pitch_buf, nb_subfr, &low_pit ); +#else + minimum_fx( pitch_buf, shr( st_fx->L_frame, 6 ), &low_pit ); +#endif exp1 = norm_s( low_pit ); tmp = shl( low_pit, exp1 ); tmp_dec = 12800; -- GitLab From 3e7979ce5ed984a723414d8fd9d54ad037ace97c Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 28 Nov 2025 09:19:39 -0500 Subject: [PATCH 2/3] fix unused parameter --- lib_enc/eval_pit_contr_fx.c | 2 ++ lib_enc/gs_enc_fx.c | 4 ++++ lib_enc/prot_fx_enc.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index b46b84101..35e6449c9 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -422,7 +422,9 @@ Word16 Pit_exc_contribution_len_ivas_fx( /* o : bin wher const Word16 *dct_res, /* i : DCT of residual Q_new*/ Word16 *dct_pitex, /* i/o: DCT of pitch contribution Q_new*/ Word16 *pitch_buf, /* i/o: Pitch per subframe Q6*/ +#ifndef FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH const Word16 nb_subfr, /* i : Number of subframe considered Q0*/ +#endif Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ Word16 Qnew ) { diff --git a/lib_enc/gs_enc_fx.c b/lib_enc/gs_enc_fx.c index 472b9f765..f3e85bd29 100644 --- a/lib_enc/gs_enc_fx.c +++ b/lib_enc/gs_enc_fx.c @@ -675,7 +675,11 @@ void encod_audio_ivas_fx( * Find and encode the last band where the adaptive (pitch) contribution is significant *---------------------------------------------------------------*/ +#ifndef FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH last_pit_bin = Pit_exc_contribution_len_ivas_fx( st_fx, dct_res, dct_epit, pitch_buf, nb_subfr, &hGSCEnc->pit_exc_hangover, Q_new ); +#else + last_pit_bin = Pit_exc_contribution_len_ivas_fx( st_fx, dct_res, dct_epit, pitch_buf, &hGSCEnc->pit_exc_hangover, Q_new ); +#endif IF( last_pit_bin == 0 ) { diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 9d7de9eeb..136b33897 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -4039,7 +4039,9 @@ Word16 Pit_exc_contribution_len_ivas_fx( const Word16 *dct_res, /* i : DCT of residual Qnew*/ Word16 *dct_pitex, /* i/o: DCT of pitch contribution Qnew*/ Word16 *pitch_buf, /* i/o: Pitch per subframe Q6*/ +#ifndef FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH const Word16 nb_subfr, /* i : Number of subframe considered Q0*/ +#endif Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ Word16 Qnew ); -- GitLab From 4f0720cc37c7d2e5fe969b813bd20da8a93f367c Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 28 Nov 2025 09:22:51 -0500 Subject: [PATCH 3/3] fix clang-format --- lib_enc/eval_pit_contr_fx.c | 2 +- lib_enc/prot_fx_enc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index 35e6449c9..b9ea2d49e 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -425,7 +425,7 @@ Word16 Pit_exc_contribution_len_ivas_fx( /* o : bin wher #ifndef FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH const Word16 nb_subfr, /* i : Number of subframe considered Q0*/ #endif - Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ + Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ Word16 Qnew ) { diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 136b33897..feaefcf53 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -4042,7 +4042,7 @@ Word16 Pit_exc_contribution_len_ivas_fx( #ifndef FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH const Word16 nb_subfr, /* i : Number of subframe considered Q0*/ #endif - Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ + Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ Word16 Qnew ); Word16 pvq_core_enc_fx( -- GitLab