From a7a0959137a6ba95bd5701ea660d095aa8429b25 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 12 Dec 2025 10:03:40 -0500 Subject: [PATCH 1/2] Fix for 2271 to silence clang18 --- lib_com/options.h | 2 +- lib_enc/pitch_ol2_fx.c | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ee8c6be3a..db239d133 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -89,7 +89,7 @@ #define FIX_2252_SCALING_SAVE_HB_SYNTH /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */ #define FIX_2248_EVS_ASSERT /* VA: Include _sat in an EVS related part of the code */ #define FIX_2254_IMPROV_COMPLEXITY_BE /* VA: BE small complexity reduction */ - +#define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_enc/pitch_ol2_fx.c b/lib_enc/pitch_ol2_fx.c index c28c4c5aa..f50677cf0 100644 --- a/lib_enc/pitch_ol2_fx.c +++ b/lib_enc/pitch_ol2_fx.c @@ -50,7 +50,9 @@ void pitch_ol2_fx( Word32 R1, R2; Word16 R0, exp_R0, exp_R1, exp_R2, j; Word16 pit_max; - +#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2 + Word16 base_idx; +#endif /* initialization */ pit_max = PIT_MAX; move16(); @@ -104,9 +106,14 @@ void pitch_ol2_fx( * search the fractions around t0 and choose the one which maximizes * the interpolated normalized correlation. *----------------------------------------------------------------*/ +#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 pt_cor_fx = cor_fx + sub( L_INTERPOL1, t0_min ); +#endif t0s = t1s; move16(); +#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2 + base_idx = sub( L_INTERPOL1, t0_min ); +#endif step = 1; move16(); /* 1/4 subsample resolution */ @@ -116,10 +123,18 @@ void pitch_ol2_fx( IF( NE_16( t0s, t0_min ) ) /* Process negative fractions */ { t0s = sub( t0s, 1 ); +#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 cor_max_fx = Interpol_4( &pt_cor_fx[t0s], fraction ); +#else + cor_max_fx = Interpol_4( &cor_fx[t0s + base_idx], fraction ); +#endif FOR( i = fraction + step; i <= 3; i += step ) { +#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 temp_fx = Interpol_4( &pt_cor_fx[t0s], i ); +#else + temp_fx = Interpol_4( &cor_fx[t0s + base_idx], i ); +#endif if ( GT_16( temp_fx, cor_max_fx ) ) { fraction = i; @@ -132,13 +147,20 @@ void pitch_ol2_fx( { fraction = 0; move16(); +#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 cor_max_fx = Interpol_4( &pt_cor_fx[t0s], fraction ); +#else + cor_max_fx = Interpol_4( &cor_fx[t0s + base_idx], fraction ); +#endif move16(); } FOR( i = 0; i <= 3; i += step ) /* Process positive fractions */ { +#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 temp_fx = Interpol_4( &pt_cor_fx[t1s], i ); - +#else + temp_fx = Interpol_4( &cor_fx[t1s + base_idx], i ); +#endif IF( GT_16( temp_fx, cor_max_fx ) ) { cor_max_fx = temp_fx; -- GitLab From 90ce17e5a9d1e7bb7d3ca67e2ab1c0aa12909150 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 12 Dec 2025 10:12:10 -0500 Subject: [PATCH 2/2] addition of comment --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index db239d133..c6add530c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -89,7 +89,7 @@ #define FIX_2252_SCALING_SAVE_HB_SYNTH /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */ #define FIX_2248_EVS_ASSERT /* VA: Include _sat in an EVS related part of the code */ #define FIX_2254_IMPROV_COMPLEXITY_BE /* VA: BE small complexity reduction */ -#define FIX_2271_OOB_INDEXING_IN_PIT_OL2 +#define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ -- GitLab