diff --git a/lib_com/options.h b/lib_com/options.h index 7745853825673f115ecb693bce6854061c460a56..a9f49183cf916eb8b787e2b2ca8d12defbb0fe0a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_938_COMPILER_WARNING /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */ - +#define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7b4b631f4075e0d0f0ecc53b1c478a17ae72c819..b3d7e62e92ee9d4b83d952e7104dd93781eb9b02 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2782,8 +2782,11 @@ void ivas_destroy_dec( ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); /* Crend handle */ +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); - +#else + ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); +#endif /* Reverb handle */ ivas_reverb_close( &st_ivas->hReverb ); diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 7472690650963f06c709a1ae643c6556af5abf18..e18a28281aa698abdf84223e948fd541ac72a5f6 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -253,7 +253,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( } /* close the crend binaural renderer */ +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); +#else + ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); +#endif } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 6d406fccc1b3961b9c01a534b6a021f6c5dae36c..e15b9c437f6dae18e7840aa70a57ceaeca9ccb85 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1169,7 +1169,11 @@ static ivas_error ivas_mc_dec_reconfig( if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) { +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ), ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); +#else + ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) ); +#endif } if ( st_ivas->hBinRendererTd != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) ) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 8455901f4d0d9642ba1a05221c19ca14e40640ef..322d6b7e223a0ec3e3ab993b4eae666790b37384 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1076,6 +1076,13 @@ ivas_error ivas_rend_initCrendWrapper( ( *pCrend )->binaural_latency_ns = 0; ( *pCrend )->hHrtfCrend = NULL; +#ifdef FIX_1288_SPLIT_REND_XSAN + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + ( *pCrend )->hCrend[pos_idx] = NULL; + } +#endif + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { hCrend = NULL; @@ -1338,10 +1345,14 @@ ivas_error ivas_rend_openCrend( * * Deallocate Crend renderer handle *------------------------------------------------------------------------*/ - +#ifndef FIX_1288_SPLIT_REND_XSAN void ivas_rend_closeCrend( CREND_WRAPPER_HANDLE *pCrend, const int16_t num_poses ) +#else +void ivas_rend_closeCrend( + CREND_WRAPPER_HANDLE *pCrend ) +#endif { int16_t i; int16_t pos_idx; @@ -1357,7 +1368,11 @@ void ivas_rend_closeCrend( ivas_hrtf_close( &( *pCrend )->hHrtfCrend ); } +#ifndef FIX_1288_SPLIT_REND_XSAN for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) +#else + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) +#endif { hCrend = ( *pCrend )->hCrend[pos_idx]; if ( hCrend != NULL ) diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 121d9128816dc8b855b84e580eb5d872ccf9a1d9..0e17d68ed0f51d1b87f0804cb2b2f5016ea3cc2c 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -903,10 +903,15 @@ ivas_error ivas_rend_openCrend( const int16_t num_poses ); +#ifndef FIX_1288_SPLIT_REND_XSAN void ivas_rend_closeCrend( CREND_WRAPPER_HANDLE *pCrend, const int16_t num_poses ); +#else +void ivas_rend_closeCrend( + CREND_WRAPPER_HANDLE *pCrend ); +#endif ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: Crend HRTF handle */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 08f6c7fbbcd5a43ae123dae6853dd80b1e730984..bea0c4aa34ad9bc5417c29a6bd061b0d0a693349 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1263,7 +1263,11 @@ static ivas_error initIsmMasaRendering( ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); } +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputIsm->crendWrapper ); +#endif ivas_reverb_close( &inputIsm->hReverb ); @@ -1390,7 +1394,11 @@ static void clearInputIsm( initRendInputBase( &inputIsm->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputIsm->crendWrapper, inputIsm->base.ctx.pSplitRendWrapper != NULL ? inputIsm->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputIsm->crendWrapper ); +#endif ivas_reverb_close( &inputIsm->hReverb ); @@ -2088,7 +2096,11 @@ static ivas_error initMcBinauralRendering( /* if we need to use TD renderer and CREND was open, close it */ if ( useTDRend ) { +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputMc->crendWrapper ); +#endif } if ( !reconfigureFlag || ( !useTDRend && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && inputMc->hReverb != NULL ) ) @@ -2180,7 +2192,11 @@ static ivas_error initMcMasaRendering( ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); } +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputMc->crendWrapper ); +#endif ivas_reverb_close( &inputMc->hReverb ); @@ -2365,7 +2381,11 @@ static void clearInputMc( efap_free_data( &inputMc->efapInWrapper.hEfap ); } +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputMc->crendWrapper, inputMc->base.ctx.pSplitRendWrapper != NULL ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputMc->crendWrapper ); +#endif ivas_reverb_close( &inputMc->hReverb ); @@ -2582,7 +2602,11 @@ static ivas_error initSbaMasaRendering( { ivas_error error; +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputSba->crendWrapper, inputSba->base.ctx.pSplitRendWrapper != NULL ? inputSba->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputSba->crendWrapper ); +#endif if ( ( error = ivas_dirac_ana_open( &inputSba->hDirAC, inSampleRate ) ) != IVAS_ERR_OK ) { @@ -2660,7 +2684,11 @@ static void clearInputSba( initRendInputBase( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ +#ifndef FIX_1288_SPLIT_REND_XSAN ivas_rend_closeCrend( &inputSba->crendWrapper, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ); +#else + ivas_rend_closeCrend( &inputSba->crendWrapper ); +#endif if ( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) {