From d53daaae61b740ecb19cd210e0369a9bb71a301f Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Tue, 9 Jun 2026 17:05:03 +0200 Subject: [PATCH 1/4] issue 2622: Creating switch and some lines for debugging. still not complete. --- lib_com/options.h | 1 + lib_enc/ivas_stereo_dft_enc_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index aebd87cb0..797035f80 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -99,6 +99,7 @@ #define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */ #define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI /* Nokia: BASOP issue 2442: Increase accuracy of computations and add additional gain clamp for low energy decorrelated signal rendering. */ #define FIX_FMSW_DEC_EXT /* float issue 1566: fix EXT output in format switching */ +#define DEBUG_ISSUE_2622_MISS_SUM /* FhG: debugging issue 2622: Missing sum in function stereo_dft_enc_update()*/ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 8d999b3e2..d295b28d9 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -889,6 +889,10 @@ void stereo_dft_enc_update_fx( Word16 exp; tmp = BASOP_Util_Divide3232_Scale_newton( tmp, hStereoDft->NFFT, &exp ); hStereoDft->res_cod_line_max = extract_l( L_shr( tmp, sub( 31, exp ) ) ); +#ifdef DEBUG_ISSUE_2622_MISS_SUM + Word32 tmp2 = add(tmp >> (31-exp)) + +#endif // DEBUG_ISSUE_2622_MISS_SUM move16(); // hStereoDft->res_cod_line_max = 8 * (hStereoDft->res_cod_line_max / 8); hStereoDft->res_cod_line_max = shl( shr( hStereoDft->res_cod_line_max, 3 ), 3 ); -- GitLab From 9033bb58aba4a5a0a0bc4ff96d7edceabd43cba2 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Tue, 9 Jun 2026 18:59:07 +0200 Subject: [PATCH 2/4] issue 2622: Completing the rigged assert to see if there are cases where value diverges from the value in floating point counterpart --- lib_enc/ivas_stereo_dft_enc_fx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index d295b28d9..1fb1da69d 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -890,8 +890,10 @@ void stereo_dft_enc_update_fx( tmp = BASOP_Util_Divide3232_Scale_newton( tmp, hStereoDft->NFFT, &exp ); hStereoDft->res_cod_line_max = extract_l( L_shr( tmp, sub( 31, exp ) ) ); #ifdef DEBUG_ISSUE_2622_MISS_SUM - Word32 tmp2 = add(tmp >> (31-exp)) - + Word16 exp2 = 0; + Word32 tmp2 = BASOP_Util_Add_Mant32Exp(tmp, exp, ONE_IN_Q30 >> exp, exp, &exp2); + Word16 final_res = extract_l(L_shr(tmp2, sub(31, exp2))); + assert(EQ_16(hStereoDft->res_cod_line_max, final_res)); #endif // DEBUG_ISSUE_2622_MISS_SUM move16(); // hStereoDft->res_cod_line_max = 8 * (hStereoDft->res_cod_line_max / 8); -- GitLab From f18aec1e4c1b0326fcb22436ec94478b446080af Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Tue, 9 Jun 2026 19:14:49 +0200 Subject: [PATCH 3/4] issue 2622: Clang formatting patch --- lib_enc/ivas_stereo_dft_enc_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 1fb1da69d..7eeec5c72 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -891,9 +891,9 @@ void stereo_dft_enc_update_fx( hStereoDft->res_cod_line_max = extract_l( L_shr( tmp, sub( 31, exp ) ) ); #ifdef DEBUG_ISSUE_2622_MISS_SUM Word16 exp2 = 0; - Word32 tmp2 = BASOP_Util_Add_Mant32Exp(tmp, exp, ONE_IN_Q30 >> exp, exp, &exp2); - Word16 final_res = extract_l(L_shr(tmp2, sub(31, exp2))); - assert(EQ_16(hStereoDft->res_cod_line_max, final_res)); + Word32 tmp2 = BASOP_Util_Add_Mant32Exp( tmp, exp, ONE_IN_Q30 >> exp, exp, &exp2 ); + Word16 final_res = extract_l( L_shr( tmp2, sub( 31, exp2 ) ) ); + assert( EQ_16( hStereoDft->res_cod_line_max, final_res ) ); #endif // DEBUG_ISSUE_2622_MISS_SUM move16(); // hStereoDft->res_cod_line_max = 8 * (hStereoDft->res_cod_line_max / 8); -- GitLab From 9b073bf1cc24ab6edab0c905ac3e2a5870359449 Mon Sep 17 00:00:00 2001 From: "Azizi, Arash" Date: Thu, 11 Jun 2026 09:03:43 +0200 Subject: [PATCH 4/4] issue 2622: Correcting the test since the added value (0.5) was not correctly implemented. --- lib_enc/ivas_stereo_dft_enc_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 7eeec5c72..9554dd73e 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -891,7 +891,7 @@ void stereo_dft_enc_update_fx( hStereoDft->res_cod_line_max = extract_l( L_shr( tmp, sub( 31, exp ) ) ); #ifdef DEBUG_ISSUE_2622_MISS_SUM Word16 exp2 = 0; - Word32 tmp2 = BASOP_Util_Add_Mant32Exp( tmp, exp, ONE_IN_Q30 >> exp, exp, &exp2 ); + Word32 tmp2 = BASOP_Util_Add_Mant32Exp( tmp, exp, ONE_IN_Q30, 0, &exp2 ); Word16 final_res = extract_l( L_shr( tmp2, sub( 31, exp2 ) ) ); assert( EQ_16( hStereoDft->res_cod_line_max, final_res ) ); #endif // DEBUG_ISSUE_2622_MISS_SUM -- GitLab