diff --git a/apps/decoder.c b/apps/decoder.c index 659ac0fc3942896670c4e955e96109c88ac2dddc..c2f953ccf5ac0d8fa17523bf208f0e70c5f05720 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,53 +4257,32 @@ 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 ( ( 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 ) { -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA - destroy_hrtf_statistics( hHrtfStatistics ); -#else - destroy_hrtf_statistics( hHrtfBinary->hHrtfStatistics ); -#endif + 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 ); + } } } } -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA -} -#endif -return IVAS_ERR_OK; + return IVAS_ERR_OK; } diff --git a/apps/renderer.c b/apps/renderer.c index 0778167c865b53c6e0f1579ca6eb42504c2611dd..13c327315fd9220cb07945e9fb820cb7f9575365 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/gs_noisefill.c b/lib_com/gs_noisefill.c index 30dda50efb856282a053fd5a78085be841e1ce5b..b0aa5a0ad25e6353b2e17cfd382d8571a35b9f18 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/hvq_pvq_bitalloc.c b/lib_com/hvq_pvq_bitalloc.c index 5f98538a84171567814e5f90376780b2e344ca9f..5da8321421c2914aaaf17398b2142528a8afe4d5 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/ifft_rel.c b/lib_com/ifft_rel.c index f2d07669c78f7464df7f9ee1774cc3ab59eda982..703907f5b9b5fbaceb201b2cc4fc2024b5f224a2 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 08c9c5c857a9aee2e1414aebadd60247597297f8..ead32997853438346c7444d789de1726498b9756 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,29 +161,10 @@ /*#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 */ -#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 */ -#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. */ -#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 */ -#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 */ #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 */ #define REMOVE_UNUSED_CODE_IVAS_DEC /* VA: remove unused code in ivas_jbm_dec_tc_fx() */ @@ -194,12 +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 */ -#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_com/trans_direct.c b/lib_com/trans_direct.c index 540d6ec751d303e9ae2b1d1d3165e48c90d74ca9..ff41f1b7b05fd865d37591c1fc5d6d6461aa7f0f 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 183595767c67b6216871401362dae250eb8f5d72..6c90b688f01c11ce3242c50c591111e03a9e7066 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++ ) diff --git a/lib_dec/ACcontextMapping_dec.c b/lib_dec/ACcontextMapping_dec.c index a51fc1434b0dd77050771c109b1c91fe0ea2a4f2..66d19417eefc23d6f0e0a15171f28dd72e31f5b7 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_dec/dec_acelp.c b/lib_dec/dec_acelp.c index effde604f830cc7d1aad4abc562ca3ef80e91746..03ff59c400839b9f8838d5f1aa0e87ae37f03225 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 diff --git a/lib_dec/decision_matrix_dec.c b/lib_dec/decision_matrix_dec.c index 4329099e62ef5c2157c23877d5fa570458237589..802e4ef6f0b4626c0ca2b1b28c884f052d9744bc 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/hq_hr_dec.c b/lib_dec/hq_hr_dec.c index 9055a9e2e3927d3da7078bc6411576f7d9a8b5f8..8616454082efd31b81b813a1ce721351fcbd1f67 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 diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 38f7429b6937e766a0000d995f53a0fbdec86ad9..de0de3aa1e98fbc35f63a63e587860bd6609041c 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; @@ -87,18 +86,9 @@ 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 } -#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 0157823adf7144cff50beb069e32d1fc55c35fbc..bbda207116f28757b7be63a0fa29f5008684699b 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 { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 26431ae437864f51cf2010000e997507d9e48437..a56ac25683f7e9406fb49dac4197e46ab8cf5ca1 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/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index dc0b27813bc559bea551edd1901dbcf431cf5e94..47db361a063b052a912968b85fa61dd95e687c04 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 ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index c2ba67d84fdd67bba73c5e6ef847931dd7879e2b..196ec5aa99699811a8d6847ef069eb7a73cd5fca 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -959,19 +959,13 @@ 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 ivas_stereo2sba( p_tc, p_output, *nSamplesRendered ); -#else - ivas_stereo2sba( p_output, p_output, *nSamplesRendered ); -#endif } } else if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -1973,15 +1967,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 +2080,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 +2543,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 +2561,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_mct_dec.c b/lib_dec/ivas_mct_dec.c index b23ad94c9891454f5a382b1ba05753dfa13fb29d..51e53aa98fb88abc5761f0c00bc37531d6a0c3d9 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" ) ); } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 09fa8052f196929f89a76b8e64ef35b03beb875d..be7f1c57e3f743c7d2d6f09f6609f053b129e000 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/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 3c853a047af71d9605d6c8911e3f1001965135e2..2fe1b89db0c3bb735aead9a5f4b3ca99fc771b61 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 ) ); @@ -371,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 ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index afc5043bb7035cea081e8545a8dec4812c50f38a..8dddc37a242dbc924feafd9480e101bcacf892db 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; @@ -2207,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 { @@ -2937,11 +2912,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; } @@ -3011,11 +2982,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 ) ) @@ -3026,10 +2993,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 ); } @@ -4809,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; @@ -4825,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 ) @@ -4883,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 */ diff --git a/lib_enc/ACcontextMapping_enc.c b/lib_enc/ACcontextMapping_enc.c index dd635d87c40045263ff0a4d8f059cc8b4129056e..b0b85ef607b80da842ee09a6bdbd762ce4492442 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; diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index f5a404a9207410afd9427586d63a724ea31cad4e..318726cc2f6ea0ee4eb641c8db1e73d07accb630 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; } diff --git a/lib_enc/enc_acelp.c b/lib_enc/enc_acelp.c index 75287a4d184f051e802db5c9e886a97b8bc6cf4b..a83308a544434d6adff8d50a1cee7a964668f4b6 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; diff --git a/lib_enc/enc_gain.c b/lib_enc/enc_gain.c index 28a72a1e6a51e8860146896e8db5055d7bfb70ea..acbec79937fe02f45b554da79f55949988162f11 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; diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 01b13ba2699393ad49466a3034374cc7de7e9a90..17e7dba6076a1a98c578c7f51731200333a2453c 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 49f7c33d47f5d64b51165f3eeec323ad3e31e178..0ce776e2590459bdeb85f4cb9efc68bfe1a9803c 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 { diff --git a/lib_enc/pit_enc.c b/lib_enc/pit_enc.c index 4ba9b538864db4956a2e52b1dca93469b760b017..1ec857b72ca71b22f3755f5c0b6e38808bbf8ef4 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; diff --git a/lib_enc/pitch_ol2.c b/lib_enc/pitch_ol2.c index 8290e8c7853b450ea2a73a920b972981b9f707f9..4ba1fe0d5017a479fd3c56e08668ee4023876413 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; diff --git a/lib_enc/tcx_ltp_enc.c b/lib_enc/tcx_ltp_enc.c index 5e6ecbf4f87bab6f6508b737977a444fad88499e..af3c5d529fcdba150382889c912eec861a85104d 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; diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 6acca9bccc8c3b39de9bdca23d077660174d22bd..a0457281b6d398779547fa52963e741f40cf8639 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 46eaf2401c139128782e98c75d30371a904b2678..84218cd12b5432fe8ce53c1ac3ba3f6f5b9184a3 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,104 +462,9 @@ void ivas_HRTF_statistics_close( free( ( *hHrtfStatistics )->inter_aural_coherence_dyn ); } } -#endif free( *hHrtfStatistics ); *hHrtfStatistics = NULL; 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 d9120b60c89dbbd809ef6d94b6d25f1c3aa62548..517750206077bc3b4e497781f96345072c6c570a 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 1b088371dafb22832f5418ee51d3ba10ba4fe970..5499160ed45ebc19e15ca3064930e0920ed0b8bc 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 c0956405f05f8e639bfdecb54ea825aed5952e3e..2e6d192d9aedd12747109a6c4ddc433db8fbefa5 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 598a70b4bfc04ecbd9f2e7ebd798c2415e4aa794..88c7b912ad8086c4401ce6e6c3b6755c10d51df4 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 5f52c16818fa25aa7fb9773a435102a54f585326..7aee28a5fa870bcebd36bb6f2f52132e2b6b241e 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 */ @@ -3328,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; } @@ -3356,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 */ @@ -3365,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; @@ -6354,7 +6321,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 +6340,6 @@ static void renderMonoStereoToBinaural( return; } -#endif static ivas_error renderLfeToBinaural( const input_mc *mcInput, @@ -6975,7 +6940,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 +6947,6 @@ static ivas_error renderInputMc( } /* not mono or stereo */ -#endif switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: @@ -8377,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 964109f4ba79812be6ced8f6639b10f5b2124aa3..e658000695cd80e3059376cd27820a726317d2e8 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 ) { @@ -404,22 +380,14 @@ static ivas_error TDREND_LoadBSplineBinaryITD( fread( &modelITD->azimSegSamples, sizeof( int16_t ), 1, f_hrtf ); -/* elevation */ -#ifdef FIX_2249_MEMORY_LEAK_IN_SBA + /* elevation */ 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 9508c3b172d4a4a87b18ded22b959d041603d173..7a39cac6b5759c2cac15e692206d1ba53bef8972 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()