From db6909322b7258ae62e24eae81f38559892147a0 Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Wed, 22 Oct 2025 15:10:20 +0100 Subject: [PATCH 1/7] Implement BASOP W_min and W_max functions. --- lib_basop/enh64.c | 97 +++++++++++++++++++++++++++++++++++++++++++- lib_basop/enh64.h | 2 + lib_debug/wmc_auto.c | 2 +- lib_debug/wmc_auto.h | 2 + 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/lib_basop/enh64.c b/lib_basop/enh64.c index 8bffb620c..b53adb79a 100644 --- a/lib_basop/enh64.c +++ b/lib_basop/enh64.c @@ -40,7 +40,103 @@ *****************************************************************************/ #ifdef ENH_64_BIT_OPERATOR +/*______________________________________________________________________________ +| | +| Function Name : W_min | +| | +| Purpose : | +| | +| Compares L64_var1 and L64_var2 and returns the minimum value. | +| | +| Complexity weight : 1 | +| | +| Inputs : | +| | +| L64_var1 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | +| | +| L64_var2 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL. | +| | +| Outputs : | +| | +| none | +| | +| Return Value : | +| | +| L64_var_out | +| 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | +|______________________________________________________________________________| +*/ +Word64 W_min( Word64 L64_var1, Word64 L64_var2 ) +{ + Word64 L64_var_out; + if ( L64_var1 <= L64_var2 ) + { + L64_var_out = L64_var1; + } + else + { + L64_var_out = L64_var2; + } + +#ifdef WMOPS + multiCounter[currCounter].W_min++; +#endif /* ifdef WMOPS */ + + return ( L64_var_out ); +} + +/*______________________________________________________________________________ +| | +| Function Name : W_max | +| | +| Purpose : | +| | +| Compares L64_var1 and L64_var2 and returns the maximum value. | +| | +| Complexity weight : 1 | +| | +| Inputs : | +| | +| L64_var1 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | +| | +| L64_var2 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL. | +| | +| Outputs : | +| | +| none | +| | +| Return Value : | +| | +| L64_var_out | +| 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | +|______________________________________________________________________________| +*/ +Word64 W_max( Word64 L64_var1, Word64 L64_var2 ) +{ + Word64 L64_var_out; + + if ( L64_var1 >= L64_var2 ) + { + L64_var_out = L64_var1; + } + else + { + L64_var_out = L64_var2; + } + +#ifdef WMOPS + multiCounter[currCounter].W_max++; +#endif /* ifdef WMOPS */ + + return ( L64_var_out ); +} /*___________________________________________________________________________ | | @@ -84,7 +180,6 @@ Word64 W_add_nosat( Word64 L64_var1, Word64 L64_var2 ) return L64_var_out; } - /*___________________________________________________________________________ | | | Function Name : W_sub_nosat | diff --git a/lib_basop/enh64.h b/lib_basop/enh64.h index c3896bb0d..d690708da 100644 --- a/lib_basop/enh64.h +++ b/lib_basop/enh64.h @@ -21,6 +21,8 @@ * *****************************************************************************/ #ifdef ENH_64_BIT_OPERATOR +Word64 W_min( Word64 L64_var1, Word64 L64_var2 ); +Word64 W_max( Word64 L64_var1, Word64 L64_var2 ); Word64 W_add_nosat( Word64 L64_var1, Word64 L64_var2 ); Word64 W_sub_nosat( Word64 L64_var1, Word64 L64_var2 ); Word64 W_shl( Word64 L64_var1, Word16 var2 ); diff --git a/lib_debug/wmc_auto.c b/lib_debug/wmc_auto.c index 5afd9de16..9d4d573f0 100644 --- a/lib_debug/wmc_auto.c +++ b/lib_debug/wmc_auto.c @@ -133,7 +133,7 @@ static BASIC_OP op_weight = { #ifdef ENH_64_BIT_OPERATOR /* Weights of new 64 bit basops */ , - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 #endif /* #ifdef ENH_64_BIT_OPERATOR */ #ifdef ENH_32_BIT_OPERATOR diff --git a/lib_debug/wmc_auto.h b/lib_debug/wmc_auto.h index 64e2c751a..6dff36f50 100644 --- a/lib_debug/wmc_auto.h +++ b/lib_debug/wmc_auto.h @@ -877,6 +877,8 @@ typedef struct /* New 64 bit basops */ #ifdef ENH_64_BIT_OPERATOR unsigned int move64; /* Complexity Weight of 1 */ + unsigned int W_min; /* Complexity Weight of 1 */ + unsigned int W_max; /* Complexity Weight of 1 */ unsigned int W_add_nosat; /* Complexity Weight of 1 */ unsigned int W_sub_nosat; /* Complexity Weight of 1 */ unsigned int W_shl; /* Complexity Weight of 1 */ -- GitLab From 837da740df1c1e4271842c656a31dda5c1672f74 Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Mon, 27 Oct 2025 12:12:47 +0000 Subject: [PATCH 2/7] Addressed Thomas Dettbarn's comments. --- lib_basop/enh64.c | 97 ------------------------------------------ lib_basop/enh64.h | 104 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 99 deletions(-) diff --git a/lib_basop/enh64.c b/lib_basop/enh64.c index b53adb79a..7812f5af0 100644 --- a/lib_basop/enh64.c +++ b/lib_basop/enh64.c @@ -40,103 +40,6 @@ *****************************************************************************/ #ifdef ENH_64_BIT_OPERATOR -/*______________________________________________________________________________ -| | -| Function Name : W_min | -| | -| Purpose : | -| | -| Compares L64_var1 and L64_var2 and returns the minimum value. | -| | -| Complexity weight : 1 | -| | -| Inputs : | -| | -| L64_var1 64 bit long signed integer (Word64) whose value falls in the | -| range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | -| | -| L64_var2 64 bit long signed integer (Word64) whose value falls in the | -| range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL. | -| | -| Outputs : | -| | -| none | -| | -| Return Value : | -| | -| L64_var_out | -| 64 bit long signed integer (Word64) whose value falls in the | -| range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | -|______________________________________________________________________________| -*/ -Word64 W_min( Word64 L64_var1, Word64 L64_var2 ) -{ - Word64 L64_var_out; - - if ( L64_var1 <= L64_var2 ) - { - L64_var_out = L64_var1; - } - else - { - L64_var_out = L64_var2; - } - -#ifdef WMOPS - multiCounter[currCounter].W_min++; -#endif /* ifdef WMOPS */ - - return ( L64_var_out ); -} - -/*______________________________________________________________________________ -| | -| Function Name : W_max | -| | -| Purpose : | -| | -| Compares L64_var1 and L64_var2 and returns the maximum value. | -| | -| Complexity weight : 1 | -| | -| Inputs : | -| | -| L64_var1 64 bit long signed integer (Word64) whose value falls in the | -| range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | -| | -| L64_var2 64 bit long signed integer (Word64) whose value falls in the | -| range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL. | -| | -| Outputs : | -| | -| none | -| | -| Return Value : | -| | -| L64_var_out | -| 64 bit long signed integer (Word64) whose value falls in the | -| range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | -|______________________________________________________________________________| -*/ -Word64 W_max( Word64 L64_var1, Word64 L64_var2 ) -{ - Word64 L64_var_out; - - if ( L64_var1 >= L64_var2 ) - { - L64_var_out = L64_var1; - } - else - { - L64_var_out = L64_var2; - } - -#ifdef WMOPS - multiCounter[currCounter].W_max++; -#endif /* ifdef WMOPS */ - - return ( L64_var_out ); -} /*___________________________________________________________________________ | | diff --git a/lib_basop/enh64.h b/lib_basop/enh64.h index d690708da..ab21d5b0c 100644 --- a/lib_basop/enh64.h +++ b/lib_basop/enh64.h @@ -21,8 +21,108 @@ * *****************************************************************************/ #ifdef ENH_64_BIT_OPERATOR -Word64 W_min( Word64 L64_var1, Word64 L64_var2 ); -Word64 W_max( Word64 L64_var1, Word64 L64_var2 ); + + +/*______________________________________________________________________________ +| | +| Function Name : W_min | +| | +| Purpose : | +| | +| Compares L64_var1 and L64_var2 and returns the minimum value. | +| | +| Complexity weight : 1 | +| | +| Inputs : | +| | +| L64_var1 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | +| | +| L64_var2 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL. | +| | +| Outputs : | +| | +| none | +| | +| Return Value : | +| | +| L64_var_out | +| 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | +|______________________________________________________________________________| +*/ +static __inline Word64 W_min( Word64 L64_var1, Word64 L64_var2 ) +{ + Word64 L64_var_out; + + if ( L64_var1 <= L64_var2 ) + { + L64_var_out = L64_var1; + } + else + { + L64_var_out = L64_var2; + } + +#ifdef WMOPS + multiCounter[currCounter].W_min++; +#endif /* ifdef WMOPS */ + + return ( L64_var_out ); +} + + +/*______________________________________________________________________________ +| | +| Function Name : W_max | +| | +| Purpose : | +| | +| Compares L64_var1 and L64_var2 and returns the maximum value. | +| | +| Complexity weight : 1 | +| | +| Inputs : | +| | +| L64_var1 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var1 <= 0x7fffffff ffffffffLL. | +| | +| L64_var2 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var2 <= 0x7fffffff ffffffffLL. | +| | +| Outputs : | +| | +| none | +| | +| Return Value : | +| | +| L64_var_out | +| 64 bit long signed integer (Word64) whose value falls in the | +| range : 0x80000000 00000000LL <= L64_var_out <= 0x7fffffff ffffffffLL. | +|______________________________________________________________________________| +*/ +static __inline Word64 W_max( Word64 L64_var1, Word64 L64_var2 ) +{ + Word64 L64_var_out; + + if ( L64_var1 >= L64_var2 ) + { + L64_var_out = L64_var1; + } + else + { + L64_var_out = L64_var2; + } + +#ifdef WMOPS + multiCounter[currCounter].W_max++; +#endif /* ifdef WMOPS */ + + return ( L64_var_out ); +} + + Word64 W_add_nosat( Word64 L64_var1, Word64 L64_var2 ); Word64 W_sub_nosat( Word64 L64_var1, Word64 L64_var2 ); Word64 W_shl( Word64 L64_var1, Word16 var2 ); -- GitLab From 024b3128dfee95ca8cc869625aae47673a70f8be Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Mon, 27 Oct 2025 12:15:21 +0000 Subject: [PATCH 3/7] Revert changes in enh64.c. --- lib_basop/enh64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_basop/enh64.c b/lib_basop/enh64.c index 7812f5af0..8bffb620c 100644 --- a/lib_basop/enh64.c +++ b/lib_basop/enh64.c @@ -41,6 +41,7 @@ #ifdef ENH_64_BIT_OPERATOR + /*___________________________________________________________________________ | | | Function Name : W_add_nosat | @@ -83,6 +84,7 @@ Word64 W_add_nosat( Word64 L64_var1, Word64 L64_var2 ) return L64_var_out; } + /*___________________________________________________________________________ | | | Function Name : W_sub_nosat | -- GitLab From a791a1528846174d2c55887b248b0fd3b05cf1a2 Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Thu, 6 Nov 2025 10:02:44 +0000 Subject: [PATCH 4/7] Optimize eig2x2_fx part 1. --- lib_dec/ivas_ism_metadata_dec_fx.c | 2 +- .../ivas_dirac_dec_binaural_functions_fx.c | 131 ++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 54cc5da15..4d3c06b9c 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -#include "move.h" #include #include "options.h" #include "ivas_cnst.h" @@ -40,6 +39,7 @@ #include "ivas_stat_enc.h" #include #include "wmc_auto.h" +#include "move.h" #include "ivas_prot_fx.h" diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 3211b0e46..c689c449a 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -3518,6 +3518,31 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked_fx( return; } +#if 0 +static void check( + Word32 computed_fx, + Word16 computed_q, + Word32 expected_fx, + Word16 expected_q, + Word32 max_abs_err ); + +static void check( + Word32 computed_fx, + Word16 computed_q, + Word32 expected_fx, + Word16 expected_q, + Word32 max_abs_err ) +{ + Word16 qd = computed_q - expected_q; + Word32 cf = computed_fx >> +max( qd, 0 ); + Word32 ef = expected_fx >> -min( qd, 0 ); + Word32 abs_error = abs( cf - ef ); + if ( abs_error >= max_abs_err ) + { + assert( false ); + } +} +#endif static void eig2x2_fx( const Word32 E1_fx, /*q_E*/ @@ -3532,6 +3557,7 @@ static void eig2x2_fx( Word32 D_fx[BINAURAL_CHANNELS], /*q_D*/ Word16 *q_D ) { +#if 0 Word16 chA, chB, ch; Word32 s_fx, normVal_fx, crossSquare_fx, a_fx, pm_fx, add_fx; Word32 tmp1, tmp2, tmp3, e1, e2, c_re, c_im; @@ -3672,7 +3698,112 @@ static void eig2x2_fx( *q_D = sub( q_tmp2, 1 ); move16(); } +#else + Word16 chA, chB, ch; + FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) + { + FOR( chB = 0; chB < BINAURAL_CHANNELS; chB++ ) + { + Ure_fx[chA][chB] = 0; + move32(); + Uim_fx[chA][chB] = 0; + move32(); + } + } + // =================================================================================================== + /*crossSquare_fx = (c_re * c_re) + (c_im * c_im) + a_fx = (e1 + e2) * (e1 + e2) - 4.0f * ((e1 * e2) - crossSquare_fx) = (e1 - e2)^2 + 4 * crossSquare_fx + pm_fx = 0.5f * sqrtf(max(0.0f, a_fx)) + add_fx = 0.5f * (e1 + e2)*/ + + Word16 q1, q2, qm, qd, lshift; + + // (e1 - e2)^2 -> Q: 2 * q_E + q1 = shl( q_E, 1 ); + // 4 * ((c_re * c_re) + (c_im * c_im)) -> Q: 2 * q_C - 2 + q2 = sub( shl( q_C, 1 ), 2 ); + + // (e1 - e2)^2 + Word32 es = L_sub( E1_fx, E2_fx ); + Word64 es2 = W_mult0_32_32( es, es ); + lshift = sub( W_norm( es2 ), 1 ); + es2 = W_shl( es2, lshift ); + q1 = add( q1, lshift ); + if ( !es2 ) + { + q1 = 63; + move16(); + } + + // 4 * ((c_re * c_re) + (c_im * c_im)) + Word64 cs = W_add( W_mult0_32_32( Cre_fx, Cre_fx ), W_mult0_32_32( Cim_fx, Cim_fx ) ); // 2*q_C-2 + lshift = sub( W_norm( cs ), 1 ); + cs = W_shl( cs, lshift ); + q2 = add( q2, lshift ); + if ( !cs ) + { + q2 = 63; + move16(); + } + + Word32 crossSquare_fx = (Word32) ( cs >> 32 ); // FIXME + Word16 q_crossSquare = 2 * q_C + lshift - 32; // FIXME + + // a = max(0, (e1 - e2)^2 + 4 * crossSquare_fx) + qm = s_min( q1, q2 ); + qd = sub( q1, q2 ); + Word64 a = W_max( W_add( W_shr( es2, s_max( qd, 0 ) ), W_shr( cs, negate( s_min( qd, 0 ) ) ) ), 0 ); + + // pm = 0.5f * sqrtf(a) + // a = 0.5f * ( E1 + E2 ); + lshift = W_norm( a ); + Word32 pm = W_extract_h( W_shl( a, lshift ) ); + Word16 e = sub( sub( 63, lshift ), qm ); + pm = L_shr( Sqrt32( pm, &e ), 1 ); + q2 = sub( 31, e ); + // check( pm, q2, pm_fx, q_tmp2, 1 << 16 ); + a = L_add( E1_fx, E2_fx ); + lshift = sub( norm_l( a ), 1 ); + a = W_shl( a, lshift ); + q1 = add( add( q_E, 1 ), lshift ); + // check( a, q1, add_fx, q_tmp1, 1 << 16 ); + + Word32 add_fx = a; // FIXME + Word16 q_tmp1 = q1; // FIXME + Word32 pm_fx = pm; // FIXME + Word16 q_tmp2 = q2; // FIXME + + // D[0] = add + pm; + // D[1] = max( 0.0f, add - pm ); + qm = s_min( q1, q2 ); + qd = sub( q1, q2 ); + a = W_shr( a, s_max( qd, 0 ) ); + pm = W_shr( pm, negate( s_min( qd, 0 ) ) ); + Word32 d0 = L_add( a, pm ); + Word32 d1 = L_max( L_sub( a, pm ), 0 ); + // check( d0, qm, D_fx[0], *q_D, 1 << 16 ); + // check( d1, qm, D_fx[1], *q_D, 1 << 16 ); + + D_fx[0] = d0; // FIXME + D_fx[1] = d1; // FIXME + *q_D = qm; // FIXME + + Word32 tmp1, tmp2, tmp3, e1, e2, s_fx, normVal_fx, c_re, c_im; // FIXME + Word16 q_U_1, q_U_2, q_c, q_e, exp, exp_tmp3; // FIXME + Word32 epsilon_mant = 1180591621; // FIXME + Word16 epsilon_exp = -39; // FIXME + + exp = sub( get_min_scalefactor( Cre_fx, Cim_fx ), 2 ); // FIXME + c_re = L_shl( Cre_fx, exp ); // FIXME + c_im = L_shl( Cim_fx, exp ); // FIXME + q_c = add( q_C, exp ); // FIXME + + exp = sub( get_min_scalefactor( E1_fx, E2_fx ), 2 ); // FIXME + e1 = L_shl( E1_fx, exp ); // FIXME + e2 = L_shl( E2_fx, exp ); // FIXME + q_e = add( q_E, exp ); // FIXME +#endif /* Numeric case, when input is practically zeros */ // IF( D_fx[0] < EPSILON_FX ) -- GitLab From f4d6f56eb196c8dd629d0e7013da5f737c35a32d Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Thu, 6 Nov 2025 17:51:15 +0000 Subject: [PATCH 5/7] Fix MSVC build failure. --- lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index c689c449a..4ddbdcc45 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -3763,13 +3763,13 @@ static void eig2x2_fx( pm = L_shr( Sqrt32( pm, &e ), 1 ); q2 = sub( 31, e ); // check( pm, q2, pm_fx, q_tmp2, 1 << 16 ); - a = L_add( E1_fx, E2_fx ); - lshift = sub( norm_l( a ), 1 ); - a = W_shl( a, lshift ); + Word32 ea = L_add( E1_fx, E2_fx ); + lshift = sub( norm_l( ea ), 1 ); + ea = L_shl( ea, lshift ); q1 = add( add( q_E, 1 ), lshift ); - // check( a, q1, add_fx, q_tmp1, 1 << 16 ); + // check( ea, q1, add_fx, q_tmp1, 1 << 16 ); - Word32 add_fx = a; // FIXME + Word32 add_fx = ea; // FIXME Word16 q_tmp1 = q1; // FIXME Word32 pm_fx = pm; // FIXME Word16 q_tmp2 = q2; // FIXME -- GitLab From db555574e65c07102d845662be1e0531cb3ee055 Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Thu, 6 Nov 2025 17:54:13 +0000 Subject: [PATCH 6/7] Apply clang format. --- lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 4ddbdcc45..4fc279344 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -3769,7 +3769,7 @@ static void eig2x2_fx( q1 = add( add( q_E, 1 ), lshift ); // check( ea, q1, add_fx, q_tmp1, 1 << 16 ); - Word32 add_fx = ea; // FIXME + Word32 add_fx = ea; // FIXME Word16 q_tmp1 = q1; // FIXME Word32 pm_fx = pm; // FIXME Word16 q_tmp2 = q2; // FIXME -- GitLab From 9219bfbcf5650e3bb98a4ec81a0a1f1ad3ba647d Mon Sep 17 00:00:00 2001 From: Nicolas Roussin Date: Thu, 6 Nov 2025 18:08:14 +0000 Subject: [PATCH 7/7] Fix MSVC build failure. --- lib_rend/ivas_dirac_dec_binaural_functions_fx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 4fc279344..b79a62c26 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -3778,10 +3778,10 @@ static void eig2x2_fx( // D[1] = max( 0.0f, add - pm ); qm = s_min( q1, q2 ); qd = sub( q1, q2 ); - a = W_shr( a, s_max( qd, 0 ) ); - pm = W_shr( pm, negate( s_min( qd, 0 ) ) ); - Word32 d0 = L_add( a, pm ); - Word32 d1 = L_max( L_sub( a, pm ), 0 ); + ea = L_shr( ea, s_max( qd, 0 ) ); + pm = L_shr( pm, negate( s_min( qd, 0 ) ) ); + Word32 d0 = L_add( ea, pm ); + Word32 d1 = L_max( L_sub( ea, pm ), 0 ); // check( d0, qm, D_fx[0], *q_D, 1 << 16 ); // check( d1, qm, D_fx[1], *q_D, 1 << 16 ); -- GitLab