From 3ed731f8aebb390880a947eec48e615aa7580a5a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:05:27 +0100 Subject: [PATCH 01/26] [cleanup] accept FIX_1466_EXTREND --- lib_com/options.h | 1 - lib_rend/lib_rend.c | 26 -------------------------- 2 files changed, 27 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 08c9c5c857..3b13fcada9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ -#define FIX_1466_EXTREND /* FhG: issue 1466: enable rendering of mono/stereo to other formats in the external renderer */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */ #define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5f52c16818..8782c1a65e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1268,7 +1268,6 @@ static bool isIoConfigPairSupported( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig ) { -#ifdef FIX_1466_EXTREND /* input config cannot be binaural */ if ( ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && ( inConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && inConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) @@ -1281,13 +1280,6 @@ static bool isIoConfigPairSupported( { return false; } -#else - /* Rendering mono or stereo to binaural is not supported */ - if ( ( inConfig == IVAS_AUDIO_CONFIG_MONO || inConfig == IVAS_AUDIO_CONFIG_STEREO ) && getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) - { - return false; - } -#endif /* If not returned so far, config pair is supported */ return true; @@ -2229,22 +2221,17 @@ static ivas_error updateMcPanGainsForAmbiOut( { int16_t ch_in, ch_out, lfeIdx; int16_t numNonLfeInChannels, outAmbiOrder; -#ifdef FIX_1466_EXTREND AUDIO_CONFIG inConfig; -#endif const float *spkAzi, *spkEle; ivas_error error; -#ifdef FIX_1466_EXTREND inConfig = inputMc->base.inConfig; -#endif if ( ( error = getAmbisonicsOrder( outConfig, &outAmbiOrder ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1466_EXTREND if ( inConfig == IVAS_AUDIO_CONFIG_MONO || inConfig == IVAS_AUDIO_CONFIG_STEREO ) { @@ -2267,9 +2254,6 @@ static ivas_error updateMcPanGainsForAmbiOut( return IVAS_ERR_OK; } else if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) -#else - if ( inputMc->base.inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) -#endif { if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK ) { @@ -2325,7 +2309,6 @@ static ivas_error updateMcPanGainsForAmbiOut( return IVAS_ERR_OK; } -#ifdef FIX_1466_EXTREND static ivas_error updateMcPanGainsForBinauralOut( input_mc *inputMc ) { @@ -2344,7 +2327,6 @@ static ivas_error updateMcPanGainsForBinauralOut( return IVAS_ERR_OK; } -#endif static ivas_error updateMcPanGains( input_mc *inputMc, @@ -2366,7 +2348,6 @@ static ivas_error updateMcPanGains( error = updateMcPanGainsForAmbiOut( inputMc, outConfig ); break; case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: -#ifdef FIX_1466_EXTREND if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO || inputMc->base.inConfig == IVAS_AUDIO_CONFIG_STEREO ) { error = updateMcPanGainsForBinauralOut( inputMc ); @@ -2374,7 +2355,6 @@ static ivas_error updateMcPanGains( } /* not mono or stereo */ -#endif switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: @@ -2433,13 +2413,11 @@ static ivas_error initMcBinauralRendering( int32_t binauralDelayNs; int32_t outSampleRate; int8_t useTDRend; -#ifdef FIX_1466_EXTREND if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO || inputMc->base.inConfig == IVAS_AUDIO_CONFIG_STEREO ) { return IVAS_ERR_OK; } -#endif /* Allocate TD binaural renderer for custom loudspeaker layouts (regardless of headrotation) or planar MC layouts with headrotation, CREND for the rest */ @@ -6354,7 +6332,6 @@ static ivas_error renderActiveInputsIsm( return IVAS_ERR_OK; } -#ifdef FIX_1466_EXTREND static void renderMonoStereoToBinaural( const input_mc *mcInput, IVAS_REND_AudioBuffer outAudio ) @@ -6374,7 +6351,6 @@ static void renderMonoStereoToBinaural( return; } -#endif static ivas_error renderLfeToBinaural( const input_mc *mcInput, @@ -6975,7 +6951,6 @@ static ivas_error renderInputMc( renderMcToSba( mcInput, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: -#ifdef FIX_1466_EXTREND if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_MONO || mcInput->base.inConfig == IVAS_AUDIO_CONFIG_STEREO ) { renderMonoStereoToBinaural( mcInput, outAudio ); @@ -6983,7 +6958,6 @@ static ivas_error renderInputMc( } /* not mono or stereo */ -#endif switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: -- GitLab From f5ee3377d9ae89d9b11f9237f9d17697fc7e07ff Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:06:15 +0100 Subject: [PATCH 02/26] [cleanup] accept FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER --- lib_com/options.h | 1 - lib_dec/lib_dec.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3b13fcada9..c6ad4e3a42 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */ #define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */ #define FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index afc5043bb7..7e8fbb19dc 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -219,23 +219,15 @@ ivas_error IVAS_DEC_Open( st_ivas->restartNeeded = 0; /* set high-level parameters */ -#ifdef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER st_ivas->codec_mode = 0; /* unknown before first frame */ st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->writeFECoffset = 0; st_ivas->sba_analysis_order = 0; /* not really used in EVS mode, but initialize here to fix MSAN complaint */ -#endif if ( mode == IVAS_DEC_MODE_EVS ) { -#ifndef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER - st_ivas->codec_mode = 0; /* unknown before first frame */ - st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; - st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; - st_ivas->writeFECoffset = 0; -#endif st_ivas->element_mode_init = EVS_MONO; st_ivas->ivas_format = MONO_FORMAT; hIvasDec->hasDecodedFirstGoodFrame = true; /* Functionality to suppress output for initial lost frames is disabled in EVS operation */ @@ -244,12 +236,6 @@ ivas_error IVAS_DEC_Open( } else if ( mode == IVAS_DEC_MODE_IVAS ) { -#ifndef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER - st_ivas->codec_mode = 0; /* unknown before first frame */ - st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; - st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; - st_ivas->writeFECoffset = 0; -#endif st_ivas->element_mode_init = -1; st_ivas->ivas_format = UNDEFINED_FORMAT; st_ivas->renderer_type = RENDERER_DISABLE; -- GitLab From 5e9924bcd0f861aaff8aba8869f5ea9f52660909 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:27:51 +0100 Subject: [PATCH 03/26] [cleanup] accept FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE --- lib_com/options.h | 1 - lib_dec/ivas_sce_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c6ad4e3a42..7db65f5905 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */ #define FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 3c853a047a..e0d7694fae 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -353,9 +353,7 @@ ivas_error create_sce_dec( hSCE->sce_id = sce_id; hSCE->element_brate = element_brate; -#ifdef FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE hSCE->last_element_brate = hSCE->element_brate; -#endif set_f( hSCE->prev_hb_synth, 0.0f, NS2SA( st_ivas->hDecoderConfig->output_Fs, IVAS_DEC_DELAY_NS - DELAY_BWE_TOTAL_NS ) ); -- GitLab From 3d39acec375d24ed1ac3a3a7df6321ad6dd24458 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:29:10 +0100 Subject: [PATCH 04/26] [cleanup] accept FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE --- lib_com/options.h | 1 - lib_dec/ivas_sce_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7db65f5905..82913adde7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index e0d7694fae..2fe1b89db0 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -369,9 +369,7 @@ ivas_error create_sce_dec( copy_decoder_config( st_ivas, st ); st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ -#ifdef FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE st->element_brate = -1; -#endif st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; st->is_ism_format = 0; if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) -- GitLab From 0e5c9f076832c0d6f8f469aafb03b2266999148d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:52:06 +0100 Subject: [PATCH 05/26] [cleanup] accept FIX_1464_UBSAN_RC_CONTEXT_MAP --- lib_com/options.h | 1 - lib_dec/ACcontextMapping_dec.c | 2 -- lib_enc/ACcontextMapping_enc.c | 4 ---- 3 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 82913adde7..8eda391e21 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ #define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */ diff --git a/lib_dec/ACcontextMapping_dec.c b/lib_dec/ACcontextMapping_dec.c index a51fc1434b..66d19417ee 100644 --- a/lib_dec/ACcontextMapping_dec.c +++ b/lib_dec/ACcontextMapping_dec.c @@ -662,9 +662,7 @@ int16_t RCcontextMapping_decode2_no_mem_s17_LCS( c = 12 + esc_nb; } -#ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = s & 0x0F; -#endif s = s << 4; /*Shift old 4 bits*/ s = s + c; /*replace last 4 bits*/ t = s & 0xFF; diff --git a/lib_enc/ACcontextMapping_enc.c b/lib_enc/ACcontextMapping_enc.c index dd635d87c4..b0b85ef607 100644 --- a/lib_enc/ACcontextMapping_enc.c +++ b/lib_enc/ACcontextMapping_enc.c @@ -963,9 +963,7 @@ void RCcontextMapping_encode2_no_mem_s17_LCS( } /*Shift old 4 bits, replace last 4 bits*/ -#ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = s & 0x0F; -#endif s = ( s << 4 ) + cp; t = s & 0xFF; @@ -1341,9 +1339,7 @@ int16_t RCcontextMapping_encode2_estimate_no_mem_s17_LCS( } /*shift old bits and replace last 4 bits*/ -#ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = s & 0x0F; -#endif s = ( s << 4 ) + cp; t = s & 0xFF; -- GitLab From 7746a569e5c0376a7eff89bcd5028448b7bc9407 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:52:45 +0100 Subject: [PATCH 06/26] [cleanup] accept FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH --- lib_com/options.h | 1 - lib_enc/tcx_ltp_enc.c | 24 ------------------------ 2 files changed, 25 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8eda391e21..72d8a0566f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ #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 */ diff --git a/lib_enc/tcx_ltp_enc.c b/lib_enc/tcx_ltp_enc.c index 5e6ecbf4f8..af3c5d529f 100644 --- a/lib_enc/tcx_ltp_enc.c +++ b/lib_enc/tcx_ltp_enc.c @@ -114,9 +114,7 @@ static void tcx_ltp_pitch_search( int16_t *border_case ) { int16_t i, t, t0, t1, step, fraction, t0_min, t0_max, t_min, t_max, delta; -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH int16_t cor_idx_ini, cor_idx; -#endif float temp, cor_max, cor[256], *pt_cor; if ( pitres == 6 ) @@ -199,11 +197,7 @@ static void tcx_ltp_pitch_search( * the interpolated normalized correlation. *-----------------------------------------------------------------*/ -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH cor_idx_ini = L_INTERPOL1 - t0_min; -#else - pt_cor = cor + L_INTERPOL1 - t0_min; -#endif t0 = t1; if ( t0 >= pitfr2 ) { @@ -219,29 +213,17 @@ static void tcx_ltp_pitch_search( if ( t0 == t0_min ) /* Limit case */ { fraction = 0; -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH cor_idx = cor_idx_ini + t0; cor_max = interpolate_corr( &cor[cor_idx], fraction, pitres ); -#else - cor_max = interpolate_corr( &pt_cor[t0], fraction, pitres ); -#endif } else /* Process negative fractions */ { t0--; -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH cor_idx = cor_idx_ini + t0; cor_max = interpolate_corr( &cor[cor_idx], fraction, pitres ); -#else - cor_max = interpolate_corr( &pt_cor[t0], fraction, pitres ); -#endif for ( i = ( fraction + step ); i <= pitres - 1; i = i + step ) { -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH temp = interpolate_corr( &cor[cor_idx], i, pitres ); -#else - temp = interpolate_corr( &pt_cor[t0], i, pitres ); -#endif if ( temp > cor_max ) { cor_max = temp; @@ -250,16 +232,10 @@ static void tcx_ltp_pitch_search( } } -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH cor_idx = cor_idx_ini + t1; -#endif for ( i = 0; i <= pitres - 1; i = i + step ) /* Process positive fractions */ { -#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH temp = interpolate_corr( &cor[cor_idx], i, pitres ); -#else - temp = interpolate_corr( &pt_cor[t1], i, pitres ); -#endif if ( temp > cor_max ) { cor_max = temp; -- GitLab From a84a67d702b6a007b00895ae95f6d978569249a6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:53:23 +0100 Subject: [PATCH 07/26] [cleanup] accept FIX_2274_OOB_INDEXING_IN_CORRMATRIX --- lib_com/options.h | 1 - lib_enc/enc_acelp.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 72d8a0566f..57fbeba2a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ #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_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ diff --git a/lib_enc/enc_acelp.c b/lib_enc/enc_acelp.c index 75287a4d18..a83308a544 100644 --- a/lib_enc/enc_acelp.c +++ b/lib_enc/enc_acelp.c @@ -492,14 +492,10 @@ static void E_ACELP_corrmatrix( p3 = &rrixiy[2][pos]; p2 = &rrixiy[1][pos]; p1 = &rrixiy[0][pos]; -#ifdef FIX_2274_OOB_INDEXING_IN_CORRMATRIX p0 = &rrixiy[3][pos]; /* decrement pointer instead of indexing the array to avoid CLANG Usan complaint */ /* for last loop iteration, this points to rrixiy[3][-1], but is not actually accessed in later loop (k = 15 then, so inner loop will not run) */ p0 -= 16; -#else - p0 = &rrixiy[3][pos - 16]; -#endif cor = 0.0F; ptr_h1 = h; -- GitLab From d153767e61171b918c90d95cb7925d7c45a06073 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:54:01 +0100 Subject: [PATCH 08/26] [cleanup] accept FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH --- lib_com/options.h | 1 - lib_enc/enc_gain.c | 43 ------------------------------------------- 2 files changed, 44 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 57fbeba2a1..69a36111bf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#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_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1474_USAN_TRANS_INV /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */ diff --git a/lib_enc/enc_gain.c b/lib_enc/enc_gain.c index 28a72a1e6a..acbec79937 100644 --- a/lib_enc/enc_gain.c +++ b/lib_enc/enc_gain.c @@ -147,11 +147,7 @@ int16_t E_GAIN_closed_loop_search( { float corr_v[32 + 2 * L_INTERPOL1 + 1]; float cor_max, max_val, temp; -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH int16_t corr_idx; -#else - float *corr; -#endif int16_t i, fraction, frac1, frac2, step; int16_t t0, t_min, t_max; @@ -163,30 +159,16 @@ int16_t E_GAIN_closed_loop_search( t_min = t0_min - L_INTERPOL1; t_max = t0_max + L_INTERPOL1; -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH corr_idx = -t_min; -#else - /* allocate memory to normalized correlation vector */ - corr = &corr_v[-t_min]; /* corr[t_min..t_max] */ -#endif /* Compute normalized correlation between target and filtered excitation */ -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH norm_corr( exc, xn, h, t_min, t_max, &corr_v[0] + corr_idx, L_subfr ); -#else - norm_corr( exc, xn, h, t_min, t_max, corr, L_subfr ); -#endif /* find integer pitch */ -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH max_val = corr_v[t0_min + corr_idx]; -#else - max_val = corr[t0_min]; -#endif t0 = t0_min; for ( i = t0_min + 1; i <= t0_max; i++ ) { -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH float corr_tmp; corr_tmp = corr_v[corr_idx + i]; @@ -195,13 +177,6 @@ int16_t E_GAIN_closed_loop_search( max_val = corr_tmp; t0 = i; } -#else - if ( corr[i] >= max_val ) - { - max_val = corr[i]; - t0 = i; - } -#endif } /* If first subframe and t0 >= pit_fr1, do not search fractionnal pitch */ @@ -247,24 +222,14 @@ int16_t E_GAIN_closed_loop_search( frac2 = t0_max_frac; } assert( frac1 <= 0 && frac2 >= 0 && frac2 > frac1 ); -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH corr_idx += t0; -#endif if ( pit_res_max == 6 ) { -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH cor_max = E_GAIN_norm_corr_interpolate6( &corr_v[corr_idx], frac1 ); -#else - cor_max = E_GAIN_norm_corr_interpolate6( &corr[t0], frac1 ); -#endif fraction = frac1; for ( i = ( frac1 + step ); i <= frac2; i += step ) { -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH temp = E_GAIN_norm_corr_interpolate6( &corr_v[corr_idx], i ); -#else - temp = E_GAIN_norm_corr_interpolate6( &corr[t0], i ); -#endif if ( temp > cor_max ) { cor_max = temp; @@ -274,19 +239,11 @@ int16_t E_GAIN_closed_loop_search( } else { -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH cor_max = E_GAIN_norm_corr_interpolate( &corr_v[corr_idx], frac1 ); -#else - cor_max = E_GAIN_norm_corr_interpolate( &corr[t0], frac1 ); -#endif fraction = frac1; for ( i = ( frac1 + step ); i <= frac2; i += step ) { -#ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH temp = E_GAIN_norm_corr_interpolate( &corr_v[corr_idx], i ); -#else - temp = E_GAIN_norm_corr_interpolate( &corr[t0], i ); -#endif if ( temp > cor_max ) { cor_max = temp; -- GitLab From 0653c5d94a33ac6c190b39d343723f3527e3aa6f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:54:56 +0100 Subject: [PATCH 09/26] [cleanup] accept FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE --- lib_com/options.h | 1 - lib_dec/ivas_mct_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 69a36111bf..42d1efbafb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1474_USAN_TRANS_INV /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */ #define FIX_2268_OOB_INDEXING_IN_IFFT /* VA: Fix for issue 2268, to silence clang18 */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index b23ad94c98..51e53aa98f 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -564,11 +564,7 @@ ivas_error mct_dec_reconfigure( hMCT->hBlockData[n]->ch2 = 0; /* MDCT stereo initialization */ -#ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) -#else - if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } -- GitLab From e314d889634818911a215b7ac3f44e62750ff9bb Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:56:54 +0100 Subject: [PATCH 10/26] [cleanup] accept FIX_1474_USAN_TRANS_INV --- lib_com/options.h | 1 - lib_com/trans_direct.c | 16 ---------------- lib_com/trans_inv.c | 16 ---------------- 3 files changed, 33 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 42d1efbafb..0981ad9bba 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_1474_USAN_TRANS_INV /* Eri: Fix USAN out-of-bounds warning. No OOB occurs, but the pointer is set to point to uninitialized memory. */ #define FIX_2268_OOB_INDEXING_IN_IFFT /* VA: Fix for issue 2268, to silence clang18 */ #define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ #define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ diff --git a/lib_com/trans_direct.c b/lib_com/trans_direct.c index 540d6ec751..ff41f1b7b0 100644 --- a/lib_com/trans_direct.c +++ b/lib_com/trans_direct.c @@ -101,30 +101,18 @@ void direct_transform( in32_r16[L - 1 - i] = in32[i]; } -#ifndef FIX_1474_USAN_TRANS_INV - iseg = in32_r16 - segment_length / 4; -#endif oseg = out32; wh = win + segment_length / 4; wl = win + segment_length / 4 - 1; -#ifdef FIX_1474_USAN_TRANS_INV sh = in32_r16 + 2 * segment_length / 4; sl = in32_r16 + 2 * segment_length / 4 - 1; -#else - sh = iseg + 3 * segment_length / 4; - sl = iseg + 3 * segment_length / 4 - 1; -#endif for ( i = 0; i < segment_length / 4; i++ ) { dctin32[i] = ( ( *wl-- * *sl-- ) - ( *wh++ * *sh++ ) ); } -#ifdef FIX_1474_USAN_TRANS_INV sl = in32_r16 + segment_length / 4 - 1; -#else - sl = iseg + segment_length / 2 - 1; -#endif for ( i = 0; i < segment_length / 4; i++ ) { @@ -133,11 +121,7 @@ void direct_transform( edct( dctin32, oseg, segment_length / 2, element_mode ); -#ifdef FIX_1474_USAN_TRANS_INV iseg = in32_r16 + segment_length / 4; -#else - iseg = iseg + segment_length / 2; -#endif oseg = oseg + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) diff --git a/lib_com/trans_inv.c b/lib_com/trans_inv.c index 183595767c..6c90b688f0 100644 --- a/lib_com/trans_inv.c +++ b/lib_com/trans_inv.c @@ -838,38 +838,22 @@ void inverse_transform( } } -#ifdef FIX_1474_USAN_TRANS_INV out_segment = out_alias; -#else - out_segment = out_alias - segment_length / 4; -#endif in_segment = in_mdct_modif; iedct_short( in_segment, alias, segment_length, element_mode ); for ( ta = segment_length / 4; ta < segment_length / 2; ta++ ) { -#ifdef FIX_1474_USAN_TRANS_INV *out_segment++ = alias[ta]; -#else - out_segment[ta] = alias[ta]; -#endif } for ( ta = segment_length / 2; ta < segment_length; ta++ ) { -#ifdef FIX_1474_USAN_TRANS_INV *out_segment++ = alias[ta] * win[ta]; -#else - out_segment[ta] = alias[ta] * win[ta]; -#endif } -#ifdef FIX_1474_USAN_TRANS_INV out_segment = out_alias + segment_length / 4; -#else - out_segment = out_segment + segment_length / 2; -#endif in_segment = in_segment + segment_length / 2; for ( seg = 1; seg < NUM_TIME_SWITCHING_BLOCKS - 1; seg++ ) -- GitLab From 73740e3d19e76e17a01c87ccde5028c3b2361823 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:57:42 +0100 Subject: [PATCH 11/26] [cleanup] accept FIX_2268_OOB_INDEXING_IN_IFFT --- lib_com/ifft_rel.c | 2 -- lib_com/options.h | 1 - 2 files changed, 3 deletions(-) diff --git a/lib_com/ifft_rel.c b/lib_com/ifft_rel.c index f2d07669c7..703907f5b9 100644 --- a/lib_com/ifft_rel.c +++ b/lib_com/ifft_rel.c @@ -130,12 +130,10 @@ void ifft_rel( id = 4 * id; } step = N_MAX_FFT / n2; -#ifdef FIX_2268_OOB_INDEXING_IN_IFFT if ( n8 < 2 ) { continue; } -#endif s = sincos_t_ext + step; c = s + N_MAX_FFT / 4; s3 = sincos_t_ext + 3 * step; diff --git a/lib_com/options.h b/lib_com/options.h index 0981ad9bba..d2500da35e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_2268_OOB_INDEXING_IN_IFFT /* VA: Fix for issue 2268, to silence clang18 */ #define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ #define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ #define FIX_2249_MEMORY_LEAK_IN_SBA /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */ -- GitLab From c414a1d572ee446763adcbf2feaf5f2539dc6e8f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:58:24 +0100 Subject: [PATCH 12/26] [cleanup] accept FIX_2271_OOB_INDEXING_IN_PIT_OL2 --- lib_com/options.h | 1 - lib_enc/pitch_ol2.c | 23 ----------------------- 2 files changed, 24 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d2500da35e..bee3a4d784 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ #define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ #define FIX_2249_MEMORY_LEAK_IN_SBA /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */ #define FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR /* Eri: When no PVQ bands are selected in peaq_vq_enc, the number of bands is not initialized. */ diff --git a/lib_enc/pitch_ol2.c b/lib_enc/pitch_ol2.c index 8290e8c785..4ba1fe0d50 100644 --- a/lib_enc/pitch_ol2.c +++ b/lib_enc/pitch_ol2.c @@ -72,9 +72,7 @@ void pitch_ol2( int16_t i, t, t0, t1, step, fraction, t0_min, t0_max, t_min, t_max; float temp, cor_max, enr_wsp, enr_old, cor[COR_BUF_LEN], *pt_cor, wsp_fr[L_SUBFR]; const float *pt_wsp; -#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2 int16_t base_idx; -#endif t0_min = pitch_ol - delta; t0_max = pitch_ol + delta - 1; @@ -116,40 +114,23 @@ void pitch_ol2( * the interpolated normalized correlation. *-----------------------------------------------------------------*/ -#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 - pt_cor = cor + L_INTERPOL1 - t0_min; -#endif t0 = t1; -#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2 base_idx = L_INTERPOL1 - t0_min; -#endif step = 1; /* 1/4 subsample resolution */ fraction = 1; if ( t0 == t0_min ) /* Limit case */ { fraction = 0; -#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 - cor_max = interpolation( &pt_cor[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#else cor_max = interpolation( &cor[t0 + base_idx], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#endif } else /* Process negative fractions */ { t0--; -#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 - cor_max = interpolation( &pt_cor[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#else cor_max = interpolation( &cor[t0 + base_idx], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#endif for ( i = ( fraction + step ); i <= 3; i = i + step ) { -#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 - temp = interpolation( &pt_cor[t0], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#else temp = interpolation( &cor[t0 + base_idx], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#endif if ( temp > cor_max ) { cor_max = temp; @@ -160,11 +141,7 @@ void pitch_ol2( for ( i = 0; i <= 3; i = i + step ) /* Process positive fractions */ { -#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2 - temp = interpolation( &pt_cor[t1], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#else temp = interpolation( &cor[t1 + base_idx], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#endif if ( temp > cor_max ) { cor_max = temp; -- GitLab From 6539680bee0fd76cf91549fc7b1a1cfc31ba4722 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:59:02 +0100 Subject: [PATCH 13/26] [cleanup] accept FIX_2273_OOB_INDEXING_IN_PIT_FR4 --- lib_com/options.h | 1 - lib_enc/pit_enc.c | 42 ------------------------------------------ 2 files changed, 43 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index bee3a4d784..c65131dc4b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ #define FIX_2249_MEMORY_LEAK_IN_SBA /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */ #define FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR /* Eri: When no PVQ bands are selected in peaq_vq_enc, the number of bands is not initialized. */ #define FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE /* Eri: Initializes a variable in HQ decoder. It is not used, but is passed uninitialized to a function which is caught by clang-18 */ diff --git a/lib_enc/pit_enc.c b/lib_enc/pit_enc.c index 4ba9b53886..1ec857b72c 100644 --- a/lib_enc/pit_enc.c +++ b/lib_enc/pit_enc.c @@ -443,9 +443,7 @@ int16_t pitch_fr4( int16_t t0, t1, t_min, t_max, pit_min; float cor_max, max_val, temp; float *corr, corr_v[15 + 2 * L_INTERPOL1 + 1]; -#ifdef FIX_2273_OOB_INDEXING_IN_PIT_FR4 int16_t corr_off; -#endif /* initialization */ if ( limit_flag == 0 ) @@ -486,45 +484,25 @@ int16_t pitch_fr4( t_min = t0_min - L_INTERPOL1; t_max = t0_max + L_INTERPOL1; -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - corr = &corr_v[0] - t_min; /* corr[t_min..t_max] */ -#else corr = corr_v; corr_off = -t_min; -#endif -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - norm_corr( exc, xn, h, t_min, t_max, corr, L_subfr ); -#else norm_corr( exc, xn, h, t_min, t_max, corr + corr_off, L_subfr ); -#endif /*-----------------------------------------------------------------* * Find integer pitch *-----------------------------------------------------------------*/ -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - max_val = corr[t0_min]; -#else max_val = corr[t0_min + corr_off]; -#endif t0 = t0_min; for ( i = t0_min + 1; i <= t0_max; i++ ) { -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - if ( corr[i] >= max_val ) - { - max_val = corr[i]; - t0 = i; - } -#else if ( corr[i + corr_off] >= max_val ) { max_val = corr[i + corr_off]; t0 = i; } -#endif } if ( t0_fr1 == pit_min ) @@ -537,11 +515,7 @@ int16_t pitch_fr4( { i -= 2; } -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - if ( corr[i] > corr[i + 2] ) -#else if ( corr[i + corr_off] > corr[i + 2 + corr_off] ) -#endif { t0 = i; } @@ -580,27 +554,15 @@ int16_t pitch_fr4( if ( t0 == t0_min ) /* Limit case */ { fraction = 0; -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - cor_max = interpolation( &corr[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#else cor_max = interpolation( &corr[t0 + corr_off], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#endif } else /* Process negative fractions */ { t0--; -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - cor_max = interpolation( &corr[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#else cor_max = interpolation( &corr[t0 + corr_off], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 ); -#endif for ( i = ( fraction + step ); i <= 3; i = i + step ) { -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - temp = interpolation( &corr[t0], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#else temp = interpolation( &corr[t0 + corr_off], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#endif if ( temp > cor_max ) { cor_max = temp; @@ -611,11 +573,7 @@ int16_t pitch_fr4( for ( i = 0; i <= 3; i = i + step ) /* Process positive fractions */ { -#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4 - temp = interpolation( &corr[t1], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#else temp = interpolation( &corr[t1 + corr_off], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 ); -#endif if ( temp > cor_max ) { cor_max = temp; -- GitLab From a0f3cb3b7b0e18b6d3ee84503930e7f90e948d93 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 09:59:50 +0100 Subject: [PATCH 14/26] [cleanup] accept FIX_2249_MEMORY_LEAK_IN_SBA --- apps/decoder.c | 55 ------ apps/renderer.c | 8 - lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 28 --- lib_dec/lib_dec.c | 12 -- lib_rend/ivas_crend.c | 3 - lib_rend/ivas_hrtf.c | 137 -------------- lib_rend/ivas_objectRenderer_mix.c | 25 --- lib_rend/ivas_prot_rend.h | 44 ----- lib_rend/ivas_reverb.c | 4 - lib_rend/ivas_stat_rend.h | 13 -- lib_rend/lib_rend.c | 23 --- lib_util/hrtf_file_reader.c | 282 ----------------------------- lib_util/hrtf_file_reader.h | 14 -- 14 files changed, 649 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 659ac0fc39..51f1452b37 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -159,11 +159,6 @@ typedef struct hrtfFileReader *hrtfReader; char *hrtfFileName; -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD; - - IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; -#endif IVAS_BIN_RENDERER_TYPE binaural_renderer; IVAS_BIN_RENDERER_TYPE binaural_renderer_old; IVAS_BIN_RENDERER_TYPE binaural_renderer_sec; @@ -243,10 +238,6 @@ int main( enable_float_exception_trap( FLE_MASK_DENORM | FLE_MASK_UNDERFLOW ); #endif -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ - hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ -#endif splitRendBits.bits_buf = splitRendBitsBuf; /*------------------------------------------------------------------------------------------* @@ -859,13 +850,6 @@ cleanup: #ifdef DEBUG_SBA_AUDIO_DUMP IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels ); -#endif -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - if ( arg.hrtfReaderEnabled ) - { - destroy_td_hrtf( hHrtfBinary.hHrtfTD ); - destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); - } #endif IVAS_DEC_Close( &hIvasDec ); @@ -4162,12 +4146,6 @@ static ivas_error load_hrtf_from_file( * Release HRTF binary data *------------------------------------------------------------------------------------------*/ -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - if ( !( binaural_renderer == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && binaural_renderer_sec != IVAS_BIN_RENDERER_TYPE_TDREND && hHrtfBinary->hHrtfTD != NULL ) - { - destroy_td_hrtf( hHrtfBinary->hHrtfTD ); - } -#endif if ( ( error = IVAS_DEC_HRTF_binary_close( hIvasDec, hHrtfBinary->binaural_renderer_old ) ) != IVAS_ERR_OK ) { return error; @@ -4190,22 +4168,14 @@ static ivas_error load_hrtf_from_file( if ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer_sec == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; if ( ( error = IVAS_DEC_GetHrtfTDrendHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetHrtfTDrendHandle( hIvasDec, &hHrtfBinary->hHrtfTD ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_GetHrtfTDrendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = load_TDrend_HRTF_binary( *hHrtfTD, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_TDrend_HRTF_binary( *hHrtfBinary->hHrtfTD, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -4214,11 +4184,7 @@ static ivas_error load_hrtf_from_file( } else { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA destroy_td_hrtf( hHrtfTD ); -#else - destroy_td_hrtf( hHrtfBinary->hHrtfTD ); -#endif } } } @@ -4291,32 +4257,17 @@ static ivas_error load_hrtf_from_file( } } } -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - } -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) && OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else - if ( hHrtfBinary->hHrtfStatistics == NULL && ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) && OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfBinary->hHrtfStatistics ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_GetHrtfStatisticsHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = load_HrtfStatistics_from_binary( *hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_reverb_binary( *hHrtfBinary->hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -4325,17 +4276,11 @@ static ivas_error load_hrtf_from_file( } else { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA destroy_hrtf_statistics( hHrtfStatistics ); -#else - destroy_hrtf_statistics( hHrtfBinary->hHrtfStatistics ); -#endif } } } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA } -#endif return IVAS_ERR_OK; } diff --git a/apps/renderer.c b/apps/renderer.c index 0778167c86..13c327315f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1076,11 +1076,7 @@ int main( fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" ); goto cleanup; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = load_HrtfStatistics_from_binary( *hHrtfStatistics, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_reverb_binary( *hHrtfStatistics, args.sampleRate, hrtfFileReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -2100,10 +2096,6 @@ cleanup: RotationFileReader_close( &referenceRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - destroy_td_hrtf( hHrtfTD ); - destroy_hrtf_statistics( hHrtfStatistics ); -#endif IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); RenderConfigReader_close( &renderConfigReader ); diff --git a/lib_com/options.h b/lib_com/options.h index c65131dc4b..5cd85859a8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_2249_MEMORY_LEAK_IN_SBA /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */ #define FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR /* Eri: When no PVQ bands are selected in peaq_vq_enc, the number of bands is not initialized. */ #define FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE /* Eri: Initializes a variable in HQ decoder. It is not used, but is passed uninitialized to a function which is caught by clang-18 */ #define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 26431ae437..a56ac25683 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1500,17 +1500,10 @@ ivas_error ivas_init_decoder( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_reverb_HRTF_statistics_open( &( st_ivas->hHrtfStatistics ), output_Fs ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_HRTF_statistics_init( &st_ivas->hHrtfStatistics, output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /* Get default reverb values based on format, if custom values were not given */ if ( st_ivas->hDecoderConfig->Opt_RendConfigCustom == 0 ) @@ -2988,29 +2981,12 @@ void ivas_destroy_dec( ivas_combined_orientation_close( &st_ivas->hCombinedOrientationData ); /* Time Domain binaural renderer handle */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_td_binaural_close( &st_ivas->hBinRendererTd ); ivas_HRTF_td_binary_close( &st_ivas->hHrtfTD ); -#else - if ( st_ivas->hBinRendererTd != NULL ) - { - ivas_td_binaural_close( &st_ivas->hBinRendererTd ); - } - - if ( st_ivas->hHrtfTD != NULL ) - { - BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval ); - ivas_HRTF_binary_close( &st_ivas->hHrtfTD ); - } -#endif /* CRend binaural renderer handle */ ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); -#endif /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close( &st_ivas->hHrtfFastConv ); @@ -3019,11 +2995,7 @@ void ivas_destroy_dec( ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin ); /* HRTF statistics */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_statistics_binary_close( &st_ivas->hHrtfStatistics ); -#else - ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics ); -#endif /* Config. Renderer */ ivas_render_config_close( &( st_ivas->hRenderConfig ) ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 7e8fbb19dc..701b3724db 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2923,11 +2923,7 @@ ivas_error IVAS_DEC_HRTF_binary_open( /* TD binaural renderer */ if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfTD == NULL ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_td_binary_open( &( st_ivas->hHrtfTD ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_binary_open( &( st_ivas->hHrtfTD ) ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2997,11 +2993,7 @@ ivas_error IVAS_DEC_HRTF_binary_close( { if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_td_binary_close( &st_ivas->hHrtfTD ); -#else - ivas_HRTF_binary_close( &st_ivas->hHrtfTD ); -#endif } if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) @@ -3012,10 +3004,6 @@ ivas_error IVAS_DEC_HRTF_binary_close( if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) { -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); -#endif /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close( &st_ivas->hHrtfFastConv ); } diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 6acca9bccc..a0457281b6 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1477,9 +1477,6 @@ void ivas_rend_closeCldfbRend( ivas_binRenderer_close( &pCldfbRend->hCldfbRend ); -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - ivas_binaural_hrtf_close( &pCldfbRend->hHrtfFastConv ); -#endif ivas_HRTF_fastconv_binary_close( &pCldfbRend->hHrtfFastConv ); return; diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 46eaf2401c..144228b50b 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -37,9 +37,6 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_prot.h" -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA -#include "ivas_rom_binaural_crend_head.h" -#endif /*-----------------------------------------------------------------------* @@ -48,13 +45,8 @@ * Allocate HRTF binary handle for TD renderer *-----------------------------------------------------------------------*/ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_HRTF_td_binary_open( TDREND_HRFILT_FiltSet_t **hHrtfTD ) -#else -ivas_error ivas_HRTF_binary_open( - TDREND_HRFILT_FiltSet_t **hHrtfTD ) -#endif { /* Allocate HR filter set for headphones configuration */ *hHrtfTD = (TDREND_HRFILT_FiltSet_t *) malloc( sizeof( TDREND_HRFILT_FiltSet_t ) ); @@ -75,20 +67,14 @@ ivas_error ivas_HRTF_binary_open( * Close HRTF binary handle for TD renderer *-------------------------------------------------------------------*/ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA void ivas_HRTF_td_binary_close( TDREND_HRFILT_FiltSet_t **hHrtfTD ) -#else -void ivas_HRTF_binary_close( - TDREND_HRFILT_FiltSet_t **hHrtfTD ) -#endif { if ( hHrtfTD == NULL || *hHrtfTD == NULL ) { return; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA int16_t i; if ( ( *hHrtfTD )->ModelParams.modelROM ) @@ -141,7 +127,6 @@ void ivas_HRTF_binary_close( free( ( *hHrtfTD )->ModelEval.hrfModL ); free( ( *hHrtfTD )->ModelEval.hrfModR ); } -#endif free( *hHrtfTD ); *hHrtfTD = NULL; @@ -173,7 +158,6 @@ ivas_error ivas_HRTF_CRend_binary_open( return IVAS_ERR_OK; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open_buffers_int16() @@ -196,7 +180,6 @@ ivas_error ivas_HRTF_binary_open_buffers_int16( return IVAS_ERR_OK; } -#endif /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open_buffers_uint16() @@ -204,17 +187,10 @@ ivas_error ivas_HRTF_binary_open_buffers_int16( * Allocate buffer with dynamic length for HRTF binary tables *-----------------------------------------------------------------------*/ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_HRTF_binary_open_buffers_uint16( uint16_t **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ ) -#else -ivas_error ivas_HRTF_CRend_binary_open_buffers_uint16( - uint16_t **buffer, /* o : buffer to allocate */ - const uint32_t mem_size /* i : size of buffer */ -) -#endif { *buffer = (uint16_t *) malloc( mem_size ); @@ -233,17 +209,10 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_uint16( * Allocate buffer with dynamic length for HRTF binary tables *-----------------------------------------------------------------------*/ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_HRTF_binary_open_buffers_float( float **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ ) -#else -ivas_error ivas_HRTF_CRend_binary_open_buffers_float( - float **buffer, /* o : buffer to allocate */ - const uint32_t mem_size /* i : size of buffer */ -) -#endif { *buffer = (float *) malloc( mem_size ); @@ -255,7 +224,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( return IVAS_ERR_OK; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open_buffers_float_ptr() @@ -299,7 +267,6 @@ ivas_error ivas_HRTF_binary_open_buffers_float_ptr_const( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -394,10 +361,8 @@ void ivas_HRTF_fastconv_binary_close( return; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( hHrtfFastConv ); -#endif free( *hHrtfFastConv ); *hHrtfFastConv = NULL; @@ -462,9 +427,7 @@ ivas_error ivas_HRTF_statistics_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA set_c( (int8_t *) ( *hHrtfStatistics ), 0, (int32_t) sizeof( HRTFS_STATISTICS ) ); -#endif return IVAS_ERR_OK; } @@ -476,20 +439,14 @@ ivas_error ivas_HRTF_statistics_binary_open( * Close HRTF binary handle for statistics handler *-----------------------------------------------------------------------*/ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA void ivas_HRTF_statistics_binary_close( HRTFS_STATISTICS **hHrtfStatistics ) -#else -void ivas_HRTF_statistics_close( - HRTFS_STATISTICS **hHrtfStatistics ) -#endif { if ( hHrtfStatistics == NULL || *hHrtfStatistics == NULL ) { return; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) ) { if ( ( *hHrtfStatistics )->average_energy_l_dyn != NULL ) @@ -505,7 +462,6 @@ void ivas_HRTF_statistics_close( free( ( *hHrtfStatistics )->inter_aural_coherence_dyn ); } } -#endif free( *hHrtfStatistics ); *hHrtfStatistics = NULL; @@ -513,96 +469,3 @@ void ivas_HRTF_statistics_close( return; } -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA -/*-----------------------------------------------------------------------* - * ivas_HRTF_statistics_init_from_rom() - * - * Allocates HRTF statistics handle and initializes from ROM - *-----------------------------------------------------------------------*/ - -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA -ivas_error ivas_HRTF_statistics_init_from_rom( - HRTFS_STATISTICS_HANDLE *hHrtfStatistics, - const int32_t sampleRate ) -#else -ivas_error ivas_HRTF_statistics_init( - HRTFS_STATISTICS_HANDLE *hHrtfStatistics, - const int32_t sampleRate ) -#endif -{ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA - if ( hHrtfStatistics == NULL || *hHrtfStatistics == NULL ) - { - /* Tables not initialised */ - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - switch ( sampleRate ) - { - case 48000: - ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_48kHz; - ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_48kHz; - ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_48kHz; - break; - case 32000: - ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_32kHz; - ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_32kHz; - ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_32kHz; - break; - case 16000: - ( *hHrtfStatistics )->average_energy_l = defaultHRIR_left_avg_power_16kHz; - ( *hHrtfStatistics )->average_energy_r = defaultHRIR_right_avg_power_16kHz; - ( *hHrtfStatistics )->inter_aural_coherence = defaultHRIR_coherence_16kHz; - break; - default: - ( *hHrtfStatistics )->average_energy_l = NULL; - ( *hHrtfStatistics )->average_energy_r = NULL; - ( *hHrtfStatistics )->inter_aural_coherence = NULL; - break; - } - ( *hHrtfStatistics )->fromROM = TRUE; -#else - HRTFS_STATISTICS *HrtfStatistics; - - if ( hHrtfStatistics != NULL && *hHrtfStatistics != NULL ) - { - /* Tables already loaded from file */ - return IVAS_ERR_OK; - } - - /* Initialise tables from ROM */ - if ( ( HrtfStatistics = (HRTFS_STATISTICS *) malloc( sizeof( HRTFS_STATISTICS ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for statistics HRTF tables!" ); - } - - HrtfStatistics->average_energy_l = NULL; - HrtfStatistics->average_energy_r = NULL; - HrtfStatistics->inter_aural_coherence = NULL; - - switch ( sampleRate ) - { - case 48000: - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz; - HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz; - HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_48kHz; - break; - case 32000: - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_32kHz; - HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_32kHz; - HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_32kHz; - break; - case 16000: - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_16kHz; - HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_16kHz; - HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_16kHz; - break; - } - HrtfStatistics->fromROM = TRUE; - - *hHrtfStatistics = HrtfStatistics; - -#endif - return IVAS_ERR_OK; -} -#endif diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index d9120b60c8..5177502060 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -144,31 +144,6 @@ void TDREND_MIX_Dealloc( { BSplineModelEvalDealloc( &hBinRendererTd->HrFiltSet_p->ModelParams, &hBinRendererTd->HrFiltSet_p->ModelEval ); } -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - else - { - if ( hBinRendererTd->HrFiltSet_p->Elev_p != NULL ) - { - free( hBinRendererTd->HrFiltSet_p->Elev_p ); - hBinRendererTd->HrFiltSet_p->Elev_p = NULL; - } - if ( hBinRendererTd->HrFiltSet_p->Azim_p != NULL ) - { - free( hBinRendererTd->HrFiltSet_p->Azim_p ); - hBinRendererTd->HrFiltSet_p->Azim_p = NULL; - } - if ( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p != NULL ) - { - free( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p ); - hBinRendererTd->HrFiltSet_p->LeftFiltSet_p = NULL; - } - if ( hBinRendererTd->HrFiltSet_p->RightFiltSet_p != NULL ) - { - free( hBinRendererTd->HrFiltSet_p->RightFiltSet_p ); - hBinRendererTd->HrFiltSet_p->RightFiltSet_p = NULL; - } - } -#endif if ( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == 1 ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 1b088371da..5499160ed4 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -555,7 +555,6 @@ void ivas_masa_ext_dirac_render( * HRTF *----------------------------------------------------------------------------------*/ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_HRTF_td_binary_open( TDREND_HRFILT_FiltSet_t **hHrtfTD /* i/o: TD renderer HRTF handle */ ); @@ -563,15 +562,6 @@ ivas_error ivas_HRTF_td_binary_open( void ivas_HRTF_td_binary_close( TDREND_HRFILT_FiltSet_t **hHrtfTD /* i/o: TD renderer HRTF handle */ ); -#else -ivas_error ivas_HRTF_binary_open( - TDREND_HRFILT_FiltSet_t **hHrtfTD /* i/o: TD renderer HRTF handle */ -); - -void ivas_HRTF_binary_close( - TDREND_HRFILT_FiltSet_t **hHrtfTD /* i/o: TD renderer HRTF handle */ -); -#endif ivas_error ivas_HRTF_fastconv_binary_open( HRTFS_FASTCONV **hHrtfFastConv /* i/o: FASTCONV HRTF structure */ @@ -593,7 +583,6 @@ ivas_error ivas_HRTF_CRend_binary_open( HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_HRTF_binary_open_buffers_uint16( uint16_t **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ @@ -603,14 +592,7 @@ ivas_error ivas_HRTF_binary_open_buffers_int16( int16_t **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ ); -#else -ivas_error ivas_HRTF_CRend_binary_open_buffers_uint16( - uint16_t **buffer, /* o : buffer to allocate */ - const uint32_t mem_size /* i : size of buffer */ -); -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_HRTF_binary_open_buffers_float( float **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ @@ -626,37 +608,13 @@ ivas_error ivas_HRTF_binary_open_buffers_float_ptr_const( const uint32_t mem_size /* i : size of buffer */ ); -#else -ivas_error ivas_HRTF_CRend_binary_open_buffers_float( - float **buffer, /* o : buffer to allocate */ - const uint32_t mem_size /* i : size of buffer */ -); -#endif void ivas_HRTF_CRend_binary_close( HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ ); -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA -ivas_error ivas_HRTF_statistics_init_from_rom( - HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ - const int32_t sampleRate ); /* i : Sample rate */ -#else -ivas_error ivas_HRTF_statistics_init( - HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ - const int32_t sampleRate /* i : Sample rate */ -); -#endif -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA void ivas_HRTF_statistics_binary_close( HRTFS_STATISTICS **hHrtfStatistics ); /* i/o: HRTF statistics structure */ -#else - void ivas_HRTF_statistics_close( - HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ -); -#endif ivas_error ivas_HRTF_statistics_binary_open( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ @@ -1016,12 +974,10 @@ void ivas_binaural_reverb_processSubframe( float outImag[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX] /* o : output CLDFB data imag */ ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_error ivas_reverb_HRTF_statistics_open( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* o : HRTF statistics handle */ const int32_t output_Fs /* i : output sampling rate */ ); -#endif ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index c0956405f0..2e6d192d9a 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -34,9 +34,7 @@ #include "options.h" #include "prot.h" #include "ivas_prot_rend.h" -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA #include "ivas_rom_binaural_crend_head.h" -#endif #include "ivas_cnst.h" #ifdef DEBUGGING #include "debug.h" @@ -126,7 +124,6 @@ typedef struct ivas_reverb_params_t static ivas_error calc_jot_t60_coeffs( float *pH_dB, const uint16_t nrFrequencies, float *pFrequencies, float *pCoeffA, float *pCoeffB, const float fNyquist ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA /*------------------------------------------------------------------------- * ivas_reverb_HRTF_statistics_open() @@ -185,7 +182,6 @@ ivas_error ivas_reverb_HRTF_statistics_open( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------- * binRend_rand() diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 598a70b4bf..88c7b912ad 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1032,20 +1032,7 @@ typedef struct typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct { int32_t SampleRate; /* Sample rate of the HR filter */ -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - int16_t NumPos; - int16_t NumElev; - float Dist; - float *ItdSet_p; -#endif int16_t FiltLength; -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - float *Azim_p; - float *Elev_p; - float *ItdSetNominal_p; - float *LeftFiltSet_p; - float *RightFiltSet_p; -#endif ModelParams_t ModelParams; ModelEval_t ModelEval; ModelParamsITD_t ModelParamsITD; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8782c1a65e..7aee28a5fa 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3306,11 +3306,7 @@ ivas_error IVAS_REND_Open( hIvasRend->hHrtfs.hHrtfStatistics = NULL; if ( asHrtfBinary ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_td_binary_open( &( hIvasRend->hHrtfs.hHrtfTD ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_binary_open( &( hIvasRend->hHrtfs.hHrtfTD ) ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3334,7 +3330,6 @@ ivas_error IVAS_REND_Open( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( hIvasRend->hHrtfs.hHrtfStatistics == NULL ) { /* Allocate and init HRTF statistics */ @@ -3343,12 +3338,6 @@ ivas_error IVAS_REND_Open( return error; } } -#else - if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } return IVAS_ERR_OK; @@ -8351,25 +8340,13 @@ void IVAS_REND_Close( ivas_external_orientation_close( &hIvasRend->hExternalOrientationData ); ivas_combined_orientation_close( &hIvasRend->hCombinedOrientationData ); -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( &hIvasRend->hHrtfs.hHrtfFastConv ); -#endif /* Parametric binauralizer HRTF filters */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_td_binary_close( &( hIvasRend->hHrtfs.hHrtfTD ) ); -#else - ivas_HRTF_binary_close( &( hIvasRend->hHrtfs.hHrtfTD ) ); -#endif ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hHrtfCrend ) ); ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_statistics_binary_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#else - ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#endif free( hIvasRend ); *phIvasRend = NULL; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 964109f4ba..8f76ffdf3c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -296,11 +296,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD( } fread( &modelITD->elevDim3, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &modelITD->elevKSeq_dyn, ( modelITD->elevDim3 - 2 ) * sizeof( float ) ); -#else - modelITD->elevKSeq_dyn = (float *) malloc( ( modelITD->elevDim3 - 2 ) * sizeof( float ) ); -#endif v_tmp16 = (int16_t *) malloc( ( modelITD->elevDim3 - 2 ) * sizeof( int16_t ) ); if ( modelITD->elevKSeq_dyn == NULL || v_tmp16 == NULL ) { @@ -316,11 +312,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD( free( v_tmp16 ); fread( &modelITD->azimDim3, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &modelITD->azimKSeq_dyn, ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( float ) ); -#else - modelITD->azimKSeq_dyn = (float *) malloc( ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( float ) ); /* basis functions are flipped around 180 deg, number of basis functions above/below is (N+1)/2 */ -#endif v_tmp16 = (int16_t *) malloc( ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( int16_t ) ); if ( modelITD->azimKSeq_dyn == NULL || v_tmp16 == NULL ) { @@ -336,11 +328,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD( free( v_tmp16 ); fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &modelITD->W_dyn, tmp * sizeof( float ) ); -#else - modelITD->W_dyn = (float *) malloc( tmp * sizeof( float ) ); -#endif if ( modelITD->W_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -361,21 +349,13 @@ static ivas_error TDREND_LoadBSplineBinaryITD( free( v_tmp16 ); /* azimuth */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &modelITD->azimBsLen_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#else - modelITD->azimBsLen_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#endif if ( modelITD->azimBsLen_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } fread( modelITD->azimBsLen_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &modelITD->azimBsStart_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#else - modelITD->azimBsStart_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#endif if ( modelITD->azimBsStart_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -383,11 +363,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD( fread( modelITD->azimBsStart_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &modelITD->azimBsShape_dyn, tmp * sizeof( float ) ); -#else - modelITD->azimBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); -#endif v_tmp16 = (int16_t *) malloc( tmp * sizeof( int16_t ) ); if ( modelITD->azimBsShape_dyn == NULL || v_tmp16 == NULL ) { @@ -405,21 +381,13 @@ static ivas_error TDREND_LoadBSplineBinaryITD( fread( &modelITD->azimSegSamples, sizeof( int16_t ), 1, f_hrtf ); /* elevation */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &modelITD->elevBsLen_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#else - modelITD->elevBsLen_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#endif if ( modelITD->elevBsLen_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } fread( modelITD->elevBsLen_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &modelITD->elevBsStart_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#else - modelITD->elevBsStart_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#endif if ( modelITD->elevBsStart_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -427,11 +395,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD( fread( modelITD->elevBsStart_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &modelITD->elevBsShape_dyn, tmp * sizeof( float ) ); -#else - modelITD->elevBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); -#endif if ( modelITD->elevBsShape_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -530,11 +494,7 @@ static ivas_error TDREND_LoadBSplineBinary( fread( &model->K, sizeof( int16_t ), 1, f_hrtf ); fread( &model->elevDim3, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->elevKSeq_dyn, ( model->elevDim3 - 2 ) * sizeof( float ) ); -#else - model->elevKSeq_dyn = (float *) malloc( ( model->elevDim3 - 2 ) * sizeof( float ) ); -#endif v_tmp16 = (int16_t *) malloc( ( model->elevDim3 - 2 ) * sizeof( int16_t ) ); if ( model->elevKSeq_dyn == NULL || v_tmp16 == NULL ) @@ -549,22 +509,10 @@ static ivas_error TDREND_LoadBSplineBinary( model->elevKSeq_dyn[j] = v_tmp16[j] * q_scale; } free( v_tmp16 ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->azimDim3_dyn, model->elevDim3 * sizeof( int16_t ) ); -#else - model->azimDim3_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->azim_start_idx_dyn, model->elevDim3 * sizeof( int16_t ) ); -#else - model->azim_start_idx_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float_ptr( &model->azimKSeq, model->elevDim3 * sizeof( float * ) ); -#else - model->azimKSeq = (float **) malloc( model->elevDim3 * sizeof( float * ) ); -#endif if ( model->azimDim3_dyn == NULL || model->azim_start_idx_dyn == NULL || model->azimKSeq == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -574,11 +522,7 @@ static ivas_error TDREND_LoadBSplineBinary( { fread( &model->azimDim3_dyn[i], sizeof( int16_t ), 1, f_hrtf ); fread( &model->azim_start_idx_dyn[i], sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->azimKSeq[i], ( model->azimDim3_dyn[i] + 1 ) * sizeof( float ) ); -#else - model->azimKSeq[i] = (float *) malloc( ( model->azimDim3_dyn[i] + 1 ) * sizeof( float ) ); -#endif v_tmp16 = (int16_t *) malloc( ( model->azimDim3_dyn[i] + 1 ) * sizeof( int16_t ) ); if ( model->azimKSeq[i] == NULL || v_tmp16 == NULL ) @@ -595,11 +539,7 @@ static ivas_error TDREND_LoadBSplineBinary( free( v_tmp16 ); } fread( &model->AlphaN, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->AlphaL_dyn, model->AlphaN * model->K * sizeof( float ) ); -#else - model->AlphaL_dyn = (float *) malloc( model->AlphaN * model->K * sizeof( float ) ); -#endif v_tmp16 = (int16_t *) malloc( model->AlphaN * model->K * sizeof( int16_t ) ); if ( model->AlphaL_dyn == NULL || v_tmp16 == NULL ) @@ -614,11 +554,7 @@ static ivas_error TDREND_LoadBSplineBinary( { model->AlphaL_dyn[j] = v_tmp16[j] * q_scale; /* Q14 */ } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->AlphaR_dyn, model->AlphaN * model->K * sizeof( float ) ); -#else - model->AlphaR_dyn = (float *) malloc( model->AlphaN * model->K * sizeof( float ) ); -#endif if ( model->AlphaR_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -634,21 +570,9 @@ static ivas_error TDREND_LoadBSplineBinary( /* azimuth */ fread( &model->num_unique_azim_splines, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float_ptr_const( &model->azimBsShape, model->num_unique_azim_splines * sizeof( float * ) ); -#else - model->azimBsShape = (const float **) malloc( model->num_unique_azim_splines * sizeof( float * ) ); -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float_ptr( &model->azimBsShape_dyn, model->num_unique_azim_splines * sizeof( float * ) ); -#else - model->azimBsShape_dyn = (float **) malloc( model->num_unique_azim_splines * sizeof( float * ) ); -#endif -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->azimSegSamples_dyn, model->num_unique_azim_splines * sizeof( int16_t ) ); -#else - model->azimSegSamples_dyn = (int16_t *) malloc( model->num_unique_azim_splines * sizeof( int16_t ) ); -#endif if ( model->azimBsShape == NULL || model->azimBsShape_dyn == NULL || model->azimSegSamples_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -657,11 +581,7 @@ static ivas_error TDREND_LoadBSplineBinary( for ( i = 0; i < model->num_unique_azim_splines; i++ ) { fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->azimBsShape_dyn[i], tmp * sizeof( float ) ); -#else - model->azimBsShape_dyn[i] = (float *) malloc( tmp * sizeof( float ) ); -#endif if ( model->azimBsShape_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -683,21 +603,13 @@ static ivas_error TDREND_LoadBSplineBinary( free( v_tmp16 ); } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->azimShapeIdx_dyn, model->elevDim3 * sizeof( int16_t ) ); -#else - model->azimShapeIdx_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); -#endif if ( model->azimShapeIdx_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } fread( model->azimShapeIdx_dyn, sizeof( int16_t ), model->elevDim3, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->azimShapeSampFactor_dyn, model->elevDim3 * sizeof( int16_t ) ); -#else - model->azimShapeSampFactor_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); -#endif if ( model->azimShapeSampFactor_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -705,21 +617,13 @@ static ivas_error TDREND_LoadBSplineBinary( fread( model->azimShapeSampFactor_dyn, sizeof( int16_t ), model->elevDim3, f_hrtf ); /* elevation */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->elevBsLen_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#else - model->elevBsLen_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#endif if ( model->elevBsLen_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } fread( model->elevBsLen_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_int16( &model->elevBsStart_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#else - model->elevBsStart_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); -#endif if ( model->elevBsStart_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -728,11 +632,7 @@ static ivas_error TDREND_LoadBSplineBinary( fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); v_tmp16 = (int16_t *) malloc( tmp * sizeof( int16_t ) ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->elevBsShape_dyn, tmp * sizeof( float ) ); -#else - model->elevBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); -#endif if ( model->elevBsShape_dyn == NULL || v_tmp16 == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -749,11 +649,7 @@ static ivas_error TDREND_LoadBSplineBinary( fread( &model->elevSegSamples, sizeof( int16_t ), 1, f_hrtf ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->EL_dyn, model->AlphaN * HRTF_MODEL_N_SECTIONS * sizeof( float ) ); -#else - model->EL_dyn = (float *) malloc( model->AlphaN * HRTF_MODEL_N_SECTIONS * sizeof( float ) ); -#endif if ( model->EL_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -767,11 +663,7 @@ static ivas_error TDREND_LoadBSplineBinary( model->EL_dyn[j] = ( (int32_t *) model->EL_dyn )[j] * q_scale; /* Q14 */ } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &model->ER_dyn, model->AlphaN * HRTF_MODEL_N_SECTIONS * sizeof( float ) ); -#else - model->ER_dyn = (float *) malloc( model->AlphaN * HRTF_MODEL_N_SECTIONS * sizeof( float ) ); -#endif if ( model->ER_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -805,13 +697,8 @@ static ivas_error TDREND_LoadBSplineBinary( HRTF_model_precalc( model ); HrFiltSet_p->FiltLength = HrFiltSet_p->ModelParams.K; -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &HrFiltSet_p->ModelEval.hrfModL, model->K * sizeof( float ) ); ivas_HRTF_binary_open_buffers_float( &HrFiltSet_p->ModelEval.hrfModR, model->K * sizeof( float ) ); -#else - HrFiltSet_p->ModelEval.hrfModL = (float *) malloc( model->K * sizeof( float ) ); - HrFiltSet_p->ModelEval.hrfModR = (float *) malloc( model->K * sizeof( float ) ); -#endif if ( HrFiltSet_p->ModelEval.hrfModL == NULL || HrFiltSet_p->ModelEval.hrfModR == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -925,15 +812,9 @@ static ivas_error load_reverb_from_binary( if ( is_reverb ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_binary_open_buffers_float( &hHrtfStatistics->average_energy_l_dyn, lr_iac_len * sizeof( float ) ); ivas_HRTF_binary_open_buffers_float( &hHrtfStatistics->average_energy_r_dyn, lr_iac_len * sizeof( float ) ); ivas_HRTF_binary_open_buffers_float( &hHrtfStatistics->inter_aural_coherence_dyn, lr_iac_len * sizeof( float ) ); -#else - hHrtfStatistics->average_energy_l_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); - hHrtfStatistics->average_energy_r_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); - hHrtfStatistics->inter_aural_coherence_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); -#endif if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_r_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -969,7 +850,6 @@ static ivas_error load_reverb_from_binary( return IVAS_ERR_OK; } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA /*---------------------------------------------------------------------* * load_HrtfStatistics_from_binary() * @@ -980,18 +860,6 @@ ivas_error load_HrtfStatistics_from_binary( const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ) -#else -/*---------------------------------------------------------------------* - * load_reverb_binary() - * - * Load HRTF binary data into the HRTF handle for TD and Crend renderers - *---------------------------------------------------------------------*/ -ivas_error load_reverb_binary( - IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ - const int32_t sampleRate, /* i : sample rate */ - const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ -) -#endif { if ( hrtfReader == NULL || hrtfReader->file == NULL || hHrtfStatistics == NULL ) { @@ -1165,65 +1033,7 @@ void destroy_td_hrtf( IVAS_DEC_HRTF_TD_HANDLE *hHrtf /* i/o: TD rend. HRTF handle */ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_td_binary_close( hHrtf ); -#else - int16_t i; - - if ( ( hHrtf == NULL ) || ( *hHrtf == NULL ) ) - { - return; - } - - if ( !( *hHrtf )->ModelParams.modelROM ) - { - if ( ( *hHrtf )->ModelParams.UseItdModel ) - { - free( ( *hHrtf )->ModelParamsITD.elevKSeq_dyn ); - free( ( *hHrtf )->ModelParamsITD.azimKSeq_dyn ); - free( ( *hHrtf )->ModelParamsITD.W_dyn ); - free( ( *hHrtf )->ModelParamsITD.azimBsShape_dyn ); - free( ( *hHrtf )->ModelParamsITD.elevBsShape_dyn ); - free( ( *hHrtf )->ModelParamsITD.azimBsLen_dyn ); - free( ( *hHrtf )->ModelParamsITD.azimBsStart_dyn ); - free( ( *hHrtf )->ModelParamsITD.elevBsLen_dyn ); - free( ( *hHrtf )->ModelParamsITD.elevBsStart_dyn ); - } - free( ( *hHrtf )->ModelParams.elevKSeq_dyn ); - free( ( *hHrtf )->ModelParams.azim_start_idx_dyn ); - free( ( *hHrtf )->ModelParams.azimDim3_dyn ); - free( ( *hHrtf )->ModelParams.AlphaL_dyn ); - free( ( *hHrtf )->ModelParams.AlphaR_dyn ); - free( ( *hHrtf )->ModelParams.azimSegSamples_dyn ); - - free( ( *hHrtf )->ModelParams.azimShapeIdx_dyn ); - free( ( *hHrtf )->ModelParams.azimShapeSampFactor_dyn ); - free( ( *hHrtf )->ModelParams.elevBsLen_dyn ); - free( ( *hHrtf )->ModelParams.elevBsStart_dyn ); - free( ( *hHrtf )->ModelParams.elevBsShape_dyn ); - - for ( i = 0; i < ( *hHrtf )->ModelParams.num_unique_azim_splines; i++ ) - { - free( ( *hHrtf )->ModelParams.azimBsShape_dyn[i] ); - } - free( ( *hHrtf )->ModelParams.azimBsShape_dyn ); - - free( (void *) ( *hHrtf )->ModelParams.azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ - for ( i = 0; i < ( *hHrtf )->ModelParams.elevDim3; i++ ) - { - free( ( *hHrtf )->ModelParams.azimKSeq[i] ); - } - free( ( *hHrtf )->ModelParams.azimKSeq ); - - free( ( *hHrtf )->ModelParams.EL_dyn ); - free( ( *hHrtf )->ModelParams.ER_dyn ); - - free( ( *hHrtf )->ModelEval.hrfModL ); - free( ( *hHrtf )->ModelEval.hrfModR ); - } - - ivas_HRTF_binary_close( hHrtf ); -#endif return; } @@ -1296,11 +1106,7 @@ static ivas_error create_Crend_HRTF_from_rawdata( { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_dyn[i][j], mem_size ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_dyn[i][j], mem_size ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1327,11 +1133,7 @@ static ivas_error create_Crend_HRTF_from_rawdata( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { mem_size = ( *hHRTF )->num_iterations_diffuse[j] * sizeof( uint16_t ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], mem_size ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], mem_size ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1375,11 +1177,7 @@ static ivas_error create_Crend_HRTF_from_rawdata( { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_re_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_re_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1406,11 +1204,7 @@ static ivas_error create_Crend_HRTF_from_rawdata( { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_im_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_im_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1445,11 +1239,7 @@ static ivas_error create_Crend_HRTF_from_rawdata( /* coeff_diffuse_re : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1474,11 +1264,7 @@ static ivas_error create_Crend_HRTF_from_rawdata( /* coeff_diffuse_im : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA if ( ( error = ivas_HRTF_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2172,51 +1958,7 @@ void destroy_crend_hrtf( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend /* i/o: Crend HRTF handle */ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_CRend_binary_close( hHrtfCrend ); -#else - uint16_t i, j; - - if ( *hHrtfCrend != NULL && hHrtfCrend != NULL ) - { - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHrtfCrend )->pIndex_frequency_max[i][j] != NULL ) - { - free( ( *hHrtfCrend )->pIndex_frequency_max_dyn[i][j] ); - } - if ( ( *hHrtfCrend )->pOut_to_bin_re[i][j] != NULL ) - { - free( ( *hHrtfCrend )->pOut_to_bin_re_dyn[i][j] ); - } - if ( ( *hHrtfCrend )->pOut_to_bin_im[i][j] != NULL ) - { - free( ( *hHrtfCrend )->pOut_to_bin_im_dyn[i][j] ); - } - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHrtfCrend )->pIndex_frequency_max_diffuse[j] != NULL ) - { - free( ( *hHrtfCrend )->pIndex_frequency_max_diffuse_dyn[j] ); - } - if ( ( *hHrtfCrend )->pOut_to_bin_diffuse_re[j] != NULL ) - { - free( ( *hHrtfCrend )->pOut_to_bin_diffuse_re_dyn[j] ); - } - if ( ( *hHrtfCrend )->pOut_to_bin_diffuse_im[j] != NULL ) - { - free( ( *hHrtfCrend )->pOut_to_bin_diffuse_im_dyn[j] ); - } - } - - free( *hHrtfCrend ); - *hHrtfCrend = NULL; - } -#endif return; } @@ -2232,10 +1974,6 @@ void destroy_fastconv_hrtf( IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* i/o: FastConv HRTF handle */ ) { -#ifndef FIX_2249_MEMORY_LEAK_IN_SBA - /* Fastconv HRTF memories */ - ivas_binaural_hrtf_close( hHrtfFastConv ); -#endif /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close( hHrtfFastConv ); @@ -2270,26 +2008,6 @@ void destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA ivas_HRTF_statistics_binary_close( hHrtfStatistics ); -#else - if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) ) - { - if ( ( *hHrtfStatistics )->average_energy_l != NULL ) - { - free( ( *hHrtfStatistics )->average_energy_l_dyn ); - } - if ( ( *hHrtfStatistics )->average_energy_r != NULL ) - { - free( ( *hHrtfStatistics )->average_energy_r_dyn ); - } - if ( ( *hHrtfStatistics )->inter_aural_coherence != NULL ) - { - free( ( *hHrtfStatistics )->inter_aural_coherence_dyn ); - } - } - - ivas_HRTF_statistics_close( hHrtfStatistics ); -#endif return; } diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 9508c3b172..7a39cac6b5 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -104,7 +104,6 @@ ivas_error load_TDrend_HRTF_binary( const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA /*---------------------------------------------------------------------* * load_HrtfStatistics_from_binary() * @@ -116,19 +115,6 @@ ivas_error load_HrtfStatistics_from_binary( const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); -#else -/*---------------------------------------------------------------------* - * load_reverb_binary() - * - * Load reverb binary data into the HRTF handle - *---------------------------------------------------------------------*/ - -ivas_error load_reverb_binary( - IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ - const int32_t sampleRate, /* i : sample rate */ - const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ -); -#endif /*---------------------------------------------------------------------* * load_Crend_HRTF_from_binary() -- GitLab From adb76a3e39f6598cb2055aa966e9286a0d9501f9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:00:30 +0100 Subject: [PATCH 15/26] [cleanup] accept FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR --- lib_com/hvq_pvq_bitalloc.c | 5 ----- lib_com/options.h | 1 - 2 files changed, 6 deletions(-) diff --git a/lib_com/hvq_pvq_bitalloc.c b/lib_com/hvq_pvq_bitalloc.c index 5f98538a84..5da8321421 100644 --- a/lib_com/hvq_pvq_bitalloc.c +++ b/lib_com/hvq_pvq_bitalloc.c @@ -80,9 +80,7 @@ int16_t hvq_pvq_bitalloc( int16_t num_sfm; int16_t bit_cost; -#ifdef FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR *n_sel_bands = 0; -#endif if ( bwidth == FB ) { @@ -138,9 +136,6 @@ int16_t hvq_pvq_bitalloc( return 0; } -#ifndef FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR - *n_sel_bands = 0; -#endif env_mean = 0; E_max = 0; k_max = k_start; diff --git a/lib_com/options.h b/lib_com/options.h index 5cd85859a8..51704a4a87 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR /* Eri: When no PVQ bands are selected in peaq_vq_enc, the number of bands is not initialized. */ #define FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE /* Eri: Initializes a variable in HQ decoder. It is not used, but is passed uninitialized to a function which is caught by clang-18 */ #define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ #define FIX_1478_UNINIT_ON_BFI /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */ -- GitLab From 974a62f35d019bed4ceb500895550696692907fa Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:01:12 +0100 Subject: [PATCH 16/26] [cleanup] accept FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE --- lib_com/options.h | 1 - lib_dec/hq_hr_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 51704a4a87..c946d86b24 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ -#define FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE /* Eri: Initializes a variable in HQ decoder. It is not used, but is passed uninitialized to a function which is caught by clang-18 */ #define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ #define FIX_1478_UNINIT_ON_BFI /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */ #define FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR /* Dolby: remove unused noise generator from ISAR */ diff --git a/lib_dec/hq_hr_dec.c b/lib_dec/hq_hr_dec.c index 9055a9e2e3..8616454082 100644 --- a/lib_dec/hq_hr_dec.c +++ b/lib_dec/hq_hr_dec.c @@ -137,9 +137,7 @@ void hq_hr_dec( HQ_DEC_HANDLE hHQ_core = st->hHQ_core; bits_left = num_bits; -#ifdef FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE hq_generic_offset = 0; -#endif /*------------------------------------------------------------------* * Initializations -- GitLab From 4cdfb7415b4c439ae10a428702daf3717152716a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:01:55 +0100 Subject: [PATCH 17/26] [cleanup] accept FIX_1478_UNINIT_ON_BFI --- lib_com/gs_noisefill.c | 12 ------------ lib_com/options.h | 1 - 2 files changed, 13 deletions(-) diff --git a/lib_com/gs_noisefill.c b/lib_com/gs_noisefill.c index 30dda50efb..b0aa5a0ad2 100644 --- a/lib_com/gs_noisefill.c +++ b/lib_com/gs_noisefill.c @@ -589,19 +589,11 @@ void highband_exc_dct_in( if ( bfi || core_brate < 6000 || ( core_brate < 8600 && coder_type == UNVOICED ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set_f( noisepb, 0.4f, MBANDS_GN ); -#else set_f( noisepb, 0.4f, last_bin ); -#endif } else if ( GSC_IVAS_mode == 3 || ( GSC_IVAS_mode > 0 && GSC_noisy_speech == 1 ) ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set_f( noisepb, 0.4f, MBANDS_GN16k ); -#else set_f( noisepb, 0.4f, last_bin ); -#endif } else { @@ -615,11 +607,7 @@ void highband_exc_dct_in( if ( GSC_IVAS_mode == 0 && GSC_noisy_speech && !bfi && element_mode <= IVAS_SCE ) { -#ifndef FIX_1478_UNINIT_ON_BFI - set_f( noisepb, 0.1f, MBANDS_GN ); -#else set_f( noisepb, 0.1f, last_bin ); -#endif } if ( core_brate < 6000 && coder_type <= UNVOICED ) diff --git a/lib_com/options.h b/lib_com/options.h index c946d86b24..c6be5d36b9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,6 @@ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ -#define FIX_1478_UNINIT_ON_BFI /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */ #define FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR /* Dolby: remove unused noise generator from ISAR */ #define FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX /* FhG/VA: init nb_bits_metadata to zero */ #define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* FhG: fix oob indexing */ -- GitLab From 3de97bf1736966579d155b9ebab6b8c7dbe19d40 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:02:38 +0100 Subject: [PATCH 18/26] [cleanup] accept FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX --- lib_com/options.h | 1 - lib_dec/ivas_ism_dtx_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c6be5d36b9..ff64908a67 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ #define FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR /* Dolby: remove unused noise generator from ISAR */ -#define FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX /* FhG/VA: init nb_bits_metadata to zero */ #define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* FhG: fix oob indexing */ #define FIX_1494_SET_SPLITBFI_UNUSED /* Dolby: Fix issue 1494, remove unused function setting BFI flag in ISAR renderer */ #define FIX_1479_MSAN_SPAR_UNINITIALIZED_VALUE /* Dolby: Fix for issue 1479, MSAN error due to uninitialized value in SPAR */ diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index dc0b27813b..47db361a06 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -120,12 +120,10 @@ void ivas_ism_dtx_dec( nb_bits_metadata[ch] = nb_bits_metadata[sce_id_dtx]; } } -#ifdef FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX else { set_s( nb_bits_metadata, 0, st_ivas->nchan_transport ); } -#endif if ( !st_ivas->bfi ) { -- GitLab From cc82076402b40f4abf6938434de443641dbd601c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:03:10 +0100 Subject: [PATCH 19/26] [cleanup] accept FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING --- lib_com/options.h | 1 - lib_dec/dec_acelp.c | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ff64908a67..f96db4a77d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ #define FIX_1486_INIT_OUTPUT_POINTERS /* FhG: always initialize pointers in renderer flush */ #define FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR /* Dolby: Fix for issue 1449: renderer frame size unclear in ISAR */ #define FIX_1827_REMOVE_UNUSED_PSNOISEGEN_ISAR /* Dolby: remove unused noise generator from ISAR */ -#define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* FhG: fix oob indexing */ #define FIX_1494_SET_SPLITBFI_UNUSED /* Dolby: Fix issue 1494, remove unused function setting BFI flag in ISAR renderer */ #define FIX_1479_MSAN_SPAR_UNINITIALIZED_VALUE /* Dolby: Fix for issue 1479, MSAN error due to uninitialized value in SPAR */ #define REMOVE_UNUSED_CODE_IVAS_DEC /* VA: remove unused code in ivas_jbm_dec_tc_fx() */ diff --git a/lib_dec/dec_acelp.c b/lib_dec/dec_acelp.c index effde604f8..03ff59c400 100644 --- a/lib_dec/dec_acelp.c +++ b/lib_dec/dec_acelp.c @@ -171,18 +171,8 @@ void D_ACELP_indexing( } s = index_n[0]; pulses = pulsestrack[0]; -#ifndef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING - /* safety check in case of bit errors */ - if ( s >= pulsestostates[16][pulses - 1] ) - { - set_f( code, 0.0f, L_SUBFR ); - *BER_detect = 1; - return; - } -#endif if ( pulses ) { -#ifdef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* safety check in case of bit errors */ if ( s >= pulsestostates[16][pulses - 1] ) { @@ -190,7 +180,6 @@ void D_ACELP_indexing( *BER_detect = 1; return; } -#endif D_ACELP_decode_arithtrack( code, s, pulses, num_tracks, 16 ); } else -- GitLab From 1405816c8eef9867211ad20a726f4699fdae99f2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:04:00 +0100 Subject: [PATCH 20/26] [cleanup] accept FIX_1435_MOVE_STEREO_PANNING --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 25 ------------------------ lib_dec/ivas_output_config.c | 10 ---------- lib_dec/lib_dec.c | 37 ------------------------------------ 4 files changed, 73 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f96db4a77d..ec4e61d238 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_1435_MOVE_STEREO_PANNING /* VA: issue 1435: do the EVS stereo panning in the renderer */ #define FIX_1454_FIX_STEREO_TO_FOA_JBM /* VA: issue 1454: fix buggy stereo to FOA in JBM */ #define FIX_1461_CNG_BW_SWITCHING /* Eri: issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */ #define FIX_2252_LP_CNG_STARTS_SID /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index c2ba67d84f..033e768d08 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -959,12 +959,10 @@ ivas_error ivas_dec_render( { ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); } -#ifdef FIX_1435_MOVE_STEREO_PANNING else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { ivas_apply_non_diegetic_panning( p_tc[0], p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); } -#endif else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { #ifdef FIX_1454_FIX_STEREO_TO_FOA_JBM @@ -1973,15 +1971,11 @@ int16_t ivas_dec_get_num_tc_channels( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; -#ifdef FIX_1435_MOVE_STEREO_PANNING if ( st_ivas->ivas_format == MONO_FORMAT ) { num_tc = 1; } else if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) -#else - if ( st_ivas->ivas_format == STEREO_FORMAT && st_ivas->hDecoderConfig->nchan_out == 1 ) -#endif { num_tc = 1; } @@ -2090,12 +2084,6 @@ int16_t ivas_dec_get_num_tc_channels( } } } -#ifndef FIX_1435_MOVE_STEREO_PANNING - else if ( st_ivas->ivas_format == MONO_FORMAT && st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { - num_tc = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; - } -#endif return num_tc; } @@ -2559,9 +2547,7 @@ TC_BUFFER_MODE ivas_dec_get_tc_buffer_mode( case RENDERER_MONO_DOWNMIX: buffer_mode = TC_BUFFER_MODE_BUFFER; break; -#ifdef FIX_1435_MOVE_STEREO_PANNING case RENDERER_NON_DIEGETIC_DOWNMIX: -#endif case RENDERER_TD_PANNING: case RENDERER_BINAURAL_OBJECTS_TD: case RENDERER_BINAURAL_FASTCONV: @@ -2579,17 +2565,6 @@ TC_BUFFER_MODE ivas_dec_get_tc_buffer_mode( case RENDERER_OSBA_LS: buffer_mode = TC_BUFFER_MODE_RENDERER; break; -#ifndef FIX_1435_MOVE_STEREO_PANNING - case RENDERER_NON_DIEGETIC_DOWNMIX: - if ( st_ivas->ivas_format == MONO_FORMAT ) - { - buffer_mode = TC_BUFFER_MODE_BUFFER; - } - else - { - buffer_mode = TC_BUFFER_MODE_RENDERER; - } -#endif break; case RENDERER_MC_PARAMMC: if ( st_ivas->hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 09fa8052f1..be7f1c57e3 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -228,17 +228,9 @@ void ivas_renderer_select( * Non-binaural rendering configurations *-----------------------------------------------------------------*/ -#ifdef FIX_1435_MOVE_STEREO_PANNING else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT ) -#else - else if ( st_ivas->ivas_format == MONO_FORMAT ) -#endif { -#ifdef FIX_1435_MOVE_STEREO_PANNING if ( st_ivas->ivas_format == MONO_FORMAT && output_config == IVAS_AUDIO_CONFIG_STEREO ) -#else - if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) -#endif { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } @@ -246,13 +238,11 @@ void ivas_renderer_select( { *renderer_type = RENDERER_MC; } -#ifdef FIX_1435_MOVE_STEREO_PANNING else if ( st_ivas->ivas_format == STEREO_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { *renderer_type = RENDERER_SBA_LINEAR_ENC; } -#endif } else if ( st_ivas->ivas_format == ISM_FORMAT ) { diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 701b3724db..8dddc37a24 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2193,18 +2193,7 @@ static ivas_error ivas_dec_setup_all( if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { -#ifdef FIX_1435_MOVE_STEREO_PANNING *nTransportChannels = 1; -#else - if ( hIvasDec->st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { - *nTransportChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; - } - else - { - *nTransportChannels = 1; - } -#endif } else { @@ -4783,14 +4772,8 @@ static ivas_error evs_dec_main( ) { DEC_CORE_HANDLE *hCoreCoder; -#ifndef FIX_1435_MOVE_STEREO_PANNING - float mixer_left, mixer_rigth; - float *p_output[MAX_TRANSPORT_CHANNELS]; - int16_t ch, nOutSamples; -#else float *p_output[1]; int16_t nOutSamples; -#endif ivas_error error; hCoreCoder = st_ivas->hSCE[0]->hCoreCoder; @@ -4799,18 +4782,7 @@ static ivas_error evs_dec_main( mdct_switching_dec( hCoreCoder[0] ); -#ifdef FIX_1435_MOVE_STEREO_PANNING p_output[0] = st_ivas->p_output_f[0]; -#else - for ( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ ) - { - p_output[ch] = st_ivas->p_output_f[ch]; - if ( p_output[ch] != NULL ) - { - set_zero( p_output[ch], L_FRAME48k ); - } - } -#endif /* run the main EVS decoding routine */ if ( hCoreCoder[0]->codec_mode == MODE1 ) @@ -4857,15 +4829,6 @@ static ivas_error evs_dec_main( st_ivas->BER_detect = hCoreCoder[0]->BER_detect; -#ifndef FIX_1435_MOVE_STEREO_PANNING - if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { - mixer_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; - mixer_rigth = 1.f - mixer_left; - v_multc( p_output[0], mixer_rigth, p_output[1], nOutSamples ); - v_multc( p_output[0], mixer_left, p_output[0], nOutSamples ); - } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) { /* BE workaround: in order to keep EVS bit-exact wrt. TS 26.443, convert 'float' output data to 'short' before the TSM */ -- GitLab From 87c20f210bdc46963900ffe41729a9644fe2ab97 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:04:40 +0100 Subject: [PATCH 21/26] [cleanup] accept FIX_1454_FIX_STEREO_TO_FOA_JBM --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ec4e61d238..a53b466661 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_1454_FIX_STEREO_TO_FOA_JBM /* VA: issue 1454: fix buggy stereo to FOA in JBM */ #define FIX_1461_CNG_BW_SWITCHING /* Eri: issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */ #define FIX_2252_LP_CNG_STARTS_SID /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */ #define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 033e768d08..196ec5aa99 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -965,11 +965,7 @@ ivas_error ivas_dec_render( } else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { -#ifdef FIX_1454_FIX_STEREO_TO_FOA_JBM ivas_stereo2sba( p_tc, p_output, *nSamplesRendered ); -#else - ivas_stereo2sba( p_output, p_output, *nSamplesRendered ); -#endif } } else if ( st_ivas->ivas_format == ISM_FORMAT ) -- GitLab From 37254efad6d3c3d61a60c89957f64b2edebe61c0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:05:18 +0100 Subject: [PATCH 22/26] [cleanup] accept FIX_1461_CNG_BW_SWITCHING --- lib_com/options.h | 1 - lib_enc/ivas_cpe_enc.c | 4 ---- lib_enc/ivas_stereo_dft_enc.c | 2 -- 3 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a53b466661..f7a2117db6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_1461_CNG_BW_SWITCHING /* Eri: issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */ #define FIX_2252_LP_CNG_STARTS_SID /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */ #define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ #define FIX_2285_CODE_DECODER_INIT_BW /* VA: basop issue 2285: fix core-decoder initialization bandwidth */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 01b13ba269..17e7dba607 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -112,9 +112,7 @@ ivas_error ivas_cpe_enc( int32_t cpe_brate; int32_t element_brate_ref; int16_t last_bits_frame_nominal; /* last_bits_frame_nominal for M or PCh channel */ -#ifdef FIX_1461_CNG_BW_SWITCHING int16_t NFFT_inner; -#endif error = IVAS_ERR_OK; push_wmops( "ivas_cpe_enc" ); @@ -631,11 +629,9 @@ ivas_error ivas_cpe_enc( if ( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) { /* Reconfigure DFT Stereo for inactive frames */ -#ifdef FIX_1461_CNG_BW_SWITCHING /* -- nbands may need to be updated here in case the bandwidth was changed due to inactive frames */ NFFT_inner = STEREO_DFT_N_MAX_ENC * inner_frame_tbl[sts[0]->bwidth] / L_FRAME48k; hCPE->hStereoDft->nbands = stereo_dft_band_config( hCPE->hStereoDft->band_limits, hCPE->hStereoDft->hConfig->band_res, NFFT_inner, ENC ); -#endif if ( sts[0]->core_brate == SID_2k40 ) { stereo_dft_config( hConfigDft, IVAS_SID_5k2, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); diff --git a/lib_enc/ivas_stereo_dft_enc.c b/lib_enc/ivas_stereo_dft_enc.c index 49f7c33d47..0ce776e259 100644 --- a/lib_enc/ivas_stereo_dft_enc.c +++ b/lib_enc/ivas_stereo_dft_enc.c @@ -2879,14 +2879,12 @@ static void stereo_dft_enc_compute_prm( hStereoDft->nrg_past_pos = ( pos + 1 ) % STEREO_DFT_NRG_PAST_LEN; -#ifdef FIX_1461_CNG_BW_SWITCHING /* Replicate last band for remaining bands in case the bandwidth is higher after SID/NODATA is considered */ for ( i = hStereoDft->nbands; i < STEREO_DFT_BAND_MAX; i++ ) { pPredGain[i] = pPredGain[i - 1]; pSideGain[i] = pSideGain[i - 1]; } -#endif #ifdef DEBUG_MODE_DFT { -- GitLab From cc06931ee90571169780cfef3b7a4ee137d6ee89 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:06:06 +0100 Subject: [PATCH 23/26] [cleanup] accept FIX_2252_LP_CNG_STARTS_SID --- lib_com/options.h | 1 - lib_dec/decision_matrix_dec.c | 2 -- lib_dec/init_dec.c | 5 ----- lib_dec/ivas_decision_matrix_dec.c | 2 -- 4 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f7a2117db6..f06cdd034a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_2252_LP_CNG_STARTS_SID /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */ #define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ #define FIX_2285_CODE_DECODER_INIT_BW /* VA: basop issue 2285: fix core-decoder initialization bandwidth */ diff --git a/lib_dec/decision_matrix_dec.c b/lib_dec/decision_matrix_dec.c index 4329099e62..802e4ef6f0 100644 --- a/lib_dec/decision_matrix_dec.c +++ b/lib_dec/decision_matrix_dec.c @@ -101,10 +101,8 @@ void decision_matrix_dec( if ( get_next_indice( st, 1 ) == 1 ) { st->L_frame = L_FRAME16k; -#ifdef FIX_2252_LP_CNG_STARTS_SID st->nb_subfr = NB_SUBFR16k; st->bwidth = max( st->bwidth, WB ); -#endif } } else diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 38f7429b69..63e8bc9031 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -79,7 +79,6 @@ ivas_error init_decoder( st->last_total_brate_ber = -1; st->core_brate = ACELP_8k00; st->ini_frame = 0; -#ifdef FIX_2252_LP_CNG_STARTS_SID if ( st->element_mode == EVS_MONO ) { st->bwidth = NB; @@ -95,10 +94,6 @@ ivas_error init_decoder( st->last_bwidth = NB; #endif } -#else - st->bwidth = NB; - st->last_bwidth = NB; -#endif st->extl_brate = 0; st->coder_type = GENERIC; diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index 0157823adf..bbda207116 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -95,10 +95,8 @@ void ivas_decision_matrix_dec( if ( get_next_indice( st, 1 ) ) { st->L_frame = L_FRAME16k; -#ifdef FIX_2252_LP_CNG_STARTS_SID st->nb_subfr = NB_SUBFR16k; st->bwidth = max( st->bwidth, WB ); -#endif } else { -- GitLab From a24476038c63470d6587d086e8f7a28ca7b48a97 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:06:44 +0100 Subject: [PATCH 24/26] [cleanup] accept FIX_1381_BWD --- lib_com/options.h | 1 - lib_enc/bw_detect.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f06cdd034a..cd8a761260 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_1381_BWD /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */ #define FIX_2285_CODE_DECODER_INIT_BW /* VA: basop issue 2285: fix core-decoder initialization bandwidth */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index f5a404a920..318726cc2f 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -53,9 +53,7 @@ *-------------------------------------------------------------------*/ #define BWD_MIN_BRATE_WIDER_BW_MDCT IVAS_48k -#ifdef FIX_1381_BWD #define BWD_MIN_BRATE_WIDER_BW_MASA IVAS_48k -#endif #define BWD_MIN_BRATE_WIDER_BW_ISM IVAS_32k #define BWD_MAX_BRATE_WIDER_BW_MDCT IVAS_80k #define BWD_MAX_BRATE_WIDER_BW_ISM IVAS_64k @@ -95,12 +93,8 @@ void bw_detect( bwd_count_wider_bw = BWD_COUNT_WIDER_BW; if ( st->ini_frame > 0 && ( ( st->element_mode == IVAS_CPE_MDCT && ( st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MDCT || mct_on ) ) || -#ifdef FIX_1381_BWD ( st->is_ism_format && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) || ( ivas_format == MASA_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_MASA ) ) ) -#else - ( ivas_format == ISM_FORMAT && st->element_brate >= BWD_MIN_BRATE_WIDER_BW_ISM ) ) ) -#endif { bwd_count_wider_bw = BWD_COUNT_WIDER_BW_MDCT; } -- GitLab From 6731991f69ffa8f87df8b855c7264372faab1177 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:07:32 +0100 Subject: [PATCH 25/26] [cleanup] accept FIX_2285_CODE_DECODER_INIT_BW --- lib_com/options.h | 1 - lib_dec/init_dec.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cd8a761260..ead3299785 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,6 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ -#define FIX_2285_CODE_DECODER_INIT_BW /* VA: basop issue 2285: fix core-decoder initialization bandwidth */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 63e8bc9031..de0de3aa1e 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -86,13 +86,8 @@ ivas_error init_decoder( } else { -#ifdef FIX_2285_CODE_DECODER_INIT_BW st->bwidth = WB; st->last_bwidth = WB; -#else - st->bwidth = NB; - st->last_bwidth = NB; -#endif } st->extl_brate = 0; -- GitLab From 346a9bfd4deeb4e285ce7dfc4ae74545975dde21 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 15 Jan 2026 10:10:22 +0100 Subject: [PATCH 26/26] formatting --- apps/decoder.c | 32 ++++++++++++++++---------------- lib_rend/ivas_hrtf.c | 1 - lib_util/hrtf_file_reader.c | 2 +- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 51f1452b37..c2f953ccf5 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -4258,31 +4258,31 @@ static ivas_error load_hrtf_from_file( } } - if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) && OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; - if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_GetHrtfStatisticsHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - return error; - } - - if ( ( error = load_HrtfStatistics_from_binary( *hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) + if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) && OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) + IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; + if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", hHrtfBinary->hrtfFileName ); + fprintf( stderr, "\nIVAS_DEC_GetHrtfStatisticsHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } - else + + if ( ( error = load_HrtfStatistics_from_binary( *hHrtfStatistics, output_Fs, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) { - destroy_hrtf_statistics( hHrtfStatistics ); + if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) + { + fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", hHrtfBinary->hrtfFileName ); + return error; + } + else + { + destroy_hrtf_statistics( hHrtfStatistics ); + } } } } -} -return IVAS_ERR_OK; + return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 144228b50b..84218cd12b 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -468,4 +468,3 @@ void ivas_HRTF_statistics_binary_close( return; } - diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 8f76ffdf3c..e658000695 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -380,7 +380,7 @@ static ivas_error TDREND_LoadBSplineBinaryITD( fread( &modelITD->azimSegSamples, sizeof( int16_t ), 1, f_hrtf ); -/* elevation */ + /* elevation */ ivas_HRTF_binary_open_buffers_int16( &modelITD->elevBsLen_dyn, HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); if ( modelITD->elevBsLen_dyn == NULL ) { -- GitLab