From b98947b084e7bcd00d18b02d30af3e12ffe26586 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 31 Jul 2024 13:30:22 +0200 Subject: [PATCH] add fix for issue 1152 --- lib_com/options.h | 1 + lib_enc/ivas_stereo_dft_enc_itd.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 7189648051..269bd1ddbd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define FIX_RETURN /* VA: fix location of function returns */ #endif #define FIX_BASOP_812_NAN_COHSNR /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/ +#define FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION /* FhG: fix uninitialized value being used in ITD VAD mid signal computation that does not affect synthesis, but crashes BASOPs */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index d115eb5a25..14daacd06b 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -288,7 +288,13 @@ static int16_t stereo_dft_enc_itd_vad( float Spd[STEREO_DFT_N_16k_ENC / 2 + 1]; +#ifdef FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION + /* Spd is later only used starting at itd_vad_band_tbl[0], so only compute values starting from there */ + /* -> this avoids uninitialized values in Spd_L and Spd_R at index 0 to be used */ + for ( i = itd_vad_band_tbl[0]; i <= STEREO_DFT_N_16k_ENC / 2; i++ ) +#else for ( i = 0; i <= STEREO_DFT_N_16k_ENC / 2; i++ ) +#endif { Spd[i] = 0.5f * ( Spd_L[i] + Spd_R[i] ); } -- GitLab