From ae1767748cc367f8d28eb0c2062e2da8463eb422 Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 24 Oct 2025 13:42:55 +0200 Subject: [PATCH 1/5] ISSUE #2160 MR 2459 --- lib_com/basop_util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 37619f4c1..4ef84b1ae 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2581,12 +2581,18 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ account all shift operations. */ + shift = norm_l( a_m ); + a_m = L_shl( a_m, shift ); + a_e = sub( a_e, shift ); if ( !a_m ) { a_e = b_e; move16(); } + shift = norm_l( b_m ); + b_m = L_shl( b_m, shift ); + b_e = sub( b_e, shift ); if ( !b_m ) { b_e = a_e; -- GitLab From bf2399b02b220f4d166235fb02e76982dcb9d263 Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 24 Oct 2025 15:30:58 +0200 Subject: [PATCH 2/5] ISSUE #2160 MR 2459 --- lib_com/basop_util.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 4ef84b1ae..dd8bb8f2f 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2584,15 +2584,16 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ shift = norm_l( a_m ); a_m = L_shl( a_m, shift ); a_e = sub( a_e, shift ); + + shift = norm_l( b_m ); + b_m = L_shl( b_m, shift ); + b_e = sub( b_e, shift ); + if ( !a_m ) { a_e = b_e; move16(); } - - shift = norm_l( b_m ); - b_m = L_shl( b_m, shift ); - b_e = sub( b_e, shift ); if ( !b_m ) { b_e = a_e; -- GitLab From a2247bbeee4a94b7227e3848f368ce5ea7f4f423 Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 24 Oct 2025 16:01:03 +0200 Subject: [PATCH 3/5] ISSUE #2160 MR 2459 --- lib_enc/ivas_mct_enc_mct_fx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_enc/ivas_mct_enc_mct_fx.c b/lib_enc/ivas_mct_enc_mct_fx.c index d402d834f..d684f7148 100644 --- a/lib_enc/ivas_mct_enc_mct_fx.c +++ b/lib_enc/ivas_mct_enc_mct_fx.c @@ -92,6 +92,7 @@ void getChannelEnergies_fx( sum2_e = st->hTcxEnc->spectrum_e[0]; move16(); nrg[ch] = 0; + nrg_e[ch] = 0; move32(); FOR( n = 0; n < nSubframes; n++ ) { -- GitLab From bb651fe61aa2f7fbe4ae9b7db47542f5779dcebc Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 24 Oct 2025 16:38:47 +0200 Subject: [PATCH 4/5] ISSUE #2160 MR 2459 --- lib_com/basop_util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index dd8bb8f2f..acd5e6ab5 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2583,11 +2583,15 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ shift = norm_l( a_m ); a_m = L_shl( a_m, shift ); - a_e = sub( a_e, shift ); + if ( a_m ) { + a_e = sub( a_e, shift ); + } shift = norm_l( b_m ); b_m = L_shl( b_m, shift ); - b_e = sub( b_e, shift ); + if ( b_m ) { + b_e = sub( b_e, shift ); + } if ( !a_m ) { -- GitLab From 3ec27a6036d78ee6e7eb3d4e31c7fccea19f7e7a Mon Sep 17 00:00:00 2001 From: gerstack Date: Fri, 24 Oct 2025 16:44:01 +0200 Subject: [PATCH 5/5] ISSUE #2160 MR 2459 clang apply patch --- lib_com/basop_util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index acd5e6ab5..44182659d 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -2583,13 +2583,15 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ shift = norm_l( a_m ); a_m = L_shl( a_m, shift ); - if ( a_m ) { + if ( a_m ) + { a_e = sub( a_e, shift ); } shift = norm_l( b_m ); b_m = L_shl( b_m, shift ); - if ( b_m ) { + if ( b_m ) + { b_e = sub( b_e, shift ); } -- GitLab