From 982416e7189f8d3e96b6bac04a9c2d1058cd2df4 Mon Sep 17 00:00:00 2001 From: naghibza Date: Mon, 13 Oct 2025 15:35:02 +0200 Subject: [PATCH 1/2] Pass float values of azimuth and elevation to efap_determine_gains() --- lib_com/options.h | 2 ++ lib_dec/ivas_ism_param_dec.c | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6d394089cd..915a76f116 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,8 @@ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */ +#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV /* FhG: Avoid rounding when passing azimuth and elevation to efap_determine_gains() */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index ba29576848..f21a533c3e 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -709,8 +709,9 @@ void ivas_ism_dec_digest_tc( ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { int16_t i; +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV int16_t azimuth, elevation; - +#endif /* we have a full frame interpolator, adapt it */ /* for BE testing */ if ( ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) == st_ivas->hTcBuffer->n_samples_available ) @@ -754,14 +755,18 @@ void ivas_ism_dec_digest_tc( else { // TODO tmu review when #215 is resolved +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f ); elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f ); - +#endif if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) && st_ivas->hCombinedOrientationData == NULL ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + float elevation = st_ivas->hIsmMetaData[i]->edited_elevation; +#endif if ( st_ivas->hIntSetup.is_planar_setup ) { /* If no elevation support in output format, then rendering should be done with zero elevation */ @@ -770,7 +775,11 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->hEFAPdata != NULL ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_azimuth, elevation, EFAP_MODE_EFAP ); +#else efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); +#endif v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], st_ivas->hEFAPdata->numSpk ); } } @@ -778,6 +787,12 @@ void ivas_ism_dec_digest_tc( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + int16_t azimuth, elevation; + + azimuth = (int16_t) roundf( st_ivas->hIsmMetaData[i]->edited_azimuth ); + elevation = (int16_t) roundf( st_ivas->hIsmMetaData[i]->edited_elevation ); +#endif /*get HOA gets for direction (ACN/SN3D)*/ ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order ); v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], ivas_sba_get_nchan( st_ivas->hIntSetup.ambisonics_order, 0 ) ); -- GitLab From 64ade2da770e54de392f54ce6341a964ba138c01 Mon Sep 17 00:00:00 2001 From: naghibza Date: Thu, 16 Oct 2025 09:41:46 +0200 Subject: [PATCH 2/2] replace roundf with floorf(x + 0.5) --- lib_dec/ivas_ism_param_dec.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index f21a533c3e..253f480c6a 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -754,8 +754,8 @@ void ivas_ism_dec_digest_tc( } else { - // TODO tmu review when #215 is resolved #ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + // TODO tmu review when #215 is resolved azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f ); elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f ); #endif @@ -770,7 +770,11 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->hIntSetup.is_planar_setup ) { /* If no elevation support in output format, then rendering should be done with zero elevation */ +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + elevation = 0.f; +#else elevation = 0; +#endif } if ( st_ivas->hEFAPdata != NULL ) @@ -788,10 +792,11 @@ void ivas_ism_dec_digest_tc( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { #ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + // TODO tmu review when #215 is resolved int16_t azimuth, elevation; - azimuth = (int16_t) roundf( st_ivas->hIsmMetaData[i]->edited_azimuth ); - elevation = (int16_t) roundf( st_ivas->hIsmMetaData[i]->edited_elevation ); + azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f ); + elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f ); #endif /*get HOA gets for direction (ACN/SN3D)*/ ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order ); -- GitLab