diff --git a/lib_com/options.h b/lib_com/options.h index ae332cd1566f6c08d2e2ec278c24c85feb998d3b..48d4845cc382022420a8cdeacaac4661718928dd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,9 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT*/ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ + +#define FIX_817_DOUBLE_PREC_REND_MD /* Eri: Issue 817: Avoid double precision in renderer metadata module */ + #define FIX_854_ARRAY_SIZE_MISMATCH /* VA: issue 854: correct the mismatch between definition and declaration of `ivas_core_dec() */ #define FIX_785_REMOVE_DEAD_CODE /* VA: issue 785: remove dead code */ #define FIX_852_FIX_HANDLE_DEREF /* VA: issue 852: Fix missing handle dereferencing of hIsmMetadaData in ivas_ism_metadata_close() */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f319e46bbd32c69a829df3f7e3fe83b8b84e1adb..c75e21f6980bdc71dd7a4654ec42ac3b3d9da4ff 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5849,7 +5849,11 @@ static ivas_error renderIsmToBinaural( push_wmops( "renderIsmToBinaural" ); /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ +#ifdef FIX_817_DOUBLE_PREC_REND_MD + ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#else ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, ism_md_subframe_update_ext, @@ -6072,7 +6076,11 @@ static ivas_error renderIsmToBinauralReverb( push_wmops( "renderIsmToBinauralRoom" ); /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ +#ifdef FIX_817_DOUBLE_PREC_REND_MD + ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#else ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, @@ -6250,7 +6258,11 @@ static ivas_error renderIsmToSplitBinaural( pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ +#ifdef FIX_817_DOUBLE_PREC_REND_MD + ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#else ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif pCombinedOrientationData = *ismInput->base.ctx.pCombinedOrientationData;