From 6000b47a55fb4dfdf3beb77bbb335eda638d2a7b Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 15 Feb 2024 16:19:04 +0100 Subject: [PATCH 01/22] set shd_rot_max_order to 1 for nchan_internal == 4 || nchan_internal == 3 --- lib_dec/ivas_output_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index c93b16dcdb..221492abfb 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -188,7 +188,7 @@ void ivas_renderer_select( } else if ( nchan_internal == 4 || nchan_internal == 3 ) { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } else if ( nchan_internal == 6 || nchan_internal == 5 ) { -- GitLab From 8a905890163d5d390db83b0c269661fa02bc2c1e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 15 Feb 2024 16:48:58 +0100 Subject: [PATCH 02/22] wrap changes into ifdef NONBE_FIX_998_DIRAC_ROTATION --- lib_com/options.h | 2 ++ lib_dec/ivas_output_config.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 48d7a6cb28..a8336495ef 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,6 +182,8 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ +#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 221492abfb..346a6095da 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -188,7 +188,11 @@ void ivas_renderer_select( } else if ( nchan_internal == 4 || nchan_internal == 3 ) { +#ifdef NONBE_FIX_998_DIRAC_ROTATION st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; +#else + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; +#endif } else if ( nchan_internal == 6 || nchan_internal == 5 ) { -- GitLab From d435f5f452126fb222bf75e4c36a3cc74b6ceee8 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 12:09:34 +0100 Subject: [PATCH 03/22] allow head rotation with HOA3 output signals for debugging --- apps/decoder.c | 2 ++ lib_com/options.h | 4 +++- lib_dec/ivas_init_dec.c | 5 ++++- lib_dec/ivas_output_config.c | 12 ++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 01e6b4f3d1..ca40ee51b1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,6 +306,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ +#if 0 if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM @@ -315,6 +316,7 @@ int main( fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; } +#endif if ( ( error = RotationFileReader_open( arg.headrotTrajFileName, &headRotReader ) ) != IVAS_ERR_OK ) { diff --git a/lib_com/options.h b/lib_com/options.h index a8336495ef..6552e1ea1d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,9 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ -#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ +#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ + +#define ALLOW_HOA3_ROTATION /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e1b6a6a415..03a345e4ea 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3130,12 +3130,14 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); } #endif - if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM +#endif +#ifdef ALLOW_HOA3_ROTATION + || output_config == IVAS_AUDIO_CONFIG_HOA3 #endif ) ) { @@ -3143,6 +3145,7 @@ static ivas_error doSanityChecks_IVAS( } } + if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 346a6095da..45d736a602 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -79,6 +79,18 @@ void ivas_renderer_select( st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; } +#ifdef ALLOW_HOA3_ROTATION + if (output_config == IVAS_AUDIO_CONFIG_HOA3) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + +#ifdef NONBE_FIX_998_DIRAC_ROTATION + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; +#endif + + } +#endif + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM -- GitLab From d5255de12f598b1bcae6e9d7f00cf11536d738ef Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 12:17:32 +0100 Subject: [PATCH 04/22] fix formatting --- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_output_config.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 03a345e4ea..4355f45079 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3137,7 +3137,7 @@ static ivas_error doSanityChecks_IVAS( || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif #ifdef ALLOW_HOA3_ROTATION - || output_config == IVAS_AUDIO_CONFIG_HOA3 + || output_config == IVAS_AUDIO_CONFIG_HOA3 #endif ) ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 45d736a602..0305858161 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -80,15 +80,14 @@ void ivas_renderer_select( } #ifdef ALLOW_HOA3_ROTATION - if (output_config == IVAS_AUDIO_CONFIG_HOA3) - { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #ifdef NONBE_FIX_998_DIRAC_ROTATION st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; #endif - - } + } #endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -- GitLab From 652da7527703f13dced59b7883c3f7f2802e1d7a Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 12:30:50 +0100 Subject: [PATCH 05/22] fix condition for shf_rot_max_order setting under ALLOW_HOA3_ROTATION --- lib_dec/ivas_output_config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 0305858161..92a17bf7f2 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -80,7 +80,8 @@ void ivas_renderer_select( } #ifdef ALLOW_HOA3_ROTATION - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 ) + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; -- GitLab From 9157e765c44d8af5eb67b5c9f088e6ea18e6921c Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 13:10:22 +0100 Subject: [PATCH 06/22] fix msan error with ALLOW_HOA3_ROTATION --- lib_dec/ivas_output_config.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 92a17bf7f2..b0895bf031 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -80,15 +80,18 @@ void ivas_renderer_select( } #ifdef ALLOW_HOA3_ROTATION - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) + if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; #endif - } + } + } #endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -- GitLab From e516bcd290d3b87569b16d6c1393bbf59044a162 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 13:42:11 +0100 Subject: [PATCH 07/22] fix formatting --- lib_dec/ivas_output_config.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index b0895bf031..8af2c4c531 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -82,16 +82,16 @@ void ivas_renderer_select( #ifdef ALLOW_HOA3_ROTATION if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) - { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; + st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; #endif - } - } + } + } #endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -- GitLab From b1f5fd5fb122174fe71cc4661bb5bccf826c4978 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 16 Feb 2024 13:58:02 +0100 Subject: [PATCH 08/22] disable ALLOW_HOA3_ROTATION --- lib_com/options.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6552e1ea1d..67cda97653 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,9 +123,10 @@ /*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/* #define DEBUG_OSBA */ +/*#define DEBUG_OSBA */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ +/*#define ALLOW_HOA3_ROTATION*/ /* Allow outputting rotated HOA3 signals */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ @@ -184,8 +185,6 @@ #define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ -#define ALLOW_HOA3_ROTATION - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ -- GitLab From 8e1b1a5c52c578087021e9f604837c2a43f92a18 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 16 Feb 2024 15:17:37 +0100 Subject: [PATCH 09/22] formal improvements --- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_output_config.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 4355f45079..58329a6ce4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3130,6 +3130,7 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); } #endif + if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB @@ -3145,7 +3146,6 @@ static ivas_error doSanityChecks_IVAS( } } - if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 8af2c4c531..7b77db1076 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -85,15 +85,15 @@ void ivas_renderer_select( nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; - #ifdef NONBE_FIX_998_DIRAC_ROTATION st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; +#else + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; #endif } } -#endif +#endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM @@ -197,18 +197,21 @@ void ivas_renderer_select( { nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + +#ifdef NONBE_FIX_998_DIRAC_ROTATION + if ( nchan_internal == 4 || nchan_internal == 3 || nchan_internal == 2 ) +#else if ( nchan_internal == 2 ) +#endif { st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } +#ifndef NONBE_FIX_998_DIRAC_ROTATION else if ( nchan_internal == 4 || nchan_internal == 3 ) { -#ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; -#else st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; -#endif } +#endif else if ( nchan_internal == 6 || nchan_internal == 5 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 2; -- GitLab From be41fb0e885fab5951bda1cfa0dd7122266b6f83 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 19 Feb 2024 13:25:03 +0100 Subject: [PATCH 10/22] fix ifdef in head-rotation sanity check --- apps/decoder.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ca40ee51b1..83e360e687 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,8 +306,11 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ -#if 0 - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR +#ifdef ALLOW_HOA3_ROTATION + && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 +#endif + && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif @@ -316,7 +319,6 @@ int main( fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; } -#endif if ( ( error = RotationFileReader_open( arg.headrotTrajFileName, &headRotReader ) ) != IVAS_ERR_OK ) { -- GitLab From 83f4f3d9bbd08e80a2d5e6443626030fad2b9a4b Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 19 Feb 2024 13:26:42 +0100 Subject: [PATCH 11/22] fix formatting --- apps/decoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 83e360e687..2be9c78d87 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,11 +306,11 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR #ifdef ALLOW_HOA3_ROTATION - && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 -#endif - && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 +#endif + && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif -- GitLab From 350ba166491b5635fb9af9a47e4ffb83a1deb09e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Fri, 23 Feb 2024 15:56:23 +0100 Subject: [PATCH 12/22] delete code under ifdef NONBE_FIX_998_DIRAC_ROTATION --- lib_com/options.h | 2 -- lib_dec/ivas_output_config.c | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 67cda97653..1086720749 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,8 +183,6 @@ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ -#define NONBE_FIX_998_DIRAC_ROTATION /* FhG: fix issue 998: DirAC scene rotation accidentially deactivated */ - /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 7b77db1076..bb672ffb31 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -198,20 +198,10 @@ void ivas_renderer_select( nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_998_DIRAC_ROTATION - if ( nchan_internal == 4 || nchan_internal == 3 || nchan_internal == 2 ) -#else if ( nchan_internal == 2 ) -#endif { st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } -#ifndef NONBE_FIX_998_DIRAC_ROTATION - else if ( nchan_internal == 4 || nchan_internal == 3 ) - { - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; - } -#endif else if ( nchan_internal == 6 || nchan_internal == 5 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 2; -- GitLab From c4c4f37905e80ed9051684c92eba757b283fd445 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 08:55:03 +0100 Subject: [PATCH 13/22] remove unused split-order function under ifdef FIX_998_UNUSED_FUNCTION --- lib_rend/ivas_dirac_output_synthesis_dec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 0eb06064dd..25d119ae88 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1570,7 +1570,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( return; } - +#ifndef FIX_998_UNUSED_FUNCTION /*------------------------------------------------------------------------- * ivas_dirac_dec_get_response_split_order() * @@ -1732,7 +1732,7 @@ static void ivas_dirac_dec_get_response_split_order( return; } - +#endif /*------------------------------------------------------------------------- * ivas_dirac_dec_compute_directional_responses() @@ -1821,7 +1821,7 @@ void ivas_dirac_dec_compute_directional_responses( { set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); - +#ifndef FIX_998_UNUSED_FUNCTION if ( p_Rmat != 0 ) { ivas_dirac_dec_get_response_split_order( azimuth[k], elevation[k], direct_response_hoa, shd_rot_max_order, p_Rmat ); @@ -1832,6 +1832,7 @@ void ivas_dirac_dec_compute_directional_responses( } } else +#endif { ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); -- GitLab From bc282dbb51b678ade2c7682459fb431ddd1b4a04 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 08:56:20 +0100 Subject: [PATCH 14/22] delete code under ifdef ALLOW_HOA3_ROTATION --- apps/decoder.c | 6 +----- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 3 --- lib_dec/ivas_output_config.c | 15 --------------- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 2be9c78d87..01e6b4f3d1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -306,11 +306,7 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR -#ifdef ALLOW_HOA3_ROTATION - && arg.outputConfig != IVAS_AUDIO_CONFIG_HOA3 -#endif - && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_com/options.h b/lib_com/options.h index 1086720749..f2757f11ea 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -126,7 +126,6 @@ /*#define DEBUG_OSBA */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ -/*#define ALLOW_HOA3_ROTATION*/ /* Allow outputting rotated HOA3 signals */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 58329a6ce4..e1b6a6a415 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -3136,9 +3136,6 @@ static ivas_error doSanityChecks_IVAS( if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM -#endif -#ifdef ALLOW_HOA3_ROTATION - || output_config == IVAS_AUDIO_CONFIG_HOA3 #endif ) ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index bb672ffb31..e4e8f6c437 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -79,21 +79,6 @@ void ivas_renderer_select( st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; } -#ifdef ALLOW_HOA3_ROTATION - if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( output_config == IVAS_AUDIO_CONFIG_HOA3 && st_ivas->hDecoderConfig->Opt_Headrotation && nchan_internal >= 2 ) - { -#ifdef NONBE_FIX_998_DIRAC_ROTATION - st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; -#else - st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; -#endif - } - } - -#endif if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM -- GitLab From 488636747664be0b77efcae3b2a0228e53ed7949 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 09:19:01 +0100 Subject: [PATCH 15/22] enable define FIX_998_UNUSED_FUNCTION --- lib_com/options.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index caeaa8c4b9..c0447a2142 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,7 +124,7 @@ /*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/*#define DEBUG_OSBA */ +/* #define DEBUG_OSBA*/ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ @@ -163,7 +163,8 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ -#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ /* #################### End BE switches ################################## */ -- GitLab From 79cb6aa061bb44b47b673ac14d915cc935b64982 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 09:19:30 +0100 Subject: [PATCH 16/22] undo changes to ivas_output_config.c --- lib_com/options.h | 4 ++-- lib_dec/ivas_output_config.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c0447a2142..a53439dac2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,7 +124,7 @@ /*#define DEBUG_AGC*/ /* debug SPAR AGC in-out */ #endif /*#define SPAR_HOA_DBG*/ /* SPAR HOA debug statements */ -/* #define DEBUG_OSBA*/ +/* #define DEBUG_OSBA */ /*#define DEBUG_BINAURAL_FILTER_DESIGN*/ /* debugging of Crend binaural filter design */ /*#define DEBUG_AGC_ENCODER_CMD_OPTION*/ /* Ability to force enable or disable AGC behaviour in DIRAC/SPAR via command line option */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ @@ -163,7 +163,7 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ -#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ #define FIX_998_UNUSED_FUNCTION /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e4e8f6c437..c93b16dcdb 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -182,11 +182,14 @@ void ivas_renderer_select( { nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - if ( nchan_internal == 2 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 1; } + else if ( nchan_internal == 4 || nchan_internal == 3 ) + { + st_ivas->hCombinedOrientationData->shd_rot_max_order = 0; + } else if ( nchan_internal == 6 || nchan_internal == 5 ) { st_ivas->hCombinedOrientationData->shd_rot_max_order = 2; -- GitLab From 2065b05e8927c8f79452340305f22abc6da11e66 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 09:52:48 +0100 Subject: [PATCH 17/22] fix compiler warnings --- lib_dec/ivas_dirac_dec.c | 8 ++++++++ lib_rend/ivas_dirac_output_synthesis_dec.c | 8 ++++++++ lib_rend/ivas_dirac_rend.c | 16 ++++++++++------ lib_rend/ivas_prot_rend.h | 4 ++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8e3f383fea..f4309dd409 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1856,8 +1856,10 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, +#endif hodirac_flag ); } else @@ -1871,8 +1873,10 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION 0, NULL, +#endif hodirac_flag ); } } @@ -2213,8 +2217,10 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, +#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, +#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, @@ -2231,8 +2237,10 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, +#ifndef FIX_998_UNUSED_FUNCTION 0, 0, +#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index 25d119ae88..a1ef9a3052 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -542,8 +542,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ +#ifndef FIX_998_UNUSED_FUNCTION const int16_t sh_rot_max_order, const float *p_Rmat, /* i : rotation matrix */ +#endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport, /* i : number of transport channels*/ @@ -590,8 +592,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( elevation, md_idx, NULL, +#ifndef FIX_998_UNUSED_FUNCTION 2, p_Rmat, +#endif hodirac_flag ); } @@ -638,8 +642,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( elevation, md_idx, NULL, +#ifndef FIX_998_UNUSED_FUNCTION sh_rot_max_order, p_Rmat, +#endif hodirac_flag ); if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) @@ -1750,8 +1756,10 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t *elevation, const int16_t md_idx, const float *surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat, /* i : rotation matrix */ +#endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ) { diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index ca2760d127..8bffbf9c39 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -230,14 +230,14 @@ ivas_error ivas_spat_hSpatParamRendCom_config( if ( flag_config == DIRAC_OPEN ) { - hSpatParamRendCom->slot_size = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); + hSpatParamRendCom->slot_size = ( int16_t )( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); set_s( hSpatParamRendCom->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hSpatParamRendCom->subframe_nbslots, JBM_CLDFB_SLOTS_IN_SUBFRAME, DEFAULT_JBM_SUBFRAMES_5MS ); hSpatParamRendCom->nb_subframes = DEFAULT_JBM_SUBFRAMES_5MS; hSpatParamRendCom->subframes_rendered = 0; hSpatParamRendCom->slots_rendered = 0; hSpatParamRendCom->num_slots = DEFAULT_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME; - hSpatParamRendCom->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + hSpatParamRendCom->num_freq_bands = ( int16_t )( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hSpatParamRendCom->numSimultaneousDirections = 0; hSpatParamRendCom->numParametricDirections = 0; hSpatParamRendCom->numIsmDirections = 0; @@ -1791,8 +1791,8 @@ void computeDirectionAngles( z = *( intensity_real_z++ ) * intensityNorm; } radius = sqrtf( x * x + y * y ); - azimuth[k] = (int16_t) ( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); - elevation[k] = (int16_t) ( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); + azimuth[k] = ( int16_t )( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); + elevation[k] = ( int16_t )( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); } return; @@ -2077,8 +2077,8 @@ void rotateAziEle_DirAC( dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2; /*Conversion spherical to cartesian coordinates*/ - azi[b] = (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); - ele[b] = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); + azi[b] = ( int16_t )( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); + ele[b] = ( int16_t )( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); } pop_wmops(); @@ -2216,8 +2216,10 @@ static void ivas_masa_ext_dirac_render_sf( elevation, md_idx, surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION 0, NULL, +#endif 0 ); @@ -2372,8 +2374,10 @@ static void ivas_masa_ext_dirac_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, +#ifndef FIX_998_UNUSED_FUNCTION 0, 0, +#endif hMasaExtRend->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 80b53d508d..7173290bb5 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -470,8 +470,10 @@ void ivas_dirac_dec_output_synthesis_process_slot( const float *diffuseness, SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle */ DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ +#ifndef FIX_998_UNUSED_FUNCTION const int16_t sh_rot_max_order, const float *p_Rmat, /* i : rotation matrix */ +#endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ const int16_t nchan_transport, /* i : number of transport channels */ @@ -538,8 +540,10 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t *elevation, const int16_t md_idx, const float *surCohRatio, +#ifndef FIX_998_UNUSED_FUNCTION const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat, /* i : rotation matrix */ +#endif const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ); -- GitLab From c7f4ff07acaea1d1f4a1320e06873373e51e89e6 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 10:21:03 +0100 Subject: [PATCH 18/22] fix formatting --- lib_rend/ivas_dirac_output_synthesis_dec.c | 4 ++-- lib_rend/ivas_dirac_rend.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index a1ef9a3052..f985b514f5 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -544,7 +544,7 @@ void ivas_dirac_dec_output_synthesis_process_slot( DIRAC_REND_HANDLE hDirACRend, /* i/o: DirAC renderer handle */ #ifndef FIX_998_UNUSED_FUNCTION const int16_t sh_rot_max_order, - const float *p_Rmat, /* i : rotation matrix */ + const float *p_Rmat, /* i : rotation matrix */ #endif const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const IVAS_OUTPUT_SETUP hOutSetup, /* i : output setup structure */ @@ -1760,7 +1760,7 @@ void ivas_dirac_dec_compute_directional_responses( const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat, /* i : rotation matrix */ #endif - const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ + const int16_t hodirac_flag /* i : flag to indicate HO-DirAC mode */ ) { int16_t k, l; diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 8bffbf9c39..7cd26526c7 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -230,14 +230,14 @@ ivas_error ivas_spat_hSpatParamRendCom_config( if ( flag_config == DIRAC_OPEN ) { - hSpatParamRendCom->slot_size = ( int16_t )( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); + hSpatParamRendCom->slot_size = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX ); set_s( hSpatParamRendCom->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hSpatParamRendCom->subframe_nbslots, JBM_CLDFB_SLOTS_IN_SUBFRAME, DEFAULT_JBM_SUBFRAMES_5MS ); hSpatParamRendCom->nb_subframes = DEFAULT_JBM_SUBFRAMES_5MS; hSpatParamRendCom->subframes_rendered = 0; hSpatParamRendCom->slots_rendered = 0; hSpatParamRendCom->num_slots = DEFAULT_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME; - hSpatParamRendCom->num_freq_bands = ( int16_t )( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + hSpatParamRendCom->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hSpatParamRendCom->numSimultaneousDirections = 0; hSpatParamRendCom->numParametricDirections = 0; hSpatParamRendCom->numIsmDirections = 0; @@ -1791,8 +1791,8 @@ void computeDirectionAngles( z = *( intensity_real_z++ ) * intensityNorm; } radius = sqrtf( x * x + y * y ); - azimuth[k] = ( int16_t )( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); - elevation[k] = ( int16_t )( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); + azimuth[k] = (int16_t) ( max( -180.0f, min( 180.0f, atan2f( y, x ) / EVS_PI * 180.0f ) ) + 0.5f ); + elevation[k] = (int16_t) ( max( -90.0f, min( 180.0f, atan2f( z, radius ) / EVS_PI * 180.0f ) ) + 0.5f ); } return; @@ -2077,8 +2077,8 @@ void rotateAziEle_DirAC( dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2; /*Conversion spherical to cartesian coordinates*/ - azi[b] = ( int16_t )( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); - ele[b] = ( int16_t )( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); + azi[b] = (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ); + ele[b] = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); } pop_wmops(); -- GitLab From ff7c953a253482aa18408affb9505921c13d1c58 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:17:27 +0100 Subject: [PATCH 19/22] address formatting comments --- lib_rend/ivas_dirac_output_synthesis_dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_rend/ivas_dirac_output_synthesis_dec.c b/lib_rend/ivas_dirac_output_synthesis_dec.c index f985b514f5..4e9d7db6cb 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec.c @@ -1829,6 +1829,7 @@ void ivas_dirac_dec_compute_directional_responses( { set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS ); set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS ); + #ifndef FIX_998_UNUSED_FUNCTION if ( p_Rmat != 0 ) { @@ -1840,15 +1841,17 @@ void ivas_dirac_dec_compute_directional_responses( } } else -#endif { +#endif ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order ); if ( hodirac_flag ) { ivas_dirac_dec_get_response( azimuth2[k], elevation2[k], direct_response_dir2, hDirACRend->hOutSetup.ambisonics_order ); } +#ifndef FIX_998_UNUSED_FUNCTION } +#endif if ( masa_band_mapping == NULL && hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { -- GitLab From 959debdc955415c5f37b85ed9b24db2bb532da56 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:24:43 +0100 Subject: [PATCH 20/22] delete unnecessary if conditions from ivas_dirac_dec_render_sf --- lib_dec/ivas_dirac_dec.c | 57 +++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f4309dd409..555b0f87c6 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1013,7 +1013,7 @@ void ivas_dirac_dec_read_BS( if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { next_bit_pos_orig = st->next_bit_pos; - st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); + st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 ); if ( last_bit_pos > 0 ) { st->next_bit_pos = last_bit_pos; @@ -1086,7 +1086,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ - st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); + st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits )++; @@ -1394,13 +1394,13 @@ void ivas_qmetadata_to_dirac( if ( hodirac_flag ) { - azi = (int16_t) ( azimuth + 0.5f ); - ele = (int16_t) ( elevation + 0.5f ); + azi = ( int16_t )( azimuth + 0.5f ); + ele = ( int16_t )( elevation + 0.5f ); } else { - azi = (int16_t) ( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); - ele = (int16_t) ( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); + azi = ( int16_t )( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); + ele = ( int16_t )( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); /* limit the elevation to [-90, 90] */ ele = min( 90, ele ); ele = max( -90, ele ); @@ -1736,10 +1736,10 @@ void ivas_dirac_dec_render_sf( { for ( i = 0; i < output_frame; i++ ) { - tmp[nchan_transport * i + n] = (int16_t) ( output_f[n][i] + 0.5f ); + tmp[nchan_transport * i + n] = ( int16_t )( output_f[n][i] + 0.5f ); } } - sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, (int16_t) ( output_frame * 0.05 ) ); + sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, ( int16_t )( output_frame * 0.05 ) ); dbgwrite( tmp, sizeof( int16_t ), nchan_transport * output_frame, 1, file_name ); } #endif @@ -1844,6 +1844,7 @@ void ivas_dirac_dec_render_sf( set_zero( surCohRatio, hSpatParamRendCom->num_freq_bands ); } } +#ifndef FIX_998_UNUSED_FUNCTION if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) { @@ -1856,10 +1857,8 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, -#endif hodirac_flag ); } else @@ -1873,13 +1872,23 @@ void ivas_dirac_dec_render_sf( elevation, md_idx, surCohRatio, -#ifndef FIX_998_UNUSED_FUNCTION 0, NULL, -#endif hodirac_flag ); } } +#else + ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, + hDirACRend, + st_ivas->hVBAPdata, + st_ivas->hMasa == NULL ? NULL : st_ivas->hMasa->data.band_mapping, + st_ivas->hMasaIsmData, + azimuth, + elevation, + md_idx, + surCohRatio, + hodirac_flag ); +#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) { @@ -2208,6 +2217,7 @@ void ivas_dirac_dec_render_sf( } /*Compute PSDs*/ +#ifndef FIX_998_UNUSED_FUNCTION if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) { ivas_dirac_dec_output_synthesis_process_slot( reference_power, @@ -2217,10 +2227,8 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, -#ifndef FIX_998_UNUSED_FUNCTION st_ivas->hCombinedOrientationData->shd_rot_max_order, p_Rmat, -#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, @@ -2237,10 +2245,8 @@ void ivas_dirac_dec_render_sf( hSpatParamRendCom->diffuseness_vector[md_idx], hSpatParamRendCom, hDirACRend, -#ifndef FIX_998_UNUSED_FUNCTION 0, 0, -#endif st_ivas->hVBAPdata, hDirACRend->hOutSetup, nchan_transport, @@ -2248,6 +2254,21 @@ void ivas_dirac_dec_render_sf( hodirac_flag, hDirAC->hConfig->dec_param_estim ); } +#else + ivas_dirac_dec_output_synthesis_process_slot( reference_power, + p_onset_filter, + azimuth, + elevation, + hSpatParamRendCom->diffuseness_vector[md_idx], + hSpatParamRendCom, + hDirACRend, + st_ivas->hVBAPdata, + hDirACRend->hOutSetup, + nchan_transport, + md_idx, + hodirac_flag, + hDirAC->hConfig->dec_param_estim ); +#endif if ( hDirAC->hConfig->dec_param_estim ) { @@ -2451,8 +2472,8 @@ void ivas_dirac_dec_render_sf( RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; #else - RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; - ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; + RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; #endif } -- GitLab From f26c7ed3ca1d83687aaa64a42b0eec00e0be3861 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:34:04 +0100 Subject: [PATCH 21/22] fix formatting --- lib_dec/ivas_dirac_dec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 555b0f87c6..538b2532ae 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1013,7 +1013,7 @@ void ivas_dirac_dec_read_BS( if ( !st->bfi && ivas_total_brate > IVAS_SID_5k2 ) { next_bit_pos_orig = st->next_bit_pos; - st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 ); + st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); if ( last_bit_pos > 0 ) { st->next_bit_pos = last_bit_pos; @@ -1086,7 +1086,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ - st->next_bit_pos = ( int16_t )( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); + st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits )++; @@ -1394,13 +1394,13 @@ void ivas_qmetadata_to_dirac( if ( hodirac_flag ) { - azi = ( int16_t )( azimuth + 0.5f ); - ele = ( int16_t )( elevation + 0.5f ); + azi = (int16_t) ( azimuth + 0.5f ); + ele = (int16_t) ( elevation + 0.5f ); } else { - azi = ( int16_t )( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); - ele = ( int16_t )( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); + azi = (int16_t) ( azimuth + rand_triangular_signed( seed_ptr ) * dirac_dithering_azi_scale[diff_idx] + 0.5f ); + ele = (int16_t) ( elevation + rand_triangular_signed( seed_ptr ) * dirac_dithering_ele_scale[diff_idx] + 0.5f ); /* limit the elevation to [-90, 90] */ ele = min( 90, ele ); ele = max( -90, ele ); @@ -1736,10 +1736,10 @@ void ivas_dirac_dec_render_sf( { for ( i = 0; i < output_frame; i++ ) { - tmp[nchan_transport * i + n] = ( int16_t )( output_f[n][i] + 0.5f ); + tmp[nchan_transport * i + n] = (int16_t) ( output_f[n][i] + 0.5f ); } } - sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, ( int16_t )( output_frame * 0.05 ) ); + sprintf( file_name, "./res/ivas_dirac_dec_DMX%d.%d.pcm", nchan_transport, (int16_t) ( output_frame * 0.05 ) ); dbgwrite( tmp, sizeof( int16_t ), nchan_transport * output_frame, 1, file_name ); } #endif -- GitLab From 27f615ab1b1e3309154b918abfd0e24b7acf30c7 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Mon, 26 Feb 2024 11:45:46 +0100 Subject: [PATCH 22/22] fix compile error --- lib_dec/ivas_dirac_dec.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 538b2532ae..849caa6e8e 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1876,7 +1876,6 @@ void ivas_dirac_dec_render_sf( NULL, hodirac_flag ); } - } #else ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom, hDirACRend, @@ -1889,6 +1888,7 @@ void ivas_dirac_dec_render_sf( surCohRatio, hodirac_flag ); #endif + } if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) { @@ -2255,19 +2255,19 @@ void ivas_dirac_dec_render_sf( hDirAC->hConfig->dec_param_estim ); } #else - ivas_dirac_dec_output_synthesis_process_slot( reference_power, - p_onset_filter, - azimuth, - elevation, - hSpatParamRendCom->diffuseness_vector[md_idx], - hSpatParamRendCom, - hDirACRend, - st_ivas->hVBAPdata, - hDirACRend->hOutSetup, - nchan_transport, - md_idx, - hodirac_flag, - hDirAC->hConfig->dec_param_estim ); + ivas_dirac_dec_output_synthesis_process_slot( reference_power, + p_onset_filter, + azimuth, + elevation, + hSpatParamRendCom->diffuseness_vector[md_idx], + hSpatParamRendCom, + hDirACRend, + st_ivas->hVBAPdata, + hDirACRend->hOutSetup, + nchan_transport, + md_idx, + hodirac_flag, + hDirAC->hConfig->dec_param_estim ); #endif if ( hDirAC->hConfig->dec_param_estim ) @@ -2472,8 +2472,8 @@ void ivas_dirac_dec_render_sf( RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; #else - RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; - ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; + RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; #endif } -- GitLab