From 8567e996b8dcfb71e765e317476443ef830109e9 Mon Sep 17 00:00:00 2001 From: mave2802 <59919483+mave2802@users.noreply.github.com> Date: Tue, 30 Dec 2025 19:16:54 +0100 Subject: [PATCH 01/10] perform now division by 128 in non EVS mode --- lib_com/swb_tbe_com_fx.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index c9d307ef2..751bfc1ff 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6129,34 +6129,35 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ + j = abs_s( shr( Random( &seed[0] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ } else { L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ + j = extract_l( L_shr( L_tmp, 23 ) ); } #else - L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ -#endif - + L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ j = extract_l( L_shr( L_tmp, 23 ) ); +#endif j = s_and( j, 0xff ); #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = abs_s( shr( Random( &seed[1] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ } else { L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = extract_l( L_shr( L_tmp, 23 ) ); } #else - L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = extract_l( L_shr( L_tmp, 23 ) ); #endif - k = extract_l( L_shr( L_tmp, 23 ) ); k = s_and( k, 0xff ); WHILE( EQ_16( k, j ) ) @@ -6164,17 +6165,18 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = abs_s( shr( Random( &seed[1] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ } else { L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = extract_l( L_shr( L_tmp, 23 ) ); } #else L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = extract_l( L_shr( L_tmp, 23 ) ); #endif - k = extract_l( L_shr( L_tmp, 23 ) ); k = s_and( k, 0xff ); } -- GitLab From 13b5397c390d33d9a009c5c8b688ff8420ea268a Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 13 Jan 2026 10:25:42 +0100 Subject: [PATCH 02/10] update the fix --- lib_com/swb_tbe_com_fx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 751c7603b..956b57a97 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6173,8 +6173,6 @@ void create_random_vector_fx( } #else L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ -#endif - j = extract_l( L_shr( L_tmp, 23 ) ); #endif j = s_and( j, 0xff ); @@ -6189,9 +6187,9 @@ void create_random_vector_fx( L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ k = extract_l( L_shr( L_tmp, 23 ) ); } - #else L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = extract_l( L_shr( L_tmp, 23 ) ); #endif k = s_and( k, 0xff ); @@ -6210,6 +6208,7 @@ void create_random_vector_fx( } #else L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + k = extract_l( L_shr( L_tmp, 23 ) ); #endif k = s_and( k, 0xff ); -- GitLab From 98fb5312364aeba590f1dddb56fddcbc6a6455fb Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 13 Jan 2026 10:27:23 +0100 Subject: [PATCH 03/10] clang format --- lib_com/swb_tbe_com_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 956b57a97..21d00ee5f 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6188,7 +6188,7 @@ void create_random_vector_fx( k = extract_l( L_shr( L_tmp, 23 ) ); } #else - L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ k = extract_l( L_shr( L_tmp, 23 ) ); #endif @@ -6207,7 +6207,7 @@ void create_random_vector_fx( k = extract_l( L_shr( L_tmp, 23 ) ); } #else - L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ + L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */ k = extract_l( L_shr( L_tmp, 23 ) ); #endif -- GitLab From 2e00f1c42660ccf4fc5b0903d22bf1adeb354735 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Mon, 19 Jan 2026 19:48:20 +0100 Subject: [PATCH 04/10] do not update seed[1] when j == k in the first run --- lib_com/swb_tbe_com_fx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 698b34e3a..2c3c718b3 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6140,6 +6140,7 @@ void create_random_vector_fx( Word16 i, j, k; Word16 scale1, scale2; Word32 L_tmp; + /* Note: the constant 2144047674 is 0.0078f in Q38 from the float reference. It should read 0.0078125f, which is 1/128.Since 0.0078f is nor exactly @@ -6185,7 +6186,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = abs_s( shr( Random( &seed[1] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ + k = abs_s( shr( Random( &k ), 7 ) ); } else { -- GitLab From 536059e31ddc37f7ac2c3a947d34ab83e2083935 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Mon, 19 Jan 2026 20:29:23 +0100 Subject: [PATCH 05/10] clang format --- lib_com/swb_tbe_com_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 917118d36..f0229089d 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6037,7 +6037,7 @@ void create_random_vector_fx( j = extract_l( L_shr( L_tmp, 23 ) ); } #else - L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ + L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ j = extract_l( L_shr( L_tmp, 23 ) ); #endif j = s_and( j, 0xff ); @@ -6064,7 +6064,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = abs_s( shr( Random( &k ), 7 ) ); + k = abs_s( shr( Random( &k ), 7 ) ); } else { -- GitLab From 8dd635e2b70487b0ad7a1648be525940561fda44 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 20 Jan 2026 14:27:28 +0100 Subject: [PATCH 06/10] adopt proposal by M.Multrus --- lib_com/swb_tbe_com_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index f0229089d..c31a18fc4 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6029,7 +6029,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - j = abs_s( shr( Random( &seed[0] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ + j = shr( abs_s( Random( &seed[0] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ } else { @@ -6045,7 +6045,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = abs_s( shr( Random( &seed[1] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ + k = shr( abs_s( Random( &seed[1] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ } else { @@ -6064,7 +6064,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = abs_s( shr( Random( &k ), 7 ) ); + k = shr( abs_s( Random( &k ), 7 ) ); } else { -- GitLab From e6d8865997d2fc6d3a5908ef70b243d13c35c8af Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 20 Jan 2026 16:34:23 +0100 Subject: [PATCH 07/10] clang format --- lib_com/swb_tbe_com_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 41b233e24..f78a096c7 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6092,7 +6092,7 @@ void create_random_vector_fx( j = extract_l( L_shr( L_tmp, 23 ) ); } #else - L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ + L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */ j = extract_l( L_shr( L_tmp, 23 ) ); #endif j = s_and( j, 0xff ); -- GitLab From 0e13b6c75499a27c81cb75728302b379336ca4b1 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 21 Jan 2026 08:18:10 +0100 Subject: [PATCH 08/10] fix wrong ) placement --- lib_com/swb_tbe_com_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index f78a096c7..9242314ce 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6084,7 +6084,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - j = shr( abs_s( Random( &seed[0] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ + j = shr( abs_s( Random( &seed[0] ) ), 7 ); /* Random( &seed[0] * 0.0078125f ) */ } else { @@ -6100,7 +6100,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = shr( abs_s( Random( &seed[1] ), 7 ) ); /* Random( &seed[0] * 0.0078125f ) */ + k = shr( abs_s( Random( &seed[1] ) ), 7 ); /* Random( &seed[0] * 0.0078125f ) */ } else { @@ -6119,7 +6119,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = shr( abs_s( Random( &k ), 7 ) ); + k = shr( abs_s( Random( &k ) ), 7 ); } else { -- GitLab From 8aa10aa200dfdd3da88fc008ff9e654a4b92e009 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 21 Jan 2026 10:01:17 +0100 Subject: [PATCH 09/10] revert the change involving using seed[1] when k==j --- lib_com/swb_tbe_com_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 9242314ce..9b4db81b7 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6119,7 +6119,7 @@ void create_random_vector_fx( #ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT if ( element_mode != EVS_MONO ) { - k = shr( abs_s( Random( &k ) ), 7 ); + k = shr( abs_s( Random( &seed[1] ) ), 7 ); } else { -- GitLab From 16f15d619ac3f46e4b0f4dea78062c193ee4997b Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Wed, 21 Jan 2026 15:54:09 +0100 Subject: [PATCH 10/10] increase length of config str --- lib_dec/lib_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 4a99ce5f2..8eded2fa9 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -5358,7 +5358,7 @@ static ivas_error printConfigInfo_dec( const bool quietModeEnabled ) { ivas_error error; - Word8 config_str[50]; + Word8 config_str[200]; AUDIO_CONFIG output_config; /*-----------------------------------------------------------------* -- GitLab