From 8ad1f621ec9c6bd9eb83ca22ef1680f3dcf9b5a0 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 1 Jun 2026 17:38:43 +0200 Subject: [PATCH 1/2] issue 2616: Creating the switch and changing conditions to exclude the boundary value. --- lib_com/options.h | 1 + lib_dec/ivas_stereo_dft_dec_fx.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a1b758cfc..c6d647068 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -96,6 +96,7 @@ #define HARMONIZE_2598_tcx_arith_decode_envelope /* FhG: harmonize tcx_arith_decode_envelope between EVS and IVAS versions */ #define HARMONIZE_2598_tcx_arith_encode_envelope /* FhG: harmonize tcx_arith_encode_envelope between EVS and IVAS versions */ #define FIX_ISSUE_2594_FALSE_COMMENT /* FhG: basop issue 2594: fixing false comments about Q value*/ +#define FIX_ISSUE_2616_BOUNDARY_CONDITION /* FhG: basopo issue 2616: Inconsistent boundary conditions in function stereo_dft_dequantize_res_gains*/ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 59307c38d..0a9f0ba3a 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -445,7 +445,11 @@ static void stereo_dft_dequantize_res_gains_fx( move16(); ind2[i] = check_bounds_s_fx( ind2[i], 0, 7 ); /* Q0 */ move16(); - IF( LE_16( ind1[i], 15 ) ) +#ifndef FIX_ISSUE_2616_BOUNDARY_CONDITION + IF(LE_16(ind1[i], 15)) +#else + IF(LT_16(ind1[i], 15)) +#endif // !FIX_ISSUE_2616_BOUNDARY_CONDITION { tmp = sub( 15, ind1[i] ); } @@ -456,7 +460,11 @@ static void stereo_dft_dequantize_res_gains_fx( // index = add( shl( LE_16( ind1[i], 15 ) ? sub( 15, ind1[i] ) : sub( ind1[i], 15 ), 3 ), ind2[i] ); index = add( shl( tmp, 3 ), ind2[i] ); // gout[i] = LE_16( ind1[i], 15 ) ? L_negate( dft_res_gains_q_fx[index][0] ) : dft_res_gains_q_fx[index][0]; - IF( LE_16( ind1[i], 15 ) ) +#ifndef FIX_ISSUE_2616_BOUNDARY_CONDITION + IF(LE_16(ind1[i], 15)) +#else + IF(LT_16(ind1[i], 15)) +#endif // !FIX_ISSUE_2616_BOUNDARY_CONDITION { gout[i] = L_negate( dft_res_gains_q_fx[index][0] ); /* Q31 */ move16(); -- GitLab From 532dcc772cf2b9ecfaa0ddf7a2678a669f8804f7 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Mon, 1 Jun 2026 18:04:56 +0200 Subject: [PATCH 2/2] issue 2616: Clang formatting patch --- lib_dec/ivas_stereo_dft_dec_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 0a9f0ba3a..cd6c74e13 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -446,9 +446,9 @@ static void stereo_dft_dequantize_res_gains_fx( ind2[i] = check_bounds_s_fx( ind2[i], 0, 7 ); /* Q0 */ move16(); #ifndef FIX_ISSUE_2616_BOUNDARY_CONDITION - IF(LE_16(ind1[i], 15)) + IF( LE_16( ind1[i], 15 ) ) #else - IF(LT_16(ind1[i], 15)) + IF( LT_16( ind1[i], 15 ) ) #endif // !FIX_ISSUE_2616_BOUNDARY_CONDITION { tmp = sub( 15, ind1[i] ); @@ -461,9 +461,9 @@ static void stereo_dft_dequantize_res_gains_fx( index = add( shl( tmp, 3 ), ind2[i] ); // gout[i] = LE_16( ind1[i], 15 ) ? L_negate( dft_res_gains_q_fx[index][0] ) : dft_res_gains_q_fx[index][0]; #ifndef FIX_ISSUE_2616_BOUNDARY_CONDITION - IF(LE_16(ind1[i], 15)) + IF( LE_16( ind1[i], 15 ) ) #else - IF(LT_16(ind1[i], 15)) + IF( LT_16( ind1[i], 15 ) ) #endif // !FIX_ISSUE_2616_BOUNDARY_CONDITION { gout[i] = L_negate( dft_res_gains_q_fx[index][0] ); /* Q31 */ -- GitLab