From 1a9156a94344370a8ce8f16d2ac85b8b5fe60619 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 3 Nov 2025 17:42:42 +0100 Subject: [PATCH 1/2] port MR 2288 from float - BASOP version Avoid rounding when passing angular information to efap_determine_gains() --- lib_com/options.h | 1 + lib_dec/ivas_ism_param_dec_fx.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index c967fd233..a31745014 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -126,6 +126,7 @@ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ #define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ +#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV /* FhG: Avoid rounding when passing azimuth and elevation to efap_determine_gains() */ // object-editing feature porting #define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 1c94fbe39..a951a6bad 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -942,7 +942,9 @@ void ivas_ism_dec_digest_tc_fx( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { Word16 i; +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV Word32 azimuth_fx, elevation_fx; +#endif /* we have a full frame interpolator, adapt it */ /* for BE testing */ @@ -1011,9 +1013,11 @@ void ivas_ism_dec_digest_tc_fx( } ELSE { +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV // TODO tmu review when #215 is resolved azimuth_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 elevation_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 +#endif test(); test(); @@ -1029,6 +1033,9 @@ void ivas_ism_dec_digest_tc_fx( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) && EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) ) && st_ivas->hCombinedOrientationData == NULL ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + Word32 elevation_fx = st_ivas->hIsmMetaData[i]->edited_elevation_fx; +#endif if ( st_ivas->hIntSetup.is_planar_setup ) { /* If no elevation support in output format, then rendering should be done with zero elevation */ @@ -1038,10 +1045,16 @@ void ivas_ism_dec_digest_tc_fx( IF( st_ivas->hEFAPdata != NULL ) { - azimuth_fx = L_shl( azimuth_fx, Q22 ); // Q22 +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + azimuth_fx = L_shl( azimuth_fx, Q22 ); // Q22 +#endif elevation_fx = L_shl( elevation_fx, Q22 ); // Q22 +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_azimuth_fx, elevation_fx, EFAP_MODE_EFAP ); +#else efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azimuth_fx, elevation_fx, EFAP_MODE_EFAP ); +#endif // TODO: align Q values properly IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { -- GitLab From 0560efb63b3f2098e58fe38978834a5f65606dee Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Tue, 4 Nov 2025 22:49:44 +0100 Subject: [PATCH 2/2] remove scaling also fro elevation_fx --- lib_dec/ivas_ism_param_dec_fx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index a951a6bad..5e46a9af5 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1046,9 +1046,10 @@ void ivas_ism_dec_digest_tc_fx( IF( st_ivas->hEFAPdata != NULL ) { #ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV - azimuth_fx = L_shl( azimuth_fx, Q22 ); // Q22 -#endif + azimuth_fx = L_shl( azimuth_fx, Q22 ); // Q22 elevation_fx = L_shl( elevation_fx, Q22 ); // Q22 +#endif + #ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_azimuth_fx, elevation_fx, EFAP_MODE_EFAP ); -- GitLab