From 2fffe527befe9d22a497c9e4bdac45d2d0187b3b Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Tue, 3 Oct 2023 14:41:07 +0200 Subject: [PATCH 1/4] Change from round to roundf in external renderer for ism2binaural --- lib_com/options.h | 1 + lib_rend/lib_rend.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3ccf81b46b..0e134dfc6c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,7 @@ #define FIX_812_DOUBLE_PREC_MCT /* FhG: Issue 812: Avoid double precision in MCT */ #define FIX_807_VARIABLE_SPEED_DECODING /* FhG: Issue 807: Resolve "Variable Speed Decoding broken" */ #define FIX_818_DOUBLE_PREC_KERNEN_SW /* FhG: Issue 818: Avoid double precision in kernel switching */ +#define FIX_817_DOUBLE_PREC_REND_MD /* FhG: Issue 817: Avoid double precision in renderer metadata module */ /* #################### End BE switches ################################## */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 3df316dd64..59bc958d57 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5943,7 +5943,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 */ - ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#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, @@ -6166,7 +6170,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 */ - ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#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, @@ -6344,7 +6352,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; -- GitLab From b5d9e46b4487ddf906eb0ddebdc108c1e50bad00 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Thu, 5 Oct 2023 12:30:27 +0200 Subject: [PATCH 2/4] Updates from main --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 27920faace..1a261f7f26 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #endif #define FIX_818_DOUBLE_PREC_KERNEN_SW /* FhG: Issue 818: Avoid double precision in kernel switching */ -#define FIX_817_DOUBLE_PREC_REND_MD /* FhG: Issue 817: Avoid double precision in renderer metadata module */ +#define FIX_817_DOUBLE_PREC_REND_MD /* Eri: Issue 817: Avoid double precision in renderer metadata module */ /* #################### End BE switches ################################## */ -- GitLab From e4abe7164e7d5e96683d7b864094f02cc8e32bab Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Thu, 5 Oct 2023 12:34:47 +0200 Subject: [PATCH 3/4] Format fix --- lib_rend/lib_rend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5fd8669ed8..629f61f0cd 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5885,7 +5885,7 @@ static ivas_error renderIsmToBinaural( #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 ) ); + 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 ); @@ -6112,7 +6112,7 @@ static ivas_error renderIsmToBinauralReverb( #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 ) ); + 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 ); -- GitLab From 4bc27b678c2e2af58bf361b414b488ae188ce18a Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Thu, 12 Oct 2023 12:15:15 +0200 Subject: [PATCH 4/4] Merge from main --- lib_com/options.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 46b0ec0d19..9874c5157b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,11 +150,6 @@ /*#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_818_DOUBLE_PREC_KERNEL_SW /* FhG: Issue 818: Avoid double precision in kernel switching */ -#define FIX_822_REFACTOR_BIN_REVERB_OPEN /* Nokia: Addresses first step of issue 822 by refactoring ivas_binaural_reverb_open */ -#define FIX_847_OUTPUT_PCM_BUFFER /* VA: issue 847: Allocate decoder output PCM buffer dynamically */ - #define FIX_817_DOUBLE_PREC_REND_MD /* Eri: Issue 817: Avoid double precision in renderer metadata module */ -- GitLab