From 3434e5fda6bda8b3fe5a5f14b841ca5231f17fb8 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 24 Jan 2023 17:23:21 +0100 Subject: [PATCH 1/7] fix for delay compensation when crend is not used --- lib_rend/lib_rend.c | 6 +++--- tests/renderer/constants.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 61a3682680..c4d41ebc55 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3348,7 +3348,7 @@ ivas_error IVAS_REND_GetDelay( if ( hIvasRend->inputsIsm[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { #ifdef FIX_197_CREND_INTERFACE - latency_ns = max( hIvasRend->inputsIsm[i].crendWrapper->binaural_latency_ns, + latency_ns = max( ( hIvasRend->inputsIsm[i].crendWrapper != NULL ) ? hIvasRend->inputsIsm[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns ); #else latency_ns = max( hIvasRend->inputsIsm[i].crendWrapper.binaural_latency_ns, @@ -3363,7 +3363,7 @@ ivas_error IVAS_REND_GetDelay( if ( hIvasRend->inputsMc[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { #ifdef FIX_197_CREND_INTERFACE - latency_ns = max( hIvasRend->inputsMc[i].crendWrapper->binaural_latency_ns, + latency_ns = max( ( hIvasRend->inputsMc[i].crendWrapper != NULL ) ? hIvasRend->inputsMc[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns ); #else latency_ns = max( hIvasRend->inputsMc[i].crendWrapper.binaural_latency_ns, @@ -3378,7 +3378,7 @@ ivas_error IVAS_REND_GetDelay( if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { #ifdef FIX_197_CREND_INTERFACE - latency_ns = hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns; + latency_ns = ( hIvasRend->inputsSba[i].crendWrapper != NULL ) ? hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns : 0; #else latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; #endif diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index d71f73e5b7..3b90b64b72 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -56,7 +56,7 @@ RENDERER_CMD = [ "", # 8 -> output format "-fs", "48", # 10 -> input fs - "--no_delay_cmp", + # "--no_delay_cmp", # "-ndl", "-q", ] -- GitLab From ed89814b726010315b85e94e33878da9463871b3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 24 Jan 2023 17:35:34 +0100 Subject: [PATCH 2/7] re-enable --no_delay_cmp to allow pipeline to pass --- tests/renderer/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 3b90b64b72..d71f73e5b7 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -56,7 +56,7 @@ RENDERER_CMD = [ "", # 8 -> output format "-fs", "48", # 10 -> input fs - # "--no_delay_cmp", + "--no_delay_cmp", # "-ndl", "-q", ] -- GitLab From 618a059cb5a5c0df0dce0d6410bd8a287f8b748b Mon Sep 17 00:00:00 2001 From: muxe6256 Date: Tue, 24 Jan 2023 17:48:20 +0100 Subject: [PATCH 3/7] fix compilation error when FIX_197_CREND_INTERFACE is not defined --- lib_dec/ivas_mct_dec.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 75d122f20e..d9313b5642 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1128,15 +1128,13 @@ static ivas_error ivas_mc_dec_reconfig( st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; } #else - } - else if ( st_ivas->hCrend == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) - { - if ( ivas_crend_open( st_ivas ) != IVAS_ERR_OK ) + else if ( st_ivas->hCrend == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "ivas_crend_open failed" ); + if ( ivas_crend_open( st_ivas ) != IVAS_ERR_OK ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "ivas_crend_open failed" ); + } } - } - #endif } /* mono/stereo */ -- GitLab From 7f3ad3bfa58a11f26c518bcdade48a2324f468ff Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 19:40:06 +0000 Subject: [PATCH 4/7] Correct assignment within conditional expression within FIX_197_CREND_INTERFACE --- lib_dec/ivas_mct_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index d9313b5642..3836f7b704 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1121,7 +1121,7 @@ static ivas_error ivas_mc_dec_reconfig( getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ), st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, - st_ivas->hDecoderConfig->output_Fs ) != IVAS_ERR_OK ) ) + st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 1d650d1488fd0b2175d9343370801ce30dfd1119 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 19:41:21 +0000 Subject: [PATCH 5/7] Correct assignment within conditional expression within FIX_197_CREND_INTERFACE --- lib_dec/ivas_init_dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 0e5f58fc3d..d38ef28ed6 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1187,14 +1187,16 @@ ivas_error ivas_init_decoder( return error; } } + if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ), st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, - st_ivas->hDecoderConfig->output_Fs ) != IVAS_ERR_OK ) ) + st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } + st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; #else if ( ivas_crend_open( st_ivas ) != IVAS_ERR_OK ) -- GitLab From 531253d9a5a895002848ccd8d370a0ff8307854f Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 19:42:12 +0000 Subject: [PATCH 6/7] Correct assignment within conditional expression within FIX_197_CREND_INTERFACE --- lib_dec/ivas_dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 48d6cde236..e4a08b0540 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -413,13 +413,14 @@ ivas_error ivas_dec( &st_ivas->hIntSetup, st_ivas->hEFAPdata, output, - output_Fs ) != IVAS_ERR_OK ) ) + output_Fs ) ) != IVAS_ERR_OK ) { return error; } #else ivas_crend_process( st_ivas, output ); #endif + ivas_binaural_add_LFE( st_ivas, output_frame, output ); } else if ( st_ivas->renderer_type == RENDERER_MC ) -- GitLab From 97985b88e5c4ca9cb7d33108901e975926c12f9f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 24 Jan 2023 21:22:41 +0100 Subject: [PATCH 7/7] apply clang-format patchfile --- lib_dec/ivas_init_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d38ef28ed6..535ba14fb7 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1196,7 +1196,7 @@ ivas_error ivas_init_decoder( { return error; } - + st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; #else if ( ivas_crend_open( st_ivas ) != IVAS_ERR_OK ) -- GitLab