From 2bd1ad55d9623f91f0e1c723c1f3ef327c3b18e9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 11 Feb 2026 16:17:42 +0100 Subject: [PATCH 1/4] WMC_TOOL_SKIP revision --- lib_basop/basop32.c | 3 --- lib_basop/complex_basop.c | 1 - lib_basop/enh1632.c | 5 ----- lib_basop/enh32.c | 2 -- lib_basop/enh40.c | 4 ---- lib_basop/enh64.c | 4 ---- lib_basop/enhUL32.c | 4 ---- lib_com/ari_hm_fx.c | 3 --- lib_com/arith_coder_fx.c | 3 --- lib_com/basop_com_lpc.c | 3 --- lib_com/basop_lsf_tools.c | 3 --- lib_com/basop_tcx_utils.c | 3 --- lib_com/bitalloc_fx.c | 3 --- lib_com/fft_fx.c | 4 ---- lib_com/lsf_tools_fx.c | 17 ----------------- lib_com/oper_32b.c | 3 --- lib_dec/arith_coder_dec_fx.c | 2 -- lib_enc/ivas_stereo_eclvq_enc_fx.c | 4 +--- lib_enc/lsf_msvq_ma_enc_fx.c | 7 ------- lib_rend/ivas_crend_fx.c | 5 ----- 20 files changed, 1 insertion(+), 82 deletions(-) diff --git a/lib_basop/basop32.c b/lib_basop/basop32.c index 27b499276..14f314d40 100644 --- a/lib_basop/basop32.c +++ b/lib_basop/basop32.c @@ -164,7 +164,6 @@ HISTORY: #include -#define WMC_TOOL_SKIP #ifdef _MSC_VER #pragma warning( disable : 4310 ) @@ -3790,5 +3789,3 @@ Word32 L_msu0_sat( Word32 L_var3, Word16 var1, Word16 var2 ) Flag Overflow; return L_msu0_o( L_var3, var1, var2, &Overflow ); } - -#undef WMC_TOOL_SKIP diff --git a/lib_basop/complex_basop.c b/lib_basop/complex_basop.c index cf3b40154..e58d0d95e 100644 --- a/lib_basop/complex_basop.c +++ b/lib_basop/complex_basop.c @@ -11,7 +11,6 @@ #include "stl.h" -#define WMC_TOOL_SKIP #ifdef COMPLEX_OPERATOR diff --git a/lib_basop/enh1632.c b/lib_basop/enh1632.c index f397c3432..0a637bec8 100644 --- a/lib_basop/enh1632.c +++ b/lib_basop/enh1632.c @@ -56,7 +56,6 @@ #include #include "stl.h" -#define WMC_TOOL_SKIP /***************************************************************************** * @@ -687,7 +686,3 @@ Word32 L_rotl( Word32 L_var1, Word16 var2, Word16 *var3 ) return ( L_var_out ); } - -#undef WMC_TOOL_SKIP - -/* end of file */ diff --git a/lib_basop/enh32.c b/lib_basop/enh32.c index d2931dd5d..b8952db92 100644 --- a/lib_basop/enh32.c +++ b/lib_basop/enh32.c @@ -23,7 +23,6 @@ #include #include "stl.h" -#define WMC_TOOL_SKIP #ifdef ENH_32_BIT_OPERATOR /***************************************************************************** @@ -223,6 +222,5 @@ Word32 Msub_32_32_r( Word32 L_var3, Word32 L_var1, Word32 L_var2 ) } #endif /* #ifdef ENH_32_BIT_OPERATOR */ -#undef WMC_TOOL_SKIP /* end of file */ diff --git a/lib_basop/enh40.c b/lib_basop/enh40.c index 57df99e5c..fd0e3278f 100644 --- a/lib_basop/enh40.c +++ b/lib_basop/enh40.c @@ -98,7 +98,6 @@ #include "stl.h" #include -#define WMC_TOOL_SKIP #ifdef _MSC_VER #pragma warning( disable : 4310 ) @@ -1300,6 +1299,3 @@ Word40 L40_shl_r( Word40 L40_var1, Word16 var2 ) return ( L40_var_out ); } - - -#undef WMC_TOOL_SKIP diff --git a/lib_basop/enh64.c b/lib_basop/enh64.c index 8bffb620c..1cdd52471 100644 --- a/lib_basop/enh64.c +++ b/lib_basop/enh64.c @@ -18,7 +18,6 @@ #include #include "stl.h" -#define WMC_TOOL_SKIP /***************************************************************************** * @@ -1816,6 +1815,3 @@ Word32 W_round64_L( Word64 L64_var1 ) } #endif /* #ifdef ENH_64_BIT_OPERATOR */ -#undef WMC_TOOL_SKIP - -/* end of file */ diff --git a/lib_basop/enhUL32.c b/lib_basop/enhUL32.c index 565082120..194bdf184 100644 --- a/lib_basop/enhUL32.c +++ b/lib_basop/enhUL32.c @@ -27,7 +27,6 @@ #include "stl.h" #include "stl.h" -#define WMC_TOOL_SKIP /***************************************************************************** * @@ -361,6 +360,3 @@ UWord32 UL_addNsD( UWord32 UL_var1, UWord32 UL_var2 ) #endif #endif /* ENH_U_32_BIT_OPERATOR */ -#undef WMC_TOOL_SKIP - -/* end of file */ diff --git a/lib_com/ari_hm_fx.c b/lib_com/ari_hm_fx.c index e35416e5f..7f2fba55c 100644 --- a/lib_com/ari_hm_fx.c +++ b/lib_com/ari_hm_fx.c @@ -188,7 +188,6 @@ Word16 CountIndexBits( return result; } -#define WMC_TOOL_SKIP Word32 tcx_hm_render( Word32 lag, /* i: pitch lag Q0 */ @@ -293,5 +292,3 @@ void tcx_hm_modify_envelope( k = extract_l( L_shr( imult3216( lag, h ), fract_res ) ); /* Q0 */ } } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/arith_coder_fx.c b/lib_com/arith_coder_fx.c index 173e4faf3..00a6737d1 100644 --- a/lib_com/arith_coder_fx.c +++ b/lib_com/arith_coder_fx.c @@ -478,7 +478,6 @@ void tcx_arith_render_envelope( } } -#define WMC_TOOL_SKIP /*-------------------------------------------------------* * expfp_evs() @@ -629,5 +628,3 @@ void tcx_arith_render_envelope_ivas_fx( return; } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_com_lpc.c b/lib_com/basop_com_lpc.c index 398d75327..182ab57bb 100644 --- a/lib_com/basop_com_lpc.c +++ b/lib_com/basop_com_lpc.c @@ -43,7 +43,6 @@ #include "basop_util.h" #include "stl.h" -#define WMC_TOOL_SKIP #define UNROLL_CHEBYSHEV_INNER_LOOP #define NC_MAX 8 @@ -276,5 +275,3 @@ void basop_lsf2lsp( return; } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_lsf_tools.c b/lib_com/basop_lsf_tools.c index db40e08ef..9cb5d9180 100644 --- a/lib_com/basop_lsf_tools.c +++ b/lib_com/basop_lsf_tools.c @@ -40,7 +40,6 @@ #include "basop_proto_func.h" #include "basop_util.h" -#define WMC_TOOL_SKIP #define NC_MAX 8 @@ -307,5 +306,3 @@ static Word16 E_LPC_f_lsp_pol_get( } return Ovf; } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_tcx_utils.c b/lib_com/basop_tcx_utils.c index 7fa5e12be..60200d968 100644 --- a/lib_com/basop_tcx_utils.c +++ b/lib_com/basop_tcx_utils.c @@ -43,7 +43,6 @@ #include "prot_fx.h" #include "rom_com.h" -#define WMC_TOOL_SKIP /* compare two positive normalized 16 bit mantissa/exponent values */ /* return value: positive if first value greater, negative if second value greater, zero if equal */ @@ -450,5 +449,3 @@ void basop_PsychAdaptLowFreqDeemph_fx( } } } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/bitalloc_fx.c b/lib_com/bitalloc_fx.c index 2791e36ea..5dc472047 100644 --- a/lib_com/bitalloc_fx.c +++ b/lib_com/bitalloc_fx.c @@ -211,7 +211,6 @@ void bitalloc_fx( return; } -#define WMC_TOOL_SKIP /*-------------------------------------------------------------------* * BitAllocF() @@ -1052,5 +1051,3 @@ Word16 BitAllocWB_fx( /* o : t return (Word16) t_fx; } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index 651820c6a..2cd92db53 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -7165,8 +7165,6 @@ void rfft_fx( } -#define WMC_TOOL_SKIP - #define FFTC( x ) WORD322WORD16( (Word32) x ) #define C81_FX ( FFTC( 0x5a82799a ) ) /* FL2WORD32( 7.071067811865475e-1) */ @@ -7474,5 +7472,3 @@ void BASOP_cfft_ivas( return; } - -#undef WMC_TOOL_SKIP diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index c1638a269..608373617 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -4013,7 +4013,6 @@ void msvq_dec_fx( } } -#define WMC_TOOL_SKIP IF( uq_ind != NULL ) { FOR( j = 0; j < n; ++j ) @@ -4023,7 +4022,6 @@ void msvq_dec_fx( move16(); } } -#undef WMC_TOOL_SKIP } return; @@ -4091,18 +4089,11 @@ void dctT2_N_apply_matrix_fx( move32(); /* +i(DCT) or +i*maxTrunc(IDCT) */ -#define WMC_TOOL_SKIP pt_A = &( matrix[i * ( mat_step_row + mat_step_col_flag )] ); /* ptr indexing */ - PTR_INIT( 1 ); -#undef WMC_TOOL_SKIP FOR( j = 0; j < dim_in; j++ ) { -#define WMC_TOOL_SKIP *pt_y = L_add( *pt_y, Mpy_32_32( ( *pt_x++ ), ( *pt_A ) ) ); - move32(); pt_A += mat_step_col; /* step +maxtrunc or +1 */ /* ptr indexing*/ - MAC_C( 1 ); -#undef WMC_TOOL_SKIP } pt_y++; } @@ -4148,13 +4139,9 @@ void extend_dctN_input_fx( FOR( j = 0; j < n_cols; j++ ) /* for each available DCT coeff */ { /* DCTcoeff * reflected basis vector */ -#define WMC_TOOL_SKIP /* pure ptr MAC operations */ ext_sig[i] = L_add( ext_sig[i], Mpy_32_32( dct_input[j], ptr[i_rev][j] ) ); /* sum up scaled and extended basis vector */ // Q31 + Q - Q31 -> Q - move32(); - MAC_C( 1 ); -#undef WMC_TOOL_SKIP } } @@ -4230,12 +4217,8 @@ void create_IDCT_N_Matrix_fx( tmp16 = shr( len, 1 ); FOR( r = 0; r < tmp16; r_flip-- ) { -#define WMC_TOOL_SKIP ptr[r_flip][c] = ptr[r][c]; /* flipped: Q31*/ ptr[r_flip][c1] = L_negate( ptr[r][c1] ); /* flipped and sign swapped: Q31 */ - MOVE( 2 ); - MULT( 1 ); /* for negate */ -#undef WMC_TOOL_SKIP r++; } } diff --git a/lib_com/oper_32b.c b/lib_com/oper_32b.c index cb8c77300..47b39ee48 100644 --- a/lib_com/oper_32b.c +++ b/lib_com/oper_32b.c @@ -25,7 +25,6 @@ #include "stl.h" #include "basop32.h" -#define WMC_TOOL_SKIP /***************************************************************************** * * @@ -379,5 +378,3 @@ Word32 Div_32( Word32 L_num, Word16 denom_hi, Word16 denom_lo ) L_32 = L_shl_sat( L_32, 2 ); return ( L_32 ); } - -#undef WMC_TOOL_SKIP diff --git a/lib_dec/arith_coder_dec_fx.c b/lib_dec/arith_coder_dec_fx.c index e91ac4ed0..9ebf8c9c3 100644 --- a/lib_dec/arith_coder_dec_fx.c +++ b/lib_dec/arith_coder_dec_fx.c @@ -356,9 +356,7 @@ void tcx_arith_decode_envelope_ivas_fx( gamma_uw = st->inv_gamma; move16(); -#define WMC_TOOL_SKIP tcx_arith_render_envelope_ivas_fx( A_ind, L_frame, L_spec, hTcxCfg->preemph_fac, gamma_w, gamma_uw, env ); -#undef WMC_TOOL_SKIP IF( use_hm != 0 ) { diff --git a/lib_enc/ivas_stereo_eclvq_enc_fx.c b/lib_enc/ivas_stereo_eclvq_enc_fx.c index bdc9be253..e4c28a12b 100644 --- a/lib_enc/ivas_stereo_eclvq_enc_fx.c +++ b/lib_enc/ivas_stereo_eclvq_enc_fx.c @@ -237,19 +237,17 @@ static Word16 code_length_from_count_fx( // Q10 Word16 c_norm; Word16 res; -#define WMC_TOOL_SKIP c_norm = norm_s( (Word16) c ); /* equivalent with 14 - floor(log_base2(c)) */ -#undef WMC_TOOL_SKIP /* compute linear approximation of log2(1 + x), for x in [0, 1], using a look-up table with 64 entries */ /* normalize to {16384, ..., 32767}, subtract MSB bit, and convert to Q6 for indexing log2_1px_table */ res = sub( shl( c_norm, 10 ), log2_1px_table[( ( c << c_norm ) - ( 1 << 14 ) + ( 1 << 7 ) ) >> 8] ); - /* |(14 - log2(c)) - res / (1 << 10)| < 0.0113, for c in {1, ..., 2 ^ 14} */ /* complexity: 1 norm_s, 2 adds, 3 shifts, 1 table lookup */ return res; } + /*--------------------------------------------------------------- * arith_encode_bit_prob() * diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index 2f9f2b7c7..010fcffe9 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -148,12 +148,7 @@ Word16 msvq_stage1_dct_search_fx( FOR( c2 = 0; c2 < cols_per_segment[segm]; c2++ ) { -#define WMC_TOOL_SKIP tmp_fx = L_sub( dct_target_fx[c2], Mpy_32_32( L_shl( cbpW8[c2], add( sub( Q31, tmp_e ), dct_col_shift_tab[c2] ) ), dct_scaleF_fx[1] ) ); /* note: BASOP shift left defined for signed integers */ - LOGIC( 1 ); - SHIFT( 1 ); - ADD( 1 ); /* in BASOP: s_and(for W8->W16), shl(), sub()*/ -#undef WMC_TOOL_SKIP mse_fx = W_mac_32_32( mse_fx, tmp_fx, tmp_fx ); /* L_mac or L_mac0() square Word16 -> Word32*/ // Q41 } Word16 L_tmp = W_norm( mse_fx ); @@ -162,9 +157,7 @@ Word16 msvq_stage1_dct_search_fx( st1_mse_ptr_e[j_full] = sub( shl( tmp_e, 1 ), L_tmp ); move16(); -#define WMC_TOOL_SKIP cbpW8 += cols_per_segment[segm]; /* fixed pointer increment for each segment */ -#undef WMC_TOOL_SKIP /* overwrite with a new worst index at p_max */ diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index b90b9deb8..7fdfa00a8 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -1095,14 +1095,9 @@ static ivas_error ivas_rend_initCrend_fx( IF( ext_rend_flag == 0 ) { /* in case of HRTF handle reuse, swap the pointers for correct deallocation at the exit */ -#define WMC_TOOL_SKIP swap( hHrtf->pIndex_frequency_max[i][j], hHrtf->pIndex_frequency_max[tmp][j], const Word16 * ); - MOVE( 3 ); swap( hHrtf->pOut_to_bin_re_fx[i][j], hHrtf->pOut_to_bin_re_fx[tmp][j], const Word16 * ); - MOVE( 3 ); swap( hHrtf->pOut_to_bin_im_fx[i][j], hHrtf->pOut_to_bin_im_fx[tmp][j], const Word16 * ); - MOVE( 3 ); -#undef WMC_TOOL_SKIP } ELSE { -- GitLab From c4cae994527523678ca8f51be7fe0d07c182a22e Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 11 Feb 2026 16:38:50 +0100 Subject: [PATCH 2/4] clang-format --- lib_enc/lsf_msvq_ma_enc_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index 010fcffe9..f690c7e1d 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -149,7 +149,7 @@ Word16 msvq_stage1_dct_search_fx( FOR( c2 = 0; c2 < cols_per_segment[segm]; c2++ ) { tmp_fx = L_sub( dct_target_fx[c2], Mpy_32_32( L_shl( cbpW8[c2], add( sub( Q31, tmp_e ), dct_col_shift_tab[c2] ) ), dct_scaleF_fx[1] ) ); /* note: BASOP shift left defined for signed integers */ - mse_fx = W_mac_32_32( mse_fx, tmp_fx, tmp_fx ); /* L_mac or L_mac0() square Word16 -> Word32*/ // Q41 + mse_fx = W_mac_32_32( mse_fx, tmp_fx, tmp_fx ); /* L_mac or L_mac0() square Word16 -> Word32*/ // Q41 } Word16 L_tmp = W_norm( mse_fx ); st1_mse_ptr_fx[j_full] = W_extract_h( W_lshl( mse_fx, L_tmp ) ); /* save MSE in shared dynamic RAM, move32() in BASOP */ // st1_mse_ptr_e -- GitLab From 8e21d4474008bb436f1164807316581d7daa99f8 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 11 Feb 2026 17:09:40 +0100 Subject: [PATCH 3/4] swap() -> SWAP() --- lib_com/lsf_msvq_ma_fx.c | 10 +----- lib_com/prot_fx.h | 14 +-------- lib_dec/lsf_msvq_ma_dec_fx.c | 10 +----- lib_enc/fd_cng_enc_fx.c | 16 +++------- lib_enc/lsf_msvq_ma_enc_fx.c | 60 ++++++------------------------------ lib_rend/ivas_crend_fx.c | 6 ++-- 6 files changed, 20 insertions(+), 96 deletions(-) diff --git a/lib_com/lsf_msvq_ma_fx.c b/lib_com/lsf_msvq_ma_fx.c index d705177fc..7a71b6145 100644 --- a/lib_com/lsf_msvq_ma_fx.c +++ b/lib_com/lsf_msvq_ma_fx.c @@ -9,15 +9,7 @@ #include "prot_fx.h" #include "basop_util.h" -#ifndef swap -#define swap( x, y, type ) \ - { \ - type u__p; \ - u__p = x; \ - x = y; \ - y = u__p; \ - } -#endif + /*---------------------------------------------------------------------* * midlsf_dec() * diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 49e042e2d..62d869efb 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -57,19 +57,7 @@ *----------------------------------------------------------------------------------*/ #ifndef SWAP -#define SWAP( a, b ) \ - { \ - tempr = ( a ); \ - ( a ) = ( b ); \ - ( b ) = tempr; \ - move32(); \ - move32(); \ - move32(); \ - } -#endif - -#ifndef swap -#define swap( x, y, type ) \ +#define SWAP( x, y, type ) \ { \ type u__p; \ u__p = x; \ diff --git a/lib_dec/lsf_msvq_ma_dec_fx.c b/lib_dec/lsf_msvq_ma_dec_fx.c index 71d57c299..968f57a42 100644 --- a/lib_dec/lsf_msvq_ma_dec_fx.c +++ b/lib_dec/lsf_msvq_ma_dec_fx.c @@ -10,15 +10,7 @@ #include "basop_util.h" #include "rom_com.h" -#ifndef swap -#define swap( x, y, type ) \ - { \ - type u__p; \ - u__p = x; \ - x = y; \ - y = u__p; \ - } -#endif + /*---------------------------------------------------------------------* * lsf_msvq_ma_decprm() * diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index 5075dd46c..2b5ebbfed 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -22,15 +22,7 @@ /******************************** * External functions * ********************************/ -#ifndef swap -#define swap( x, y, type ) \ - { \ - type u__p; \ - u__p = x; \ - x = y; \ - y = u__p; \ - } -#endif + extern void BASOP_getTables( const PWord16 **ptwiddle, const PWord16 **sin_twiddle, Word16 *psin_step, Word16 length ); /************************************* @@ -936,9 +928,9 @@ static void msvq_encoder( const Word16 *const cb[], /* i : Codebook (indexed cb cb_stage = cbp; /* Set up pointers to parent and current nodes */ - swap( indices[0], indices[1], Word16 * ); - swap( resid[0], resid[1], Word16 * ); - swap( dist[0], dist[1], Word32 * ); + SWAP( indices[0], indices[1], Word16 * ); + SWAP( resid[0], resid[1], Word16 * ); + SWAP( dist[0], dist[1], Word32 * ); /* p_max points to maximum distortion node (worst of best) */ p_max = 0; diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index f690c7e1d..96a4a1b97 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -22,15 +22,6 @@ #define kMaxC 8 #define MAXINT32 2147483647 -#ifndef swap -#define swap( x, y, type ) \ - { \ - type u__p; \ - u__p = x; \ - x = y; \ - y = u__p; \ - } -#endif #define depack_4_values( cbp, val0, val1, val2, val3 ) \ val0 = shr( ( cbp )[0], 4 ); \ @@ -760,18 +751,9 @@ void msvq_enc_fx( move16(); /* Set up pointers to parent and current nodes */ - swap( indices[0], indices[1], Word16 * ); - move16(); - move16(); - move16(); - swap( resid[0], resid[1], Word16 * ); - move16(); - move16(); - move16(); - swap( dist[0], dist[1], Word32 * ); - move32(); - move32(); - move32(); + SWAP( indices[0], indices[1], Word16 * ); + SWAP( resid[0], resid[1], Word16 * ); + SWAP( dist[0], dist[1], Word32 * ); /* p_max points to maximum distortion node (worst of best) */ p_max = 0; @@ -978,19 +960,9 @@ void msvq_enc_lsf_fx64( move16(); /* Set up pointers to parent and current nodes */ - swap( indices[0], indices[1], Word16 * ); - move16(); - move16(); - move16(); - move16(); - swap( resid[0], resid[1], Word16 * ); - move16(); - move16(); - move16(); - swap( dist_64[0], dist_64[1], Word64 * ); - move64(); - move64(); - move64(); + SWAP( indices[0], indices[1], Word16 * ); + SWAP( resid[0], resid[1], Word16 * ); + SWAP( dist_64[0], dist_64[1], Word64 * ); /* p_max points to maximum distortion node (worst of best) */ p_max = 0; @@ -1214,22 +1186,10 @@ void msvq_enc_ivas_fx( cb_stage = cbp; /* Set up pointers to parent and current nodes */ - swap( indices[0], indices[1], Word16 * ); - move16(); - move16(); - move16(); - swap( resid_fx[0], resid_fx[1], Word32 * ); - move32(); - move32(); - move32(); - swap( dist_fx[0], dist_fx[1], Word32 * ); - swap( dist_e[0], dist_e[1], Word16 * ); - move32(); - move32(); - move32(); - move16(); - move16(); - move16(); + SWAP( indices[0], indices[1], Word16 * ); + SWAP( resid_fx[0], resid_fx[1], Word32 * ); + SWAP( dist_fx[0], dist_fx[1], Word32 * ); + SWAP( dist_e[0], dist_e[1], Word16 * ); /* p_max points to maximum distortion node (worst of best) */ p_max = 0; diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 7fdfa00a8..af7c3f9f6 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -1095,9 +1095,9 @@ static ivas_error ivas_rend_initCrend_fx( IF( ext_rend_flag == 0 ) { /* in case of HRTF handle reuse, swap the pointers for correct deallocation at the exit */ - swap( hHrtf->pIndex_frequency_max[i][j], hHrtf->pIndex_frequency_max[tmp][j], const Word16 * ); - swap( hHrtf->pOut_to_bin_re_fx[i][j], hHrtf->pOut_to_bin_re_fx[tmp][j], const Word16 * ); - swap( hHrtf->pOut_to_bin_im_fx[i][j], hHrtf->pOut_to_bin_im_fx[tmp][j], const Word16 * ); + SWAP( hHrtf->pIndex_frequency_max[i][j], hHrtf->pIndex_frequency_max[tmp][j], const Word16 * ); + SWAP( hHrtf->pOut_to_bin_re_fx[i][j], hHrtf->pOut_to_bin_re_fx[tmp][j], const Word16 * ); + SWAP( hHrtf->pOut_to_bin_im_fx[i][j], hHrtf->pOut_to_bin_im_fx[tmp][j], const Word16 * ); } ELSE { -- GitLab From 7c55b1736b7ae28130226f9a2fb103a5efb04e6d Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 11 Feb 2026 17:17:12 +0100 Subject: [PATCH 4/4] swap() -> SWAP() --- lib_com/bits_alloc_fx.c | 6 ++---- lib_enc/ivas_pca_enc_fx.c | 14 ++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index 1045f7495..ea9f59f64 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -563,14 +563,12 @@ static ivas_error acelp_FCB_allocator_fx( /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */ IF( GE_16( tc_subfr, L_SUBFR ) ) { - Word16 tempr; - - SWAP( fixed_cdk_index[0], fixed_cdk_index[tc_subfr / L_SUBFR] ); + SWAP( fixed_cdk_index[0], fixed_cdk_index[tc_subfr / L_SUBFR], Word16 ); /* TRANSITION coding: allocate second highest FCBQ bit-budget to the last subframe */ IF( LT_16( idiv1616( tc_subfr, L_SUBFR ), sub( nb_subfr, 1 ) ) ) { - SWAP( fixed_cdk_index[sub( tc_subfr, L_SUBFR ) / L_SUBFR], fixed_cdk_index[nb_subfr - 1] ); + SWAP( fixed_cdk_index[sub( tc_subfr, L_SUBFR ) / L_SUBFR], fixed_cdk_index[nb_subfr - 1], Word16 ); } } diff --git a/lib_enc/ivas_pca_enc_fx.c b/lib_enc/ivas_pca_enc_fx.c index 7228d134e..ea6f40d86 100644 --- a/lib_enc/ivas_pca_enc_fx.c +++ b/lib_enc/ivas_pca_enc_fx.c @@ -202,40 +202,38 @@ static void sort4_D_eigVec_fx( Word32 *eigVec // Q31 ) { - Word32 tempr; - IF( LT_32( D[0], D[1] ) ) { - SWAP( D[0], D[1] ); + SWAP( D[0], D[1], Word32 ); swap_eigvec_fx( eigVec, 0, 1 ); } IF( LT_32( D[2], D[3] ) ) { - SWAP( D[2], D[3] ); + SWAP( D[2], D[3], Word32 ); swap_eigvec_fx( eigVec, 2, 3 ); } IF( LT_32( D[0], D[2] ) ) { - SWAP( D[0], D[2] ); + SWAP( D[0], D[2], Word32 ); swap_eigvec_fx( eigVec, 0, 2 ); } IF( LT_32( D[1], D[3] ) ) { - SWAP( D[1], D[3] ); + SWAP( D[1], D[3], Word32 ); swap_eigvec_fx( eigVec, 1, 3 ); } IF( LT_32( D[1], D[2] ) ) { - SWAP( D[1], D[2] ); + SWAP( D[1], D[2], Word32 ); swap_eigvec_fx( eigVec, 1, 2 ); } /* swap last 2 values */ - SWAP( D[2], D[3] ); + SWAP( D[2], D[3], Word32 ); swap_eigvec_fx( eigVec, 2, 3 ); return; -- GitLab