diff --git a/lib_com/options.h b/lib_com/options.h index b2bc73dd946c9a6d610dd46db8adc7be4fb98e28..60447f9d398df1635c473a5b705d575f617adca5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,6 +101,7 @@ #define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */ #define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ #define FIX_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ +#define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/pitch_ol2_fx.c b/lib_enc/pitch_ol2_fx.c index c28c4c5aa6507323e306d9875822eca570a98663..f50677cf064671664b99be73c19c425848552504 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;