From 958b0ce482b314695e20b8baf34a41aa28f7bb67 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 22 Oct 2025 14:25:08 +0200 Subject: [PATCH 1/9] use edited angles in ISM gain calculation --- lib_com/options.h | 2 +- lib_dec/ivas_ism_param_dec_fx.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index fefc866d6..3bab55372 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -125,7 +125,7 @@ #define FIX_1217_OBJECT_EDIT_FILE_INTERFACE /* Nokia: issue #1217: add decoder functionality to read object edit instructions from a file */ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ - +#define FIX_2193_ISM_GAINS_WITH_OE /* FhG: fix issue 2193: use edited angles in ISM gain calculation */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index d2243feb2..df2f0da61 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1054,8 +1054,13 @@ void ivas_ism_dec_digest_tc_fx( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) { /*get HOA gets for direction (ACN/SN3D)*/ +#ifdef FIX_2193_ISM_GAINS_WITH_OE Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 +#else + Word16 azi = shr( extract_h( azimuth_fx ), 22 - 16 ); // Q0 + Word16 ele = shr( extract_h( elevation_fx ), 22 - 16 ); // Q0 +#endif ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); -- GitLab From 85de5fb80900b82496ec96ad626a1b9e55275a75 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 22 Oct 2025 15:16:54 +0200 Subject: [PATCH 2/9] fix Q values of azi and ele --- lib_dec/ivas_ism_param_dec_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index df2f0da61..d22a1fc8c 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1055,11 +1055,11 @@ void ivas_ism_dec_digest_tc_fx( { /*get HOA gets for direction (ACN/SN3D)*/ #ifdef FIX_2193_ISM_GAINS_WITH_OE - Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 - Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 + Word16 azi = azimuth_fx; // Q0 + Word16 ele = elevation_fx; // Q0 #else - Word16 azi = shr( extract_h( azimuth_fx ), 22 - 16 ); // Q0 - Word16 ele = shr( extract_h( elevation_fx ), 22 - 16 ); // Q0 + Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), Q22 ); // Q22 + Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), Q22 ); // Q22 #endif ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); -- GitLab From fbc5bfd1cfe6f903f7fbbb55fa1a71cc4d96cf1f Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 22 Oct 2025 15:19:03 +0200 Subject: [PATCH 3/9] fix Q values of azi and ele when FIX_2193_ISM_GAINS_WITH_OE is disabled --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index d22a1fc8c..f14af5798 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1058,8 +1058,8 @@ void ivas_ism_dec_digest_tc_fx( Word16 azi = azimuth_fx; // Q0 Word16 ele = elevation_fx; // Q0 #else - Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), Q22 ); // Q22 - Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), Q22 ); // Q22 + Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q22 + Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q22 #endif ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); -- GitLab From 3ab14358a89115bc0237e2cbcd75a90a828c38c0 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 22 Oct 2025 15:22:47 +0200 Subject: [PATCH 4/9] fix comment in ivas_ism_dec_digest_tc_fx --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index f14af5798..8f03f69f5 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1058,8 +1058,8 @@ void ivas_ism_dec_digest_tc_fx( Word16 azi = azimuth_fx; // Q0 Word16 ele = elevation_fx; // Q0 #else - Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q22 - Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q22 + Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 + Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 #endif ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); -- GitLab From 20aaa2aff9b9e20dcefc483fe451c63933db0cf5 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 22 Oct 2025 15:36:23 +0200 Subject: [PATCH 5/9] fix compiler warning --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 8f03f69f5..5285af596 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1055,8 +1055,8 @@ void ivas_ism_dec_digest_tc_fx( { /*get HOA gets for direction (ACN/SN3D)*/ #ifdef FIX_2193_ISM_GAINS_WITH_OE - Word16 azi = azimuth_fx; // Q0 - Word16 ele = elevation_fx; // Q0 + Word16 azi = (Word16) azimuth_fx; // Q0 + Word16 ele = (Word16) elevation_fx; // Q0 #else Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 -- GitLab From b041395ab59659487ba88ff677b3052352d19a92 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 22 Oct 2025 16:28:13 +0200 Subject: [PATCH 6/9] use extract_l rather than a cast --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 5285af596..3df9f70e6 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1055,8 +1055,8 @@ void ivas_ism_dec_digest_tc_fx( { /*get HOA gets for direction (ACN/SN3D)*/ #ifdef FIX_2193_ISM_GAINS_WITH_OE - Word16 azi = (Word16) azimuth_fx; // Q0 - Word16 ele = (Word16) elevation_fx; // Q0 + Word16 azi = extract_l( azimuth_fx ); // Q0 + Word16 ele = extract_l( elevation_fx ); // Q0 #else Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 -- GitLab From b4db0eda8eff35ce07b089ae5299faca4ff0d891 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 5 Nov 2025 18:54:02 +0100 Subject: [PATCH 7/9] formatting --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 2f9844cae..575b4c344 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1073,8 +1073,8 @@ void ivas_ism_dec_digest_tc_fx( Word16 azi = extract_l( azimuth_fx ); // Q0 Word16 ele = extract_l( elevation_fx ); // Q0 #else - Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 - Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 + Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 + Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 #endif ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); -- GitLab From 5426db3deac3f95751384cabcf2f25db9edc3fc3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 5 Nov 2025 19:26:13 +0100 Subject: [PATCH 8/9] fix merge conflicts --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 575b4c344..3036c2a4a 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1070,8 +1070,8 @@ void ivas_ism_dec_digest_tc_fx( { /*get HOA gets for direction (ACN/SN3D)*/ #ifdef FIX_2193_ISM_GAINS_WITH_OE - Word16 azi = extract_l( azimuth_fx ); // Q0 - Word16 ele = extract_l( elevation_fx ); // Q0 + Word16 azi = extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 22 ) ); // Q0 + Word16 ele = extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 22 ) ); // Q0 #else Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 -- GitLab From 094d7149bb70c3a57eb824b10432c25d6467c332 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 5 Nov 2025 20:06:44 +0100 Subject: [PATCH 9/9] use rounding to match float --- lib_dec/ivas_ism_param_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 3036c2a4a..6af94ea97 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1070,8 +1070,8 @@ void ivas_ism_dec_digest_tc_fx( { /*get HOA gets for direction (ACN/SN3D)*/ #ifdef FIX_2193_ISM_GAINS_WITH_OE - Word16 azi = extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 22 ) ); // Q0 - Word16 ele = extract_l( L_shr( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 22 ) ); // Q0 + Word16 azi = round_fx( L_shr( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, Q22 - Q16 ) ); // Q0 + Word16 ele = round_fx( L_shr( st_ivas->hIsmMetaData[i]->edited_elevation_fx, Q22 - Q16 ) ); // Q0 #else Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 -- GitLab