From b5b72fcfc4cc79c1918b59082fee1451460213cc Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 15:52:07 +0200 Subject: [PATCH 01/15] Add External Renderer CommanLine Option -sync_mc_delay / -smd --- apps/renderer.c | 28 ++++++++++++++++++ lib_com/options.h | 2 +- lib_rend/ivas_objectRenderer.c | 12 ++++++-- lib_rend/ivas_prot_rend.h | 3 ++ lib_rend/ivas_stat_rend.h | 1 - lib_rend/lib_rend.c | 53 ++++++++++++++++++++++++++++++---- lib_rend/lib_rend.h | 3 ++ 7 files changed, 93 insertions(+), 9 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 760065be91..ac643d058f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -157,6 +157,9 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef FIX_488_SYNC_DELAY + int16_t syncMdDelay; +#endif } CmdlnArgs; typedef enum @@ -181,6 +184,9 @@ typedef enum CmdLnOptionId_inputGain, CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, +#ifdef FIX_488_SYNC_DELAY + CmdLnOptionId_syncMdDelay, +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -302,6 +308,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, +#ifdef FIX_488_SYNC_DELAY + { + .id = CmdLnOptionId_syncMdDelay, + .match = "sync_md_delay", + .matchShort = "smd", + .description = "Metadata Synchronization Delay in ms", + }, +#endif }; @@ -1236,7 +1250,11 @@ int main( } } +#ifdef FIX_488_SYNC_DELAY + if ( IVAS_REND_GetSamples( hIvasRend, args.syncMdDelay, outBuffer ) != IVAS_ERR_OK ) +#else if ( IVAS_REND_GetSamples( hIvasRend, outBuffer ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Error in getting samples\n" ); exit( -1 ); @@ -1900,6 +1918,10 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); + +#ifdef FIX_488_SYNC_DELAY + args.syncMdDelay = 0; +#endif return args; } @@ -2029,6 +2051,12 @@ static void parseOption( exit( -1 ); } break; +#ifdef FIX_488_SYNC_DELAY + case CmdLnOptionId_syncMdDelay: + assert( numOptionValues == 1 ); + args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / 5 ); + break; +#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; diff --git a/lib_com/options.h b/lib_com/options.h index dbe71e39f1..21b695350c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,7 @@ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ - +#define FIX_488_SYNC_DELAY /* Eri: Issue 488: Waveform and MD desynchronized in external renderer */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2ba225b2f1..a87d48af60 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -615,8 +615,11 @@ ivas_error ivas_td_binaural_renderer_ext( const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ - const int16_t output_frame, /* i : output frame length */ - float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ +#ifdef FIX_488_SYNC_DELAY + const ism_md_subframe_update_ext, +#endif + const int16_t output_frame, /* i : output frame length */ + float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ) { ISM_METADATA_FRAME hIsmMetaDataFrame; @@ -627,7 +630,9 @@ ivas_error ivas_td_binaural_renderer_ext( IVAS_REND_AudioConfigType inConfigType; AUDIO_CONFIG transport_config; ivas_error error; +#ifndef FIX_488_SYNC_DELAY int16_t ism_md_subframe_update_ext; +#endif float *p_output[MAX_OUTPUT_CHANNELS]; int16_t ch; @@ -641,7 +646,10 @@ ivas_error ivas_td_binaural_renderer_ext( inConfigType = getAudioConfigType( inConfig ); lfe_idx = LFE_CHANNEL; hIsmMetaData[0] = NULL; + +#ifndef FIX_488_SYNC_DELAY ism_md_subframe_update_ext = 0; +#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 803a612502..3355d06429 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -252,6 +252,9 @@ ivas_error ivas_td_binaural_renderer_ext( const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ); diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c763630325..199f5fe435 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -342,7 +342,6 @@ typedef struct ivas_render_config_t #endif ivas_roomAcoustics_t roomAcoustics; float directivity[3]; - } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; typedef struct ivas_rev_delay_line_t diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4e75d5fea8..594df91bf3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4662,6 +4662,9 @@ static ivas_error rotateFrameSba( static ivas_error renderIsmToBinaural( const input_ism *ismInput, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif IVAS_REND_AudioBuffer outAudio ) { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4677,6 +4680,9 @@ static ivas_error renderIsmToBinaural( ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + ism_md_subframe_update_ext, +#endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) { @@ -4833,6 +4839,9 @@ static ivas_error renderIsmToBinauralRoom( static ivas_error renderIsmToBinauralReverb( input_ism *ismInput, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif IVAS_REND_AudioBuffer outAudio ) { #ifdef JBM_TSM_ON_TCS @@ -4859,6 +4868,9 @@ static ivas_error renderIsmToBinauralReverb( ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + ism_md_subframe_update_ext, +#endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { @@ -5006,6 +5018,9 @@ static ivas_error renderIsmToMasa( static ivas_error renderInputIsm( input_ism *ismInput, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif const IVAS_REND_AudioConfig outConfig, const IVAS_REND_AudioBuffer outAudio ) { @@ -5036,13 +5051,21 @@ static ivas_error renderInputIsm( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: +#ifdef FIX_488_SYNC_DELAY + error = renderIsmToBinaural( ismInput, ism_md_subframe_update_ext, outAudio ); +#else error = renderIsmToBinaural( ismInput, outAudio ); +#endif break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#ifdef FIX_488_SYNC_DELAY + error = renderIsmToBinauralReverb( ismInput, ism_md_subframe_update_ext, outAudio ); +#else error = renderIsmToBinauralReverb( ismInput, outAudio ); +#endif break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -5065,6 +5088,9 @@ static ivas_error renderInputIsm( static ivas_error renderActiveInputsIsm( IVAS_REND_HANDLE hIvasRend, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif IVAS_REND_AudioBuffer outAudio ) { int16_t i; @@ -5078,8 +5104,11 @@ static ivas_error renderActiveInputsIsm( /* Skip inactive inputs */ continue; } - +#ifdef FIX_488_SYNC_DELAY + if ( ( error = renderInputIsm( pCurrentInput, ism_md_subframe_update_ext, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -5184,7 +5213,11 @@ static ivas_error renderMcToBinaural( if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData, NULL, - mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) + mcInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + NULL, +#endif + mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -5277,7 +5310,11 @@ static ivas_error renderMcToBinauralRoom( if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData, - NULL, mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) + NULL, mcInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + NULL, +#endif + mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -6359,7 +6396,10 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_GetSamples( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_488_SYNC_DELAY + const int16_t sync_md_delay, +#endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ) { @@ -6432,8 +6472,11 @@ ivas_error IVAS_REND_GetSamples( /* Clear output buffer */ set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); - +#ifdef FIX_488_SYNC_DELAY + if ( ( error = renderActiveInputsIsm( hIvasRend, sync_md_delay, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderActiveInputsIsm( hIvasRend, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 88e96d2916..6f9a633329 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -320,6 +320,9 @@ ivas_error IVAS_REND_GetNumAllObjects( ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_488_SYNC_DELAY + const int16_t sync_md_delay, +#endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ); -- GitLab From 3127c8444d7aaec4c783b7fed4ec5c472ba3cd91 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 16:02:04 +0200 Subject: [PATCH 02/15] Cleanup --- 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 594df91bf3..e077e3a0e8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5215,7 +5215,7 @@ static ivas_error renderMcToBinaural( NULL, mcInput->hReverb, #ifdef FIX_488_SYNC_DELAY - NULL, + 0, #endif mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { @@ -5312,7 +5312,7 @@ static ivas_error renderMcToBinauralRoom( mcInput->base.ctx.pCombinedOrientationData, NULL, mcInput->hReverb, #ifdef FIX_488_SYNC_DELAY - NULL, + 0, #endif mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { -- GitLab From 70bd727e460627e0e56e1cdc1e10fa66d77f1e5b Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 16:59:58 +0200 Subject: [PATCH 03/15] Cleanup to move the md_subframe_update variable into ism_input structure --- apps/renderer.c | 3 ++- lib_rend/ivas_objectRenderer.c | 2 +- lib_rend/ivas_prot_rend.h | 2 +- lib_rend/lib_rend.c | 35 +++++++++++----------------------- lib_rend/lib_rend.h | 2 +- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index ac643d058f..a2453fd238 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2054,7 +2054,8 @@ static void parseOption( #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); - args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / 5 ); + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1/50/4*1000) subframe index */ + args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES * 1000 ) ); break; #endif default: diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index a87d48af60..1e7fe9b907 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -616,7 +616,7 @@ ivas_error ivas_td_binaural_renderer_ext( const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY - const ism_md_subframe_update_ext, + const ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ #endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 3355d06429..ef7350611e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -253,7 +253,7 @@ ivas_error ivas_td_binaural_renderer_ext( const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, + const int16_t ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ #endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e077e3a0e8..edf18082f1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -123,6 +123,9 @@ typedef struct float nonDiegeticPanGain; OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif } input_ism; typedef struct @@ -4662,9 +4665,6 @@ static ivas_error rotateFrameSba( static ivas_error renderIsmToBinaural( const input_ism *ismInput, -#ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, -#endif IVAS_REND_AudioBuffer outAudio ) { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4681,7 +4681,7 @@ static ivas_error renderIsmToBinaural( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ism_md_subframe_update_ext, + ismInput->ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) @@ -4839,9 +4839,6 @@ static ivas_error renderIsmToBinauralRoom( static ivas_error renderIsmToBinauralReverb( input_ism *ismInput, -#ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, -#endif IVAS_REND_AudioBuffer outAudio ) { #ifdef JBM_TSM_ON_TCS @@ -4869,7 +4866,7 @@ static ivas_error renderIsmToBinauralReverb( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ism_md_subframe_update_ext, + ismInput->ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) @@ -5018,9 +5015,6 @@ static ivas_error renderIsmToMasa( static ivas_error renderInputIsm( input_ism *ismInput, -#ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, -#endif const IVAS_REND_AudioConfig outConfig, const IVAS_REND_AudioBuffer outAudio ) { @@ -5051,21 +5045,13 @@ static ivas_error renderInputIsm( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: -#ifdef FIX_488_SYNC_DELAY - error = renderIsmToBinaural( ismInput, ism_md_subframe_update_ext, outAudio ); -#else error = renderIsmToBinaural( ismInput, outAudio ); -#endif break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#ifdef FIX_488_SYNC_DELAY - error = renderIsmToBinauralReverb( ismInput, ism_md_subframe_update_ext, outAudio ); -#else error = renderIsmToBinauralReverb( ismInput, outAudio ); -#endif break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -5089,7 +5075,7 @@ static ivas_error renderInputIsm( static ivas_error renderActiveInputsIsm( IVAS_REND_HANDLE hIvasRend, #ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, + const int16_t sync_md_delay, /* i: Metadata Delay in subframes to sync with audio delay */ #endif IVAS_REND_AudioBuffer outAudio ) { @@ -5105,10 +5091,11 @@ static ivas_error renderActiveInputsIsm( continue; } #ifdef FIX_488_SYNC_DELAY - if ( ( error = renderInputIsm( pCurrentInput, ism_md_subframe_update_ext, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) -#else - if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) + /* Metadata Delay in subframes to sync with audio delay */ + pCurrentInput->ism_md_subframe_update_ext = sync_md_delay; #endif + if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) + { return error; } @@ -6398,7 +6385,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_488_SYNC_DELAY - const int16_t sync_md_delay, + const int16_t sync_md_delay, /* i: Metadata Delay in subframes to sync with audio delay */ #endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 6f9a633329..9f7edd9d7d 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -321,7 +321,7 @@ ivas_error IVAS_REND_GetNumAllObjects( ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_488_SYNC_DELAY - const int16_t sync_md_delay, + const int16_t sync_md_delay, /* i: Metadata Delay in subframes to sync with audio delay */ #endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ); -- GitLab From 464034c3bed991645567d2d51038d7d59d5e8f41 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 17:01:35 +0200 Subject: [PATCH 04/15] Cleanup --- lib_rend/ivas_stat_rend.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 199f5fe435..c763630325 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -342,6 +342,7 @@ typedef struct ivas_render_config_t #endif ivas_roomAcoustics_t roomAcoustics; float directivity[3]; + } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; typedef struct ivas_rev_delay_line_t -- GitLab From df59e93537aca0454eef191af92c5d198559cb9f Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 17:18:42 +0200 Subject: [PATCH 05/15] Adjust the quantization for 5ms subframe --- apps/renderer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index a2453fd238..b063e70ee7 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2054,8 +2054,8 @@ static void parseOption( #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); - /* Metadata Delay to sync with audio delay converted from ms to 5ms (1/50/4*1000) subframe index */ - args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES * 1000 ) ); + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ + args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); break; #endif default: -- GitLab From d00ea6ca948bea8fcd28f42ea9f97ce31d06fb6d Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 17:25:02 +0200 Subject: [PATCH 06/15] Information for the default value is added --- apps/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/renderer.c b/apps/renderer.c index b063e70ee7..f72234bf2a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -313,7 +313,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", - .description = "Metadata Synchronization Delay in ms", + .description = "Metadata Synchronization Delay in ms, Default is 0", }, #endif }; -- GitLab From 6bde25918afe43640ecf55a23b865816f7acdbd8 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Tue, 27 Jun 2023 09:39:57 +0200 Subject: [PATCH 07/15] Small Fix --- lib_rend/ivas_objectRenderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 1e7fe9b907..6ff2c005eb 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -616,7 +616,7 @@ ivas_error ivas_td_binaural_renderer_ext( const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY - const ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ + const int16_t ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ #endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ -- GitLab From b7b6982af85e90f02b720d4874bf50da47106556 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Tue, 27 Jun 2023 14:55:37 +0200 Subject: [PATCH 08/15] Move quantization of delay to lower level --- apps/renderer.c | 13 ++++++++++--- lib_rend/lib_rend.c | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index f72234bf2a..557c626871 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -313,7 +313,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", - .description = "Metadata Synchronization Delay in ms, Default is 0", + .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)", }, #endif }; @@ -1400,6 +1400,13 @@ int main( fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame ); +#ifdef FIX_488_SYNC_DELAY + if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) floor( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); + } +#endif + #ifdef DEBUGGING int32_t cnt_frames_limited, noClipping; if ( ( cnt_frames_limited = IVAS_REND_GetCntFramesLimited( hIvasRend ) ) > 0 ) @@ -2054,8 +2061,8 @@ static void parseOption( #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); - /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ - args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); + /* Metadata Delay to sync with audio delay in ms */ + args->syncMdDelay = (int16_t) strtof( optionValues[0], NULL ); break; #endif default: diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index edf18082f1..a7d091e0b2 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4669,9 +4669,14 @@ static ivas_error renderIsmToBinaural( { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; - +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif push_wmops( "renderIsmToBinaural" ); - +#ifdef FIX_488_SYNC_DELAY + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ + ism_md_subframe_update_ext = floor( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, @@ -4681,7 +4686,7 @@ static ivas_error renderIsmToBinaural( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_md_subframe_update_ext, + ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) @@ -4846,6 +4851,9 @@ static ivas_error renderIsmToBinauralReverb( #endif float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif #ifdef JBM_TSM_ON_TCS float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; @@ -4857,6 +4865,10 @@ static ivas_error renderIsmToBinauralReverb( push_wmops( "renderIsmToBinauralRoom" ); +#ifdef FIX_488_SYNC_DELAY + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ + ism_md_subframe_update_ext = floor( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, @@ -4866,7 +4878,7 @@ static ivas_error renderIsmToBinauralReverb( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_md_subframe_update_ext, + ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) -- GitLab From b282f5e8a26b00fcee60f4d1b2f20955482d8442 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Fri, 30 Jun 2023 10:50:23 +0200 Subject: [PATCH 09/15] Move printout message up --- apps/renderer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 557c626871..17300a695a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1393,13 +1393,6 @@ int main( exit( -1 ); } - if ( !args.quietModeEnabled && args.delayCompensationEnabled ) - { - fprintf( stdout, "\nRenderer delay: %-5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale ); - } - - fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame ); - #ifdef FIX_488_SYNC_DELAY if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { @@ -1407,6 +1400,13 @@ int main( } #endif + if ( !args.quietModeEnabled && args.delayCompensationEnabled ) + { + fprintf( stdout, "\nRenderer delay: %-5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale ); + } + + fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame ); + #ifdef DEBUGGING int32_t cnt_frames_limited, noClipping; if ( ( cnt_frames_limited = IVAS_REND_GetCntFramesLimited( hIvasRend ) ) > 0 ) -- GitLab From a5656a0f35461c27629d2fa441de6c2d8f9d27f4 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 18 Jul 2023 08:53:23 +0200 Subject: [PATCH 10/15] Add explicit type cast and correct to round instead of floor operation --- 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 c0df231b7d..c4518a259d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4675,7 +4675,7 @@ static ivas_error renderIsmToBinaural( push_wmops( "renderIsmToBinaural" ); #ifdef FIX_488_SYNC_DELAY /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ - ism_md_subframe_update_ext = floor( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); + ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); #endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); @@ -4856,7 +4856,7 @@ static ivas_error renderIsmToBinauralReverb( #ifdef FIX_488_SYNC_DELAY /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ - ism_md_subframe_update_ext = floor( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); + ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); #endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); -- GitLab From 4692a685cac334a021ed2f0b88c8d7b88746e719 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Fri, 21 Jul 2023 12:36:04 +0200 Subject: [PATCH 11/15] Rename the variable ism_md_subframe_ext to ism_metadata_delay_ms in inputIsm struct --- lib_rend/lib_rend.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ed1439be61..0f9591dfb0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -152,7 +152,7 @@ typedef struct OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; #ifdef FIX_488_SYNC_DELAY - int16_t ism_md_subframe_update_ext; + int16_t ism_metadata_delay_ms; #endif } input_ism; @@ -5724,7 +5724,7 @@ static ivas_error renderIsmToBinaural( push_wmops( "renderIsmToBinaural" ); #ifdef FIX_488_SYNC_DELAY /* 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_md_subframe_update_ext / ( 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 ); @@ -5910,7 +5910,7 @@ static ivas_error renderIsmToBinauralReverb( #ifdef FIX_488_SYNC_DELAY /* 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_md_subframe_update_ext / ( 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 ); @@ -6150,7 +6150,7 @@ static ivas_error renderIsmToSplitBinaural( &ismInput->currentPos, NULL, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_md_subframe_update_ext, /* ToDo: Ism Audio Metadata Delay Sync in ms for External Renderer */ + ismInput->ism_metadata_delay_ms, /* Ism Audio Metadata Delay Sync in ms for External Renderer */ #endif output_frame, tmpProcessing ); @@ -6168,7 +6168,7 @@ static ivas_error renderIsmToSplitBinaural( &ismInput->currentPos, NULL, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_md_subframe_update_ext, /* ToDo: Ism Audio Metadata Delay Sync in ms for External Renderer */ + ismInput->ism_metadata_delay_ms, /* Ism Audio Metadata Delay Sync in ms for External Renderer */ #endif output_frame, tmpProcessing ); @@ -6296,10 +6296,7 @@ static ivas_error renderActiveInputsIsm( /* Skip inactive inputs */ continue; } -#ifdef FIX_488_SYNC_DELAY - /* Metadata Delay in subframes to sync with audio delay */ - pCurrentInput->ism_md_subframe_update_ext = hIvasRend->inputsIsm[0].ism_md_subframe_update_ext; -#endif + if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) { @@ -8346,7 +8343,7 @@ ivas_error IVAS_REND_SetIsmMetadataDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - hIvasRend->inputsIsm[0].ism_md_subframe_update_ext = sync_md_delay; + hIvasRend->inputsIsm[0].ism_metadata_delay_ms = sync_md_delay; return IVAS_ERR_OK; } -- GitLab From 9d33bfd12d623d3ca135012ec93c3e267e4100b6 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Fri, 21 Jul 2023 13:36:31 +0200 Subject: [PATCH 12/15] Corrected the comments --- lib_rend/lib_rend.c | 4 ++-- lib_rend/lib_rend.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 0f9591dfb0..25b1ab8a1b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8330,12 +8330,12 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( /*---------------------------------------------------------------------* * IVAS_REND_SetIsmMetadataDelay( ) * - * Set the total number of objects to the first object data + * Set the Metadata Delay in ms in order to sync with audio delay *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetIsmMetadataDelay( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - const uint16_t sync_md_delay /* i: total number of objects */ + const uint16_t sync_md_delay /* i: Ism Metadata Delay in ms to sync with audio delay */ ) { if ( hIvasRend == NULL ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 41fa28ebc6..1497d404c7 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -352,7 +352,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( #ifdef FIX_488_SYNC_DELAY ivas_error IVAS_REND_SetIsmMetadataDelay( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - const uint16_t sync_md_delay /* i: Metadata Delay in subframes to sync with audio delay */ + const uint16_t sync_md_delay /* i: Metadata Delay in ms to sync with audio delay */ ); #endif -- GitLab From 55f0e8c9d7e8d325dced9701b9f0edbc31226c01 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 22 Jul 2023 12:22:26 +0200 Subject: [PATCH 13/15] Change representation of sync delay to float under FIX_488_SYNC_DELAY --- apps/renderer.c | 4 ++-- lib_rend/lib_rend.c | 15 +++++++++++---- lib_rend/lib_rend.h | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index eea2daae2a..acb49ce39d 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -176,7 +176,7 @@ typedef struct bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; #ifdef FIX_488_SYNC_DELAY - int16_t syncMdDelay; + float syncMdDelay; #endif } CmdlnArgs; @@ -2656,7 +2656,7 @@ static void parseOption( case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); /* Metadata Delay to sync with audio delay in ms */ - args->syncMdDelay = (int16_t) strtof( optionValues[0], NULL ); + args->syncMdDelay = strtof( optionValues[0], NULL ); break; #endif default: diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 25b1ab8a1b..73eed402f4 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -152,7 +152,7 @@ typedef struct OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; #ifdef FIX_488_SYNC_DELAY - int16_t ism_metadata_delay_ms; + float ism_metadata_delay_ms; #endif } input_ism; @@ -6066,11 +6066,18 @@ static ivas_error renderIsmToSplitBinaural( float tmpBinaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; int16_t output_frame = ismInput->base.inputBuffer.config.numSamplesPerChannel; COMBINED_ORIENTATION_HANDLE pCombinedOrientationData; +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif push_wmops( "renderIsmToSplitBinaural" ); pSplitRendWrapper = ismInput->base.ctx.pSplitRendWrapper; pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; +#ifdef FIX_488_SYNC_DELAY + /* 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 ) ); +#endif /* If not yet allocated, open additional instances of TD renderer */ for ( i = 0; i < pMultiBinPoseData->num_poses - 1; ++i ) @@ -6150,7 +6157,7 @@ static ivas_error renderIsmToSplitBinaural( &ismInput->currentPos, NULL, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_metadata_delay_ms, /* Ism Audio Metadata Delay Sync in ms for External Renderer */ + ism_md_subframe_update_ext, #endif output_frame, tmpProcessing ); @@ -6168,7 +6175,7 @@ static ivas_error renderIsmToSplitBinaural( &ismInput->currentPos, NULL, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_metadata_delay_ms, /* Ism Audio Metadata Delay Sync in ms for External Renderer */ + ism_md_subframe_update_ext, #endif output_frame, tmpProcessing ); @@ -8335,7 +8342,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( ivas_error IVAS_REND_SetIsmMetadataDelay( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - const uint16_t sync_md_delay /* i: Ism Metadata Delay in ms to sync with audio delay */ + const float sync_md_delay /* i: Ism Metadata Delay in ms to sync with audio delay */ ) { if ( hIvasRend == NULL ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1497d404c7..c86b8bcbf2 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -352,7 +352,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( #ifdef FIX_488_SYNC_DELAY ivas_error IVAS_REND_SetIsmMetadataDelay( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - const uint16_t sync_md_delay /* i: Metadata Delay in ms to sync with audio delay */ + const float sync_md_delay /* i: Metadata Delay in ms to sync with audio delay */ ); #endif -- GitLab From 1abaacd76f9cb45237348735ce64481d36f6c5ec Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sat, 22 Jul 2023 13:30:25 +0200 Subject: [PATCH 14/15] Apply synch value for all isms -- resolve msan error --- lib_rend/lib_rend.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 73eed402f4..0efe833aa5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8341,16 +8341,21 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetIsmMetadataDelay( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - const float sync_md_delay /* i: Ism Metadata Delay in ms to sync with audio delay */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + const float sync_md_delay /* i: Ism Metadata Delay in ms to sync with audio delay */ ) { + int16_t i; + if ( hIvasRend == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - hIvasRend->inputsIsm[0].ism_metadata_delay_ms = sync_md_delay; + for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) + { + hIvasRend->inputsIsm[i].ism_metadata_delay_ms = sync_md_delay; + } return IVAS_ERR_OK; } -- GitLab From 6d11ef1ccf8a13a04df2b587c194dd60ed3613d6 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 24 Jul 2023 10:18:28 +0200 Subject: [PATCH 15/15] Convert floor to round in the printout message --- apps/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/renderer.c b/apps/renderer.c index acb49ce39d..bc7756ee81 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1919,7 +1919,7 @@ int main( #ifdef FIX_488_SYNC_DELAY if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { - fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) floor( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); + fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } #endif -- GitLab