From 8a79c66a6245a8b89a95f645d6bb96bc728a84dc Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 5 May 2026 16:49:23 +0200 Subject: [PATCH 01/11] fix --- lib_com/ivas_cnst.h | 5 +++++ lib_com/options.h | 2 +- lib_dec/ivas_ism_metadata_dec.c | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index c02b1833d..44bec9dc0 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -312,6 +312,11 @@ typedef enum #define ADJUST_ISM_BRATE_POS 8000 #define ISM_AZIMUTH_NBITS 7 +#ifdef FIX_2570_BUF_OVFL +#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX 32 /* 90.0f in ism metadata */ +#define ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX 64 /* 0.0f in ism metadata */ +#define ISM_AZIMUTH_MAX_NON_DIEGETIC_FX 96 /* 90.0f in ism metadata */ +#endif #define ISM_AZIMUTH_MIN -180.0f #define ISM_AZIMUTH_MAX 180.0f #define ISM_AZIMUTH_LOW_BORDER -140.0f diff --git a/lib_com/options.h b/lib_com/options.h index c096f383c..aa8c468e6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,6 +165,7 @@ #define FIX_2095_REMOVE_UNUSED_ISAR_TABLES /* Dolby: remove unused ISAR */ #define FIX_FLOAT_1582_STEREO_DFT_QUANTIZE_ITD /* FhG: float issue 1582: Remove unncessary statement from stereo_dft_quantize_itd() */ #define FIX_1585_ASAN_FORMAT_SW_ALT /* VA: float issue 1585: alternative fix memory leaks with format switching */ +#define FIX_2570_BUF_OVFL /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */ /* #################### End BE switches ################################## */ @@ -179,7 +180,6 @@ #define FIX_1559 /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */ #define FIX_FMSW_DEC /* float issue 1542: fix JBM issue in format switching */ #define FIX_FMSW_DEC_2 /* float issue 1575: fix crash for format switching when bitsream starts with EVS */ -#define FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */ #define FIX_FLOAT_1578_OMASA_REND_SPIKES /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 55a3eb351..69d434958 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -871,6 +871,17 @@ static void decode_angle_indices( } else { +#ifdef FIX_2570_BUF_OVFL + /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ + if ( idx_angle1 > ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) + { + idx_angle1 = ISM_AZIMUTH_MIN_NON_DIEGETIC_FX; + } + else if ( idx_angle1 < ISM_AZIMUTH_MIN_NON_DIEGETIC_FX ) + { + idx_angle1 = ISM_AZIMUTH_MIN_NON_DIEGETIC_FX; + } +#endif idx_angle2 = angle->last_angle2_idx; /* second MD parameter is not transmitted for non-diegetic object */ } -- GitLab From 4c39f0ec63560ff4f61d6423fa21a7ddfa948654 Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Tue, 5 May 2026 17:16:17 +0200 Subject: [PATCH 02/11] fix idx_angle1 --- lib_com/ivas_cnst.h | 2 +- lib_dec/ivas_ism_metadata_dec.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 44bec9dc0..3fb59c3d2 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -313,7 +313,7 @@ typedef enum #define ISM_AZIMUTH_NBITS 7 #ifdef FIX_2570_BUF_OVFL -#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX 32 /* 90.0f in ism metadata */ +#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX 32 /* -90.0f in ism metadata */ #define ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX 64 /* 0.0f in ism metadata */ #define ISM_AZIMUTH_MAX_NON_DIEGETIC_FX 96 /* 90.0f in ism metadata */ #endif diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 69d434958..be1c27f98 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -875,11 +875,11 @@ static void decode_angle_indices( /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ if ( idx_angle1 > ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) { - idx_angle1 = ISM_AZIMUTH_MIN_NON_DIEGETIC_FX; + idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX; } else if ( idx_angle1 < ISM_AZIMUTH_MIN_NON_DIEGETIC_FX ) { - idx_angle1 = ISM_AZIMUTH_MIN_NON_DIEGETIC_FX; + idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX; } #endif idx_angle2 = angle->last_angle2_idx; /* second MD parameter is not transmitted for non-diegetic object */ -- GitLab From 3cae6e18ef8fbfb869ea25533db86400f856d16c Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Wed, 6 May 2026 18:05:22 +0200 Subject: [PATCH 03/11] fix man/max values --- lib_com/ivas_cnst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3fb59c3d2..8472235fc 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -313,9 +313,9 @@ typedef enum #define ISM_AZIMUTH_NBITS 7 #ifdef FIX_2570_BUF_OVFL -#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX 32 /* -90.0f in ism metadata */ +#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX 28 /* -90.0f in ism metadata */ #define ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX 64 /* 0.0f in ism metadata */ -#define ISM_AZIMUTH_MAX_NON_DIEGETIC_FX 96 /* 90.0f in ism metadata */ +#define ISM_AZIMUTH_MAX_NON_DIEGETIC_FX 100 /* 90.0f in ism metadata */ #endif #define ISM_AZIMUTH_MIN -180.0f #define ISM_AZIMUTH_MAX 180.0f -- GitLab From be1e7ba4bbd6ae3ff97f1f39b0eed4f2288d059a Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Thu, 7 May 2026 14:21:58 +0200 Subject: [PATCH 04/11] use of wrapped_angle --- lib_com/ivas_cnst.h | 5 --- lib_com/options.h | 1 + lib_dec/ivas_ism_metadata_dec.c | 11 ----- lib_dec/ivas_mono_dmx_renderer.c | 25 ++++++++++- lib_rend/ivas_objectRenderer_sources.c | 19 +++++++++ lib_rend/lib_rend.c | 58 ++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 18 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 8472235fc..c02b1833d 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -312,11 +312,6 @@ typedef enum #define ADJUST_ISM_BRATE_POS 8000 #define ISM_AZIMUTH_NBITS 7 -#ifdef FIX_2570_BUF_OVFL -#define ISM_AZIMUTH_MIN_NON_DIEGETIC_FX 28 /* -90.0f in ism metadata */ -#define ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX 64 /* 0.0f in ism metadata */ -#define ISM_AZIMUTH_MAX_NON_DIEGETIC_FX 100 /* 90.0f in ism metadata */ -#endif #define ISM_AZIMUTH_MIN -180.0f #define ISM_AZIMUTH_MAX 180.0f #define ISM_AZIMUTH_LOW_BORDER -140.0f diff --git a/lib_com/options.h b/lib_com/options.h index aa8c468e6..95712de7d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,6 +180,7 @@ #define FIX_1559 /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */ #define FIX_FMSW_DEC /* float issue 1542: fix JBM issue in format switching */ #define FIX_FMSW_DEC_2 /* float issue 1575: fix crash for format switching when bitsream starts with EVS */ +#define FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW /* Orange: float issue 1548: Harmonize non diegetic panning law in ISM and renderers */ #define FIX_FLOAT_1578_OMASA_REND_SPIKES /* Nokia: Float issue 1578: Fix spikes and collapsed perception in OMASA/MASA rendering to FOA/HOA */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index be1c27f98..55a3eb351 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -871,17 +871,6 @@ static void decode_angle_indices( } else { -#ifdef FIX_2570_BUF_OVFL - /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ - if ( idx_angle1 > ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) - { - idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX; - } - else if ( idx_angle1 < ISM_AZIMUTH_MIN_NON_DIEGETIC_FX ) - { - idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX; - } -#endif idx_angle2 = angle->last_angle2_idx; /* second MD parameter is not transmitted for non-diegetic object */ } diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 73d8ce2e2..6eb30b64f 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -227,9 +227,30 @@ void ivas_apply_non_diegetic_panning( const int16_t output_frame /* i : output frame length per channel */ ) { - float pan_left, pan_right; + float pan_left, pan_right, pan; +#ifdef FIX_2570_BUF_OVFL + float wrapped_angle; // -90 <= wrapped_angle <= 90 +#endif - float pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; +#ifdef FIX_2570_BUF_OVFL + if ( non_diegetic_pan_gain < -90.0 ) + { + wrapped_angle = -180.0 - non_diegetic_pan_gain; + } + else if ( non_diegetic_pan_gain > 90.0 ) + { + wrapped_angle = 180.0 - non_diegetic_pan_gain; + } + else + { + wrapped_angle = non_diegetic_pan_gain; + } + pan = ( wrapped_angle + 1.f ) * 0.5f; +#else + pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; +#endif + + pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_left = sinf( pan * EVS_PI * 0.5f ); pan_right = cosf( pan * EVS_PI * 0.5f ); v_multc( input_f, pan_right, output_f[1], output_frame ); diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 69f120ec9..6e2bfa909 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -318,6 +318,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif +#ifdef FIX_2570_BUF_OVFL + float wrapped_angle; // -90 <= wrapped_angle <= 90 +#endif /* Evaluate the HR filters from the source and listener positions and orientations */ Listener_p = hBinRendererTd->Listener_p; @@ -392,7 +395,23 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( set_f( hrf_left, 0.0f, *filterlength ); set_f( hrf_right, 0.0f, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#ifdef FIX_2570_BUF_OVFL + if ( SrcSpatial_p->Pos_p[1] < -90.0 ) + { + wrapped_angle = -180.0 - SrcSpatial_p->Pos_p[1]; + } + else if ( SrcSpatial_p->Pos_p[1] > 90.0 ) + { + wrapped_angle = 180.0 - SrcSpatial_p->Pos_p[1]; + } + else + { + wrapped_angle = SrcSpatial_p->Pos_p[1]; + } + pan = ( wrapped_angle + 1.f ) * 0.5f; +#else pan = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; +#endif hrf_left[0] = sinf( pan * EVS_PI * 0.5f ); hrf_right[0] = cosf( pan * EVS_PI * 0.5f ); #else diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2203e2628..1e11482e8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2214,6 +2214,9 @@ static ivas_error updateMcPanGainsForMcOut( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif +#ifdef FIX_2570_BUF_OVFL + float wrapped_angle; // -90 <= wrapped_angle <= 90 +#endif /* "if" conditions below realize the following mapping: @@ -2238,7 +2241,23 @@ static ivas_error updateMcPanGainsForMcOut( if ( ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) ) { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#ifdef FIX_2570_BUF_OVFL + if ( inputMc->nonDiegeticPanGain < -90.0 ) + { + wrapped_angle = -180.0 - inputMc->nonDiegeticPanGain; + } + else if ( inputMc->nonDiegeticPanGain > 90.0 ) + { + wrapped_angle = 180.0 - inputMc->nonDiegeticPanGain; + } + else + { + wrapped_angle = inputMc->nonDiegeticPanGain; + } + pan = ( wrapped_angle + 1.f ) * 0.5f; +#else pan = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f; +#endif inputMc->panGains[0][0] = sinf( pan * EVS_PI * 0.5f ); inputMc->panGains[0][1] = cosf( pan * EVS_PI * 0.5f ); #else @@ -2378,12 +2397,31 @@ static ivas_error updateMcPanGainsForBinauralOut( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif +#ifdef FIX_2570_BUF_OVFL + float wrapped_angle; // -90 <= wrapped_angle <= 90 +#endif setZeroPanMatrix( inputMc->panGains ); if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#ifdef FIX_2570_BUF_OVFL + if ( inputMc->nonDiegeticPanGain < -90.0 ) + { + wrapped_angle = -180.0 - inputMc->nonDiegeticPanGain; + } + else if ( inputMc->nonDiegeticPanGain > 90.0 ) + { + wrapped_angle = 180.0 - inputMc->nonDiegeticPanGain; + } + else + { + wrapped_angle = inputMc->nonDiegeticPanGain; + } + pan = ( wrapped_angle + 1.f ) * 0.5f; +#else pan = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f; +#endif inputMc->panGains[0][0] = sinf( pan * EVS_PI * 0.5f ); inputMc->panGains[0][1] = cosf( pan * EVS_PI * 0.5f ); #else @@ -6011,6 +6049,10 @@ static ivas_error renderIsmToMc( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif +#ifdef FIX_2570_BUF_OVFL + float wrapped_angle; // -90 <= wrapped_angle <= 90 +#endif + push_wmops( "renderIsmToMc" ); @@ -6020,7 +6062,23 @@ static ivas_error renderIsmToMc( if ( ismInput->nonDiegeticPan ) { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#ifdef FIX_2570_BUF_OVFL + if ( ismInput->nonDiegeticPanGain < -90.0 ) + { + wrapped_angle = -180.0 - ismInput->nonDiegeticPanGain; + } + else if ( ismInput->nonDiegeticPanGain > 90.0 ) + { + wrapped_angle = 180.0 - ismInput->nonDiegeticPanGain; + } + else + { + wrapped_angle = ismInput->nonDiegeticPanGain; + } + pan = ( wrapped_angle + 1.f ) * 0.5f; +#else pan = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; +#endif ismInput->prev_pan_gains[0] = currentPanGains[0] = sinf( pan * EVS_PI * 0.5f ); ismInput->prev_pan_gains[1] = currentPanGains[1] = cosf( pan * EVS_PI * 0.5f ); #else -- GitLab From 63345c9c710dba511ea783d5f8f6295684e00a10 Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Thu, 7 May 2026 14:35:06 +0200 Subject: [PATCH 05/11] float format --- lib_dec/ivas_mono_dmx_renderer.c | 8 ++++---- lib_rend/ivas_objectRenderer_sources.c | 8 ++++---- lib_rend/lib_rend.c | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 6eb30b64f..6414bd4d5 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -233,13 +233,13 @@ void ivas_apply_non_diegetic_panning( #endif #ifdef FIX_2570_BUF_OVFL - if ( non_diegetic_pan_gain < -90.0 ) + if ( non_diegetic_pan_gain < -90.f ) { - wrapped_angle = -180.0 - non_diegetic_pan_gain; + wrapped_angle = -180.f - non_diegetic_pan_gain; } - else if ( non_diegetic_pan_gain > 90.0 ) + else if ( non_diegetic_pan_gain > 90.f ) { - wrapped_angle = 180.0 - non_diegetic_pan_gain; + wrapped_angle = 180.f - non_diegetic_pan_gain; } else { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 6e2bfa909..0f0ffafff 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -396,13 +396,13 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( set_f( hrf_right, 0.0f, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( SrcSpatial_p->Pos_p[1] < -90.0 ) + if ( SrcSpatial_p->Pos_p[1] < -90.f ) { - wrapped_angle = -180.0 - SrcSpatial_p->Pos_p[1]; + wrapped_angle = -180.f - SrcSpatial_p->Pos_p[1]; } - else if ( SrcSpatial_p->Pos_p[1] > 90.0 ) + else if ( SrcSpatial_p->Pos_p[1] > 90.f ) { - wrapped_angle = 180.0 - SrcSpatial_p->Pos_p[1]; + wrapped_angle = 180.f - SrcSpatial_p->Pos_p[1]; } else { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1e11482e8..29bd1259a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2242,13 +2242,13 @@ static ivas_error updateMcPanGainsForMcOut( { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( inputMc->nonDiegeticPanGain < -90.0 ) + if ( inputMc->nonDiegeticPanGain < -90.f ) { - wrapped_angle = -180.0 - inputMc->nonDiegeticPanGain; + wrapped_angle = -180.f - inputMc->nonDiegeticPanGain; } - else if ( inputMc->nonDiegeticPanGain > 90.0 ) + else if ( inputMc->nonDiegeticPanGain > 90.f ) { - wrapped_angle = 180.0 - inputMc->nonDiegeticPanGain; + wrapped_angle = 180.f - inputMc->nonDiegeticPanGain; } else { @@ -2406,13 +2406,13 @@ static ivas_error updateMcPanGainsForBinauralOut( { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( inputMc->nonDiegeticPanGain < -90.0 ) + if ( inputMc->nonDiegeticPanGain < -90.f ) { - wrapped_angle = -180.0 - inputMc->nonDiegeticPanGain; + wrapped_angle = -180.f - inputMc->nonDiegeticPanGain; } - else if ( inputMc->nonDiegeticPanGain > 90.0 ) + else if ( inputMc->nonDiegeticPanGain > 90.f ) { - wrapped_angle = 180.0 - inputMc->nonDiegeticPanGain; + wrapped_angle = 180.f - inputMc->nonDiegeticPanGain; } else { @@ -6063,13 +6063,13 @@ static ivas_error renderIsmToMc( { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( ismInput->nonDiegeticPanGain < -90.0 ) + if ( ismInput->nonDiegeticPanGain < -90.f ) { - wrapped_angle = -180.0 - ismInput->nonDiegeticPanGain; + wrapped_angle = -180.f - ismInput->nonDiegeticPanGain; } - else if ( ismInput->nonDiegeticPanGain > 90.0 ) + else if ( ismInput->nonDiegeticPanGain > 90.f ) { - wrapped_angle = 180.0 - ismInput->nonDiegeticPanGain; + wrapped_angle = 180.f - ismInput->nonDiegeticPanGain; } else { -- GitLab From 042adcda1ca495dec6af5117c84095522f52b2a8 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 14:51:09 +0200 Subject: [PATCH 06/11] fix angles values --- lib_dec/ivas_mono_dmx_renderer.c | 8 ++++---- lib_rend/ivas_objectRenderer_sources.c | 8 ++++---- lib_rend/lib_rend.c | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 6414bd4d5..a4ed9a3fc 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -233,13 +233,13 @@ void ivas_apply_non_diegetic_panning( #endif #ifdef FIX_2570_BUF_OVFL - if ( non_diegetic_pan_gain < -90.f ) + if ( non_diegetic_pan_gain < -1.f ) { - wrapped_angle = -180.f - non_diegetic_pan_gain; + wrapped_angle = -2.f - non_diegetic_pan_gain; } - else if ( non_diegetic_pan_gain > 90.f ) + else if ( non_diegetic_pan_gain > 1.f ) { - wrapped_angle = 180.f - non_diegetic_pan_gain; + wrapped_angle = 2.f - non_diegetic_pan_gain; } else { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 0f0ffafff..07e251a59 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -396,13 +396,13 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( set_f( hrf_right, 0.0f, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( SrcSpatial_p->Pos_p[1] < -90.f ) + if ( SrcSpatial_p->Pos_p[1] < -1.f ) { - wrapped_angle = -180.f - SrcSpatial_p->Pos_p[1]; + wrapped_angle = -2.f - SrcSpatial_p->Pos_p[1]; } - else if ( SrcSpatial_p->Pos_p[1] > 90.f ) + else if ( SrcSpatial_p->Pos_p[1] > 1.f ) { - wrapped_angle = 180.f - SrcSpatial_p->Pos_p[1]; + wrapped_angle = 2.f - SrcSpatial_p->Pos_p[1]; } else { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 29bd1259a..3282ae2ab 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2242,13 +2242,13 @@ static ivas_error updateMcPanGainsForMcOut( { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( inputMc->nonDiegeticPanGain < -90.f ) + if ( inputMc->nonDiegeticPanGain < -1.f ) { - wrapped_angle = -180.f - inputMc->nonDiegeticPanGain; + wrapped_angle = -2.f - inputMc->nonDiegeticPanGain; } - else if ( inputMc->nonDiegeticPanGain > 90.f ) + else if ( inputMc->nonDiegeticPanGain > 1.f ) { - wrapped_angle = 180.f - inputMc->nonDiegeticPanGain; + wrapped_angle = 2.f - inputMc->nonDiegeticPanGain; } else { @@ -2406,13 +2406,13 @@ static ivas_error updateMcPanGainsForBinauralOut( { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( inputMc->nonDiegeticPanGain < -90.f ) + if ( inputMc->nonDiegeticPanGain < -1.f ) { - wrapped_angle = -180.f - inputMc->nonDiegeticPanGain; + wrapped_angle = -2.f - inputMc->nonDiegeticPanGain; } - else if ( inputMc->nonDiegeticPanGain > 90.f ) + else if ( inputMc->nonDiegeticPanGain > 1.f ) { - wrapped_angle = 180.f - inputMc->nonDiegeticPanGain; + wrapped_angle = 2.f - inputMc->nonDiegeticPanGain; } else { @@ -6063,13 +6063,13 @@ static ivas_error renderIsmToMc( { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_2570_BUF_OVFL - if ( ismInput->nonDiegeticPanGain < -90.f ) + if ( ismInput->nonDiegeticPanGain < -1.f ) { - wrapped_angle = -180.f - ismInput->nonDiegeticPanGain; + wrapped_angle = -2.f - ismInput->nonDiegeticPanGain; } - else if ( ismInput->nonDiegeticPanGain > 90.f ) + else if ( ismInput->nonDiegeticPanGain > 1.f ) { - wrapped_angle = 180.f - ismInput->nonDiegeticPanGain; + wrapped_angle = 2.f - ismInput->nonDiegeticPanGain; } else { -- GitLab From 3e230f05c40a158a103720c780a529b851585e89 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 15:52:29 +0200 Subject: [PATCH 07/11] trigger ci -- GitLab From e7d435e9d12454573c063d291ccd5ad6298e37e4 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 16:18:10 +0200 Subject: [PATCH 08/11] align float and basop code --- lib_rend/lib_rend.c | 48 --------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 3282ae2ab..1acbb6b39 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2241,23 +2241,7 @@ static ivas_error updateMcPanGainsForMcOut( if ( ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) ) { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW -#ifdef FIX_2570_BUF_OVFL - if ( inputMc->nonDiegeticPanGain < -1.f ) - { - wrapped_angle = -2.f - inputMc->nonDiegeticPanGain; - } - else if ( inputMc->nonDiegeticPanGain > 1.f ) - { - wrapped_angle = 2.f - inputMc->nonDiegeticPanGain; - } - else - { - wrapped_angle = inputMc->nonDiegeticPanGain; - } - pan = ( wrapped_angle + 1.f ) * 0.5f; -#else pan = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f; -#endif inputMc->panGains[0][0] = sinf( pan * EVS_PI * 0.5f ); inputMc->panGains[0][1] = cosf( pan * EVS_PI * 0.5f ); #else @@ -2405,23 +2389,7 @@ static ivas_error updateMcPanGainsForBinauralOut( if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW -#ifdef FIX_2570_BUF_OVFL - if ( inputMc->nonDiegeticPanGain < -1.f ) - { - wrapped_angle = -2.f - inputMc->nonDiegeticPanGain; - } - else if ( inputMc->nonDiegeticPanGain > 1.f ) - { - wrapped_angle = 2.f - inputMc->nonDiegeticPanGain; - } - else - { - wrapped_angle = inputMc->nonDiegeticPanGain; - } - pan = ( wrapped_angle + 1.f ) * 0.5f; -#else pan = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f; -#endif inputMc->panGains[0][0] = sinf( pan * EVS_PI * 0.5f ); inputMc->panGains[0][1] = cosf( pan * EVS_PI * 0.5f ); #else @@ -6062,23 +6030,7 @@ static ivas_error renderIsmToMc( if ( ismInput->nonDiegeticPan ) { #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW -#ifdef FIX_2570_BUF_OVFL - if ( ismInput->nonDiegeticPanGain < -1.f ) - { - wrapped_angle = -2.f - ismInput->nonDiegeticPanGain; - } - else if ( ismInput->nonDiegeticPanGain > 1.f ) - { - wrapped_angle = 2.f - ismInput->nonDiegeticPanGain; - } - else - { - wrapped_angle = ismInput->nonDiegeticPanGain; - } - pan = ( wrapped_angle + 1.f ) * 0.5f; -#else pan = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; -#endif ismInput->prev_pan_gains[0] = currentPanGains[0] = sinf( pan * EVS_PI * 0.5f ); ismInput->prev_pan_gains[1] = currentPanGains[1] = cosf( pan * EVS_PI * 0.5f ); #else -- GitLab From dcce4a880e42ba39a396e5901735178c2251b311 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 16:26:27 +0200 Subject: [PATCH 09/11] fix warning --- lib_rend/lib_rend.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1acbb6b39..8bf025824 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2214,9 +2214,6 @@ static ivas_error updateMcPanGainsForMcOut( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif -#ifdef FIX_2570_BUF_OVFL - float wrapped_angle; // -90 <= wrapped_angle <= 90 -#endif /* "if" conditions below realize the following mapping: @@ -2381,9 +2378,6 @@ static ivas_error updateMcPanGainsForBinauralOut( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif -#ifdef FIX_2570_BUF_OVFL - float wrapped_angle; // -90 <= wrapped_angle <= 90 -#endif setZeroPanMatrix( inputMc->panGains ); if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) @@ -6017,9 +6011,6 @@ static ivas_error renderIsmToMc( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif -#ifdef FIX_2570_BUF_OVFL - float wrapped_angle; // -90 <= wrapped_angle <= 90 -#endif push_wmops( "renderIsmToMc" ); -- GitLab From 97093184c445c8cac87590f51ac29d468b9645f9 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 16:35:52 +0200 Subject: [PATCH 10/11] align code between fix and float --- lib_dec/ivas_mono_dmx_renderer.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index a4ed9a3fc..cfcb38100 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -232,24 +232,6 @@ void ivas_apply_non_diegetic_panning( float wrapped_angle; // -90 <= wrapped_angle <= 90 #endif -#ifdef FIX_2570_BUF_OVFL - if ( non_diegetic_pan_gain < -1.f ) - { - wrapped_angle = -2.f - non_diegetic_pan_gain; - } - else if ( non_diegetic_pan_gain > 1.f ) - { - wrapped_angle = 2.f - non_diegetic_pan_gain; - } - else - { - wrapped_angle = non_diegetic_pan_gain; - } - pan = ( wrapped_angle + 1.f ) * 0.5f; -#else - pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; -#endif - pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_left = sinf( pan * EVS_PI * 0.5f ); pan_right = cosf( pan * EVS_PI * 0.5f ); -- GitLab From c7cb75dda0fa42485d5f1ba2696516bcf30b27be Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 17:08:08 +0200 Subject: [PATCH 11/11] fix build warning --- lib_dec/ivas_mono_dmx_renderer.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index cfcb38100..61b6af983 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -228,10 +228,6 @@ void ivas_apply_non_diegetic_panning( ) { float pan_left, pan_right, pan; -#ifdef FIX_2570_BUF_OVFL - float wrapped_angle; // -90 <= wrapped_angle <= 90 -#endif - pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_left = sinf( pan * EVS_PI * 0.5f ); pan_right = cosf( pan * EVS_PI * 0.5f ); -- GitLab