From 3536cac9d588164406b709ae93f1184b05ac5dc2 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 5 May 2026 16:23:54 +0200 Subject: [PATCH 1/9] fix --- lib_com/ivas_cnst.h | 5 +++++ lib_dec/ivas_ism_metadata_dec_fx.c | 11 +++++++++++ lib_rend/ivas_objectRenderer_sources_fx.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 9c6c82507..a87a7767d 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -337,6 +337,11 @@ typedef enum #define ADJUST_ISM_BRATE_POS 8000 #define ISM_AZIMUTH_NBITS 7 +#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#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_FX -754974720 /* -180.0f in Q22 */ #define ISM_AZIMUTH_MAX_FX 754974720 /* 180.0f in Q22 */ #define ISM_AZIMUTH_LOW_BORDER_FX -587202560 /* -140.0f in Q22 */ diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 4e9fe4154..47617a8ac 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -1034,6 +1034,17 @@ static void decode_angle_indices_fx( } ELSE { +#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW + /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ + IF( GT_16( idx_angle1, ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) ) + { + idx_angle1 = ISM_AZIMUTH_MIN_NON_DIEGETIC_FX; + } + ELSE IF( LE_16( 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 */ move16(); } diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index 611c0c45e..b9e195961 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -488,7 +488,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( set32_fx( hrf_right, 0, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION - pan = add( extract_h( L_shl( SrcSpatial_p->Pos_p_fx[1], sub( Q21, SrcSpatial_p->q_Pos_p ) ) ), 32 ); + pan = add( extract_h( L_shr( SrcSpatial_p->Pos_p_fx[1], sub( SrcSpatial_p->q_Pos_p , Q21) ) ), 32 ); #else pan = add( mult_r( extract_h( SrcSpatial_p->Pos_p_fx[1] ), 2048 ), 32 ); #endif -- GitLab From 61fac1200ed8cdae2e5463c7baed905120303ba2 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Tue, 5 May 2026 16:50:04 +0200 Subject: [PATCH 2/9] change switch name --- lib_com/ivas_cnst.h | 2 +- lib_com/options.h | 1 + lib_dec/ivas_ism_metadata_dec_fx.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index a87a7767d..bb950ead6 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -337,7 +337,7 @@ typedef enum #define ADJUST_ISM_BRATE_POS 8000 #define ISM_AZIMUTH_NBITS 7 -#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#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 */ diff --git a/lib_com/options.h b/lib_com/options.h index 5390fd919..57fcab133 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -106,6 +106,7 @@ #define HARMONIZE_2539_cng_energy /* FhG: basop issue 2539: harmonize cng_energy with its ivas derivate */ #define FIX_1585_ASAN_FORMAT_SW_ALT /* VA: float issue 1585: alternative fix memory leaks with format switching */ #define FIX_BASOP_2573_RF_MODE_UPDATE /* FhG: BASOP issue 2573: remove duplicated update of rf_mode parameters from evs_enc_fx(); was already done in updt_enc_common_fx() */ +#define FIX_2570_BUF_OVFL /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 47617a8ac..3f22ec8ca 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -1034,7 +1034,7 @@ static void decode_angle_indices_fx( } ELSE { -#ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#ifdef FIX_2570_BUF_OVFL /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ IF( GT_16( idx_angle1, ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) ) { -- GitLab From dd549c949cb1a863b39afbb3f9ae4088146c9a4a Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Tue, 5 May 2026 17:14:30 +0200 Subject: [PATCH 3/9] fix idx_angle1 --- lib_com/ivas_cnst.h | 2 +- lib_dec/ivas_ism_metadata_dec_fx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index bb950ead6..3282c82a3 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -338,7 +338,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_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 3f22ec8ca..f80718947 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -1038,11 +1038,11 @@ static void decode_angle_indices_fx( /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ IF( GT_16( 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( LE_16( 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 c5e5b6627b9062e6559789445dbe8fe70527d565 Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Wed, 6 May 2026 15:34:51 +0200 Subject: [PATCH 4/9] minor: format --- lib_dec/ivas_ism_metadata_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index f80718947..be776a0cb 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -1034,7 +1034,7 @@ static void decode_angle_indices_fx( } ELSE { -#ifdef FIX_2570_BUF_OVFL +#ifdef FIX_2570_BUF_OVFL /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ IF( GT_16( idx_angle1, ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) ) { -- GitLab From 79e2bfa3d28e063d1fcf3d8b2b7038c5d88e239f Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Wed, 6 May 2026 15:45:07 +0200 Subject: [PATCH 5/9] minor: format again --- lib_rend/ivas_objectRenderer_sources_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index b9e195961..7ac988efa 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -488,7 +488,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( set32_fx( hrf_right, 0, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION - pan = add( extract_h( L_shr( SrcSpatial_p->Pos_p_fx[1], sub( SrcSpatial_p->q_Pos_p , Q21) ) ), 32 ); + pan = add( extract_h( L_shr( SrcSpatial_p->Pos_p_fx[1], sub( SrcSpatial_p->q_Pos_p, Q21 ) ) ), 32 ); #else pan = add( mult_r( extract_h( SrcSpatial_p->Pos_p_fx[1] ), 2048 ), 32 ); #endif -- GitLab From 5ac174b8c33bf7b9dc8b1623e828f25c7e68a5e3 Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Wed, 6 May 2026 16:16:48 +0200 Subject: [PATCH 6/9] Trigger CI -- GitLab From 56ce53466e1b80b8a363d5befcfca955f417f3bd Mon Sep 17 00:00:00 2001 From: Gregory Pallone Date: Wed, 6 May 2026 18:08:37 +0200 Subject: [PATCH 7/9] fix min/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 3282c82a3..ac31aef4c 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -338,9 +338,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_FX -754974720 /* -180.0f in Q22 */ #define ISM_AZIMUTH_MAX_FX 754974720 /* 180.0f in Q22 */ -- GitLab From 07b20e45c75e303acb747b70f1ceba4fa74b1d01 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 15:59:45 +0200 Subject: [PATCH 8/9] change panning law --- lib_com/ivas_cnst.h | 5 ----- lib_dec/ivas_ism_metadata_dec_fx.c | 11 ----------- lib_dec/ivas_mono_dmx_renderer_fx.c | 19 +++++++++++++++++++ lib_rend/ivas_objectRenderer_sources_fx.c | 20 ++++++++++++++++++++ 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index ac31aef4c..9c6c82507 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -337,11 +337,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_FX -754974720 /* -180.0f in Q22 */ #define ISM_AZIMUTH_MAX_FX 754974720 /* 180.0f in Q22 */ #define ISM_AZIMUTH_LOW_BORDER_FX -587202560 /* -140.0f in Q22 */ diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index be776a0cb..4e9fe4154 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -1034,17 +1034,6 @@ static void decode_angle_indices_fx( } ELSE { -#ifdef FIX_2570_BUF_OVFL - /* azimuth/yaw is on a circle - check for diff coding for -90 -> 90 and vice versa changes */ - IF( GT_16( idx_angle1, ISM_AZIMUTH_MAX_NON_DIEGETIC_FX ) ) - { - idx_angle1 = ISM_AZIMUTH_ZERO_NON_DIEGETIC_FX; - } - ELSE IF( LE_16( 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 */ move16(); } diff --git a/lib_dec/ivas_mono_dmx_renderer_fx.c b/lib_dec/ivas_mono_dmx_renderer_fx.c index dfdfd057f..bb695d729 100644 --- a/lib_dec/ivas_mono_dmx_renderer_fx.c +++ b/lib_dec/ivas_mono_dmx_renderer_fx.c @@ -320,7 +320,26 @@ void ivas_apply_non_diegetic_panning_fx( const Word16 output_frame /* i : output frame length per channel */ ) { +#ifdef FIX_2570_BUF_OVFL + Word16 pan; + Word32 wrapped_angle; + IF( LT_32( L_add( ONE_IN_Q25, non_diegetic_pan_gain_fx ), 0 ) ) + { + wrapped_angle = L_negate( L_add( ONE_IN_Q26, non_diegetic_pan_gain_fx ) ); + } + ELSE IF( GT_32( L_sub( non_diegetic_pan_gain_fx, ONE_IN_Q25 ), 0 ) ) + { + wrapped_angle = L_sub( ONE_IN_Q26, non_diegetic_pan_gain_fx ); + } + ELSE + { + wrapped_angle = non_diegetic_pan_gain_fx; + move32(); + } + pan = add( extract_h( L_shr( wrapped_angle, sub( non_diegetic_pan_gain_fx, Q21 ) ) ), 32 ); +#else Word16 pan = add( mult_r( non_diegetic_pan_gain_fx, 32 ), 32 ); // 0.5.Q15 = 16384 // Q15 +#endif v_multc_fx_16( input_f_fx, cos_table_129[pan], output_fx[1], output_frame ); v_multc_fx_16( input_f_fx, cos_table_129[64 - pan], output_fx[0], output_frame ); diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index 7ac988efa..e18fd7291 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -332,6 +332,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW Word16 pan; #endif +#ifdef FIX_2570_BUF_OVFL + Word32 wrapped_angle; +#endif #ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION Word16 pos_q; Word32 Src_p_tmp[3]; @@ -488,7 +491,24 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( set32_fx( hrf_right, 0, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW #ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION +#ifdef FIX_2570_BUF_OVFL + IF( LT_32( L_add( ONE_IN_Q25, SrcSpatial_p->Pos_p_fx[1] ), 0 ) ) + { + wrapped_angle = L_negate( L_add( ONE_IN_Q26, SrcSpatial_p->Pos_p_fx[1] ) ); + } + ELSE IF( GT_32( L_sub( SrcSpatial_p->Pos_p_fx[1], ONE_IN_Q25 ), 0 ) ) + { + wrapped_angle = L_sub( ONE_IN_Q26, SrcSpatial_p->Pos_p_fx[1] ); + } + ELSE + { + wrapped_angle = SrcSpatial_p->Pos_p_fx[1]; + move32(); + } + pan = add( extract_h( L_shr( wrapped_angle, sub( SrcSpatial_p->q_Pos_p, Q21 ) ) ), 32 ); +#else pan = add( extract_h( L_shr( SrcSpatial_p->Pos_p_fx[1], sub( SrcSpatial_p->q_Pos_p, Q21 ) ) ), 32 ); +#endif #else pan = add( mult_r( extract_h( SrcSpatial_p->Pos_p_fx[1] ), 2048 ), 32 ); #endif -- GitLab From 8ed1186641529e20c9c6d0a17d87df2647bf0c57 Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 7 May 2026 16:34:42 +0200 Subject: [PATCH 9/9] fix bug anf simplify code --- lib_dec/ivas_mono_dmx_renderer_fx.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib_dec/ivas_mono_dmx_renderer_fx.c b/lib_dec/ivas_mono_dmx_renderer_fx.c index bb695d729..dfdfd057f 100644 --- a/lib_dec/ivas_mono_dmx_renderer_fx.c +++ b/lib_dec/ivas_mono_dmx_renderer_fx.c @@ -320,26 +320,7 @@ void ivas_apply_non_diegetic_panning_fx( const Word16 output_frame /* i : output frame length per channel */ ) { -#ifdef FIX_2570_BUF_OVFL - Word16 pan; - Word32 wrapped_angle; - IF( LT_32( L_add( ONE_IN_Q25, non_diegetic_pan_gain_fx ), 0 ) ) - { - wrapped_angle = L_negate( L_add( ONE_IN_Q26, non_diegetic_pan_gain_fx ) ); - } - ELSE IF( GT_32( L_sub( non_diegetic_pan_gain_fx, ONE_IN_Q25 ), 0 ) ) - { - wrapped_angle = L_sub( ONE_IN_Q26, non_diegetic_pan_gain_fx ); - } - ELSE - { - wrapped_angle = non_diegetic_pan_gain_fx; - move32(); - } - pan = add( extract_h( L_shr( wrapped_angle, sub( non_diegetic_pan_gain_fx, Q21 ) ) ), 32 ); -#else Word16 pan = add( mult_r( non_diegetic_pan_gain_fx, 32 ), 32 ); // 0.5.Q15 = 16384 // Q15 -#endif v_multc_fx_16( input_f_fx, cos_table_129[pan], output_fx[1], output_frame ); v_multc_fx_16( input_f_fx, cos_table_129[64 - pan], output_fx[0], output_frame ); -- GitLab