From 4c79857df7de851660da36159309163ab0b0c98d Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Mar 2026 20:28:55 +0100 Subject: [PATCH 1/7] replace lowe-case macros by upper-case ones --- lib_com/bitstream_fx.c | 19 ++++++----- lib_com/fd_cng_com_fx.c | 4 +-- lib_com/ivas_mc_com_fx.c | 2 +- lib_com/longarith.c | 36 +++++++++++--------- lib_com/parameter_bitmaping_fx.c | 19 ++++++----- lib_com/tcx_ltp_fx.c | 7 ++-- lib_com/tools_fx.c | 32 ++++++++--------- lib_dec/core_switching_dec_fx.c | 2 +- lib_dec/gain_dec_fx.c | 6 +++- lib_dec/gs_dec_fx.c | 2 +- lib_dec/ivas_dirac_output_synthesis_cov_fx.c | 2 +- lib_dec/ivas_init_dec_fx.c | 9 +++-- lib_dec/ivas_mc_param_dec_fx.c | 2 +- lib_dec/ivas_omasa_dec_fx.c | 2 +- lib_dec/ivas_spar_md_dec_fx.c | 2 +- lib_dec/lib_dec_fx.c | 2 +- lib_dec/lsf_dec_fx.c | 4 +-- lib_enc/acelp_core_switch_enc_fx.c | 2 +- lib_enc/cod_tcx_fx.c | 2 +- lib_enc/core_enc_ol_fx.c | 5 ++- lib_enc/ext_sig_ana_fx.c | 8 ++--- lib_enc/fd_cng_enc_fx.c | 2 +- lib_enc/igf_enc_fx.c | 6 ++-- lib_enc/ivas_front_vad_fx.c | 2 +- lib_enc/ivas_ism_param_enc_fx.c | 2 +- lib_enc/ivas_mc_paramupmix_enc_fx.c | 6 ++-- lib_enc/ivas_sns_enc_fx.c | 14 ++++---- lib_enc/ivas_stereo_ica_enc_fx.c | 9 +++-- lib_enc/ivas_stereo_mdct_igf_enc_fx.c | 6 ++-- lib_enc/swb_tbe_enc_fx.c | 2 +- lib_enc/tcx_ltp_enc_fx.c | 2 +- lib_enc/tcx_utils_enc_fx.c | 2 +- lib_rend/ivas_crend_fx.c | 10 +++--- lib_rend/ivas_dirac_decorr_dec_fx.c | 2 +- lib_rend/ivas_hrtf_fx.c | 4 +-- lib_rend/ivas_masa_merge_fx.c | 2 +- lib_rend/ivas_mcmasa_ana_fx.c | 2 +- lib_rend/ivas_td_ring_buffer_fx.c | 4 +-- lib_rend/lib_rend_fx.c | 16 ++++----- 39 files changed, 141 insertions(+), 121 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 634659c7f..dc3cd54fc 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -242,7 +242,7 @@ static Word16 rate2AMRWB_IOmode( case ACELP_23k85: return AMRWB_IO_2385; default: - break; + BREAK; } return -1; @@ -298,7 +298,7 @@ Word16 rate2EVSmode( case HQ_128k: return PRIMARY_128000; default: - break; + BREAK; } if ( is_amr_wb != NULL ) @@ -3206,12 +3206,15 @@ Word16 find_indice( { Word16 i; - for ( i = 0; i < hBstr->nb_ind_tot; i++ ) + FOR( i = 0; i < hBstr->nb_ind_tot; i++ ) { - if ( hBstr->ind_list[i].id == id && hBstr->ind_list[i].nb_bits > 0 ) + test(); + IF( EQ_16( hBstr->ind_list[i].id, id ) && hBstr->ind_list[i].nb_bits > 0 ) { *value = hBstr->ind_list[i].value; *nb_bits = hBstr->ind_list[i].nb_bits; + move16(); + move16 (); return i; } } @@ -3949,13 +3952,13 @@ static void decoder_selectCodec( case 2800: st->codec_mode = MODE1; move16(); - break; + BREAK; default: /* validate that total_brate (derived from RTP packet or a file header) is one of the defined bitrates */ st->codec_mode = st->last_codec_mode; move16(); st->bfi = 1; move16(); - break; + BREAK; } } } @@ -4417,7 +4420,7 @@ void ivas_set_bitstream_pointers( num_bits = 0; /* set bitstream pointers for SCEs */ - for ( k = 0; k < st_ivas->nSCE; k++ ) + FOR( k = 0; k < st_ivas->nSCE; k++ ) { sts = st_ivas->hSCE[k]->hCoreCoder; sts[0]->bit_stream = st_ivas->bit_stream + num_bits; @@ -4425,7 +4428,7 @@ void ivas_set_bitstream_pointers( } /* set bitstream pointers for CPEs */ - for ( k = 0; k < st_ivas->nCPE; k++ ) + FOR( k = 0; k < st_ivas->nCPE; k++ ) { sts = st_ivas->hCPE[k]->hCoreCoder; sts[0]->bit_stream = st_ivas->bit_stream + num_bits; diff --git a/lib_com/fd_cng_com_fx.c b/lib_com/fd_cng_com_fx.c index 4677016f8..3dfe624dc 100644 --- a/lib_com/fd_cng_com_fx.c +++ b/lib_com/fd_cng_com_fx.c @@ -3259,11 +3259,11 @@ void SynthesisSTFT_dirac_fx( case 640: fftScale = FFT_SCALING_640; move32(); - break; + BREAK; case 512: fftScale = FFT_SCALING_512; move32(); - break; + BREAK; default: assert( !"Not supported FFT length!" ); } diff --git a/lib_com/ivas_mc_com_fx.c b/lib_com/ivas_mc_com_fx.c index ffb526554..054143684 100644 --- a/lib_com/ivas_mc_com_fx.c +++ b/lib_com/ivas_mc_com_fx.c @@ -153,7 +153,7 @@ Word16 ivas_mc_ls_setup_get_num_channels_fx( case MC_LS_SETUP_7_1: nchan = 8; move16(); - break; + BREAK; case MC_LS_SETUP_5_1_2: nchan = 8; move16(); diff --git a/lib_com/longarith.c b/lib_com/longarith.c index 193c358cb..bd50768e6 100644 --- a/lib_com/longarith.c +++ b/lib_com/longarith.c @@ -62,18 +62,18 @@ void longadd( Word32 carry = 0; assert( lena >= lenb ); - for ( h = 0; h < lenb; h++ ) + FOR( h = 0; h < lenb; h++ ) { carry += ( (UWord32) a[h] ) + ( (UWord32) b[h] ); a[h] = (UWord16) carry; - carry = carry >> 16; + carry = L_shr(carry, 16); } - for ( ; h < lena; h++ ) + FOR( ; h < lena; h++ ) { carry = ( (UWord32) a[h] ) + carry; a[h] = (UWord16) carry; - carry = carry >> 16; + carry = L_shr(carry, 16); } assert( carry == 0 ); /* carry != 0 indicates addition overflow */ @@ -106,26 +106,26 @@ void longshiftright( lena -= intb; fracb = b & 0xF; - if ( fracb ) + IF( fracb ) { fracb_u = 16 - fracb; - for ( k = 0; k < lena - 1; k++ ) + FOR( k = 0; k < lena - 1; k++ ) { d[k] = ( ( a[k] >> fracb ) | ( a[k + 1] << fracb_u ) ) & 0xFFFF; } d[k] = ( a[k] >> fracb ); k++; } - else + ELSE { - for ( k = 0; k < lena; k++ ) + FOR( k = 0; k < lena; k++ ) { d[k] = a[k]; } } /* fill remaining upper bits with zero */ - for ( ; k < lend; k++ ) + FOR( ; k < lend; k++ ) { d[k] = 0; } @@ -175,30 +175,32 @@ void longshiftleft( Word16 fracb_l; /* shift right value for all lower words a[k-1] */ Word16 k = len - 1; - intb = b >> 4; + intb = shr(b, 4); fracb = b & 0xF; - if ( fracb ) + IF( fracb ) { fracb_l = 16 - fracb; - for ( ; k > intb; k-- ) + FOR( ; k > intb; k-- ) { - d[k] = ( a[k - intb] << fracb ) | ( a[k - intb - 1] >> fracb_l ); + d[k] = ( shl(a[k - intb], fracb) ) | ( shr(a[k - intb - 1], fracb_l) ); } - d[k] = ( a[k - intb] << fracb ); + d[k] = shl( a[k - intb], fracb ); k--; } - else + ELSE { - for ( ; k >= intb; k-- ) + FOR( ; k >= intb; k-- ) { d[k] = a[k - intb]; + move16(); } } - for ( ; k >= 0; k-- ) + FOR( ; k >= 0; k-- ) { d[k] = 0; + move16(); } return; diff --git a/lib_com/parameter_bitmaping_fx.c b/lib_com/parameter_bitmaping_fx.c index 8a9ac872a..8ce98f66e 100644 --- a/lib_com/parameter_bitmaping_fx.c +++ b/lib_com/parameter_bitmaping_fx.c @@ -54,9 +54,9 @@ void GetParameters( assert( ( paramsBitMap != NULL ) && ( nArrayLength > 0 ) && ( pParameter != NULL ) && ( pStream != NULL ) && ( pnSize != NULL ) && ( pnBits != NULL ) ); nParams = paramsBitMap->nParams; - for ( index = 0; index < nArrayLength; index++ ) + FOR( index = 0; index < nArrayLength; index++ ) { - for ( iParam = 0; iParam < nParams; iParam++ ) + FOR( iParam = 0; iParam < nParams; iParam++ ) { ParamBitMap const *const param = ¶msBitMap->params[iParam]; @@ -64,11 +64,12 @@ void GetParameters( pSubStruct = param->GetParamValue( pParameter, index, &value ); #undef WMC_TOOL_SKIP /* If a function for encoding/decoding value is defined than it should take care of 0 */ - if ( param->fZeroAllowed || ( param->EncodeValue != NULL ) ) + test(); + IF ( param->fZeroAllowed || ( param->EncodeValue != NULL ) ) { *( *pStream )++ = value; } - else + ELSE { *( *pStream )++ = value - 1; } @@ -76,7 +77,8 @@ void GetParameters( #define WMC_TOOL_SKIP *pnBits += ( param->nBits != 0 ) ? param->nBits : param->GetNumberOfBits( value, index ); #undef WMC_TOOL_SKIP - if ( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) + test(); + IF ( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) { GetParameters( param->pSubParamBitMap, value, ( pSubStruct != NULL ) ? pSubStruct : pParameter, pStream, pnSize, pnBits ); } @@ -163,9 +165,9 @@ void SetParameters( assert( ( paramsBitMap != NULL ) && ( nArrayLength > 0 ) && ( pParameter != NULL ) && ( pStream != NULL ) && ( pnSize != NULL ) ); nParams = paramsBitMap->nParams; - for ( index = 0; index < nArrayLength; index++ ) + FOR( index = 0; index < nArrayLength; index++ ) { - for ( iParam = 0; iParam < nParams; iParam++ ) + FOR( iParam = 0; iParam < nParams; iParam++ ) { ParamBitMap const *const param = ¶msBitMap->params[iParam]; /* If a function for encoding/decoding value is defined than it should take care of 0 */ @@ -175,7 +177,8 @@ void SetParameters( pSubStruct = param->SetParamValue( pParameter, index, value ); #undef WMC_TOOL_SKIP ++*pnSize; - if ( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) + test(); + IF( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) { SetParameters( param->pSubParamBitMap, value, ( pSubStruct != NULL ) ? pSubStruct : pParameter, pStream, pnSize ); } diff --git a/lib_com/tcx_ltp_fx.c b/lib_com/tcx_ltp_fx.c index 71fd2b655..ebe14f5f3 100644 --- a/lib_com/tcx_ltp_fx.c +++ b/lib_com/tcx_ltp_fx.c @@ -1033,17 +1033,20 @@ static void tcx_ltp_synth_filter_01( move16(); gain_step = idiv1616( gain, length ); // TODO - for ( j = 0; j < length; j++ ) + FOR( j = 0; j < length; j++ ) { s = 0; move16(); s2 = 0; move16(); - for ( i = 0, k = 0; i < L; i++, k = k + pitch_res ) + k = 0; + move16(); + FOR( i = 0; i < L; i++ ) { s = L_mac_sat( L_mac_sat( s, w0[k], x0[i] ), w1[k], x1[-i] ); /* Qx */ s2 = L_mac_sat( L_mac_sat( s2, v0[k], y0[i] ), v1[k], y1[-i] ); /* Qx */ + k = add( k, pitch_res ); } out[j] = add_sat( in[j], mult_r_sat( curr_gain, sub_sat( round_fx_sat( s ), mult_r_sat( round_fx_sat( s2 ), ALPHA ) ) ) ); /* Qx */ diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 47111db3e..5cd0296d7 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -88,7 +88,7 @@ Word16 sum_s( Word16 tmp; tmp = 0; - for ( i = 0; i < lvec; i++ ) + FOR( i = 0; i < lvec; i++ ) { tmp += vec[i]; } @@ -291,7 +291,7 @@ void set_c( { Word16 i; - for ( i = 0; i < N; i++ ) + FOR( i = 0; i < N; i++ ) { y[i] = a; } @@ -308,7 +308,7 @@ void set_s( { Word16 i; - for ( i = 0; i < N; i++ ) + FOR( i = 0; i < N; i++ ) { y[i] = a; } @@ -325,7 +325,7 @@ void set_l( { Word16 i; - for ( i = 0; i < N; i++ ) + FOR( i = 0; i < N; i++ ) { y[i] = a; } @@ -342,22 +342,22 @@ void mvs2s( { Word16 i; - if ( n <= 0 ) + IF( n <= 0 ) { /* cannot transfer vectors with size 0 */ return; } - if ( y < x ) + IF( y < x ) { - for ( i = 0; i < n; i++ ) + FOR( i = 0; i < n; i++ ) { y[i] = x[i]; } } - else + ELSE { - for ( i = n - 1; i >= 0; i-- ) + FOR( i = n - 1; i >= 0; i-- ) { y[i] = x[i]; } @@ -374,22 +374,22 @@ void mvl2l( { Word16 i; - if ( n <= 0 ) + IF( n <= 0 ) { /* no need to transfer vectors with size 0 */ return; } - if ( y < x ) + IF( y < x ) { - for ( i = 0; i < n; i++ ) + FOR( i = 0; i < n; i++ ) { y[i] = x[i]; } } - else + ELSE { - for ( i = n - 1; i >= 0; i-- ) + FOR( i = n - 1; i >= 0; i-- ) { y[i] = x[i]; } @@ -3713,7 +3713,7 @@ void v_L_mult_1616( { Word16 i; - for ( i = 0; i < N; i++ ) + FOR( i = 0; i < N; i++ ) { y[i] = L_mult( x1[i], x2[i] ); move32(); @@ -3737,7 +3737,7 @@ void v_L_mult_3216( { Word16 i; - for ( i = 0; i < N; i++ ) + FOR( i = 0; i < N; i++ ) { y[i] = Mpy_32_16_1( x1[i], x2[i] ); move32(); diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 001cfa975..7dcb25dcb 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -338,7 +338,7 @@ ivas_error core_switching_post_dec_fx( { NonZero = 0; move16(); - break; + BREAK; } } test(); diff --git a/lib_dec/gain_dec_fx.c b/lib_dec/gain_dec_fx.c index 551e04205..888ec0e52 100644 --- a/lib_dec/gain_dec_fx.c +++ b/lib_dec/gain_dec_fx.c @@ -49,7 +49,7 @@ void Es_pred_dec_fx( BREAK; case 3: *Es_pred = Es_pred_qua_3b_fx[enr_idx]; /*Q8*/ - break; + BREAK; default: *Es_pred = Es_pred_qua_5b_fx[enr_idx]; /*Q8*/ move16(); @@ -61,7 +61,11 @@ void Es_pred_dec_fx( *Es_pred = Es_pred_qua_4b_no_ltp_fx[enr_idx]; /*Q8*/ move16(); } + + return; } + + /*======================================================================================*/ /* FUNCTION : void gain_dec_tc_fx () */ /*--------------------------------------------------------------------------------------*/ diff --git a/lib_dec/gs_dec_fx.c b/lib_dec/gs_dec_fx.c index d867298d1..917e966d3 100644 --- a/lib_dec/gs_dec_fx.c +++ b/lib_dec/gs_dec_fx.c @@ -651,7 +651,7 @@ void gsc_dec_fx( { if ( LE_32( st_fx->core_brate, brate_intermed_tbl[i] ) ) { - break; + BREAK; } i++; } diff --git a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c index 358d5eba6..86035f089 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c @@ -651,7 +651,7 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( temp_imag = 0; move64(); move64(); - for ( i = 0; i < nX; i++ ) + FOR( i = 0; i < nX; i++ ) { temp_real = W_add( temp_real, W_mult0_32_32( mixing_matrix_smooth_fx[idx], input_f_real_fx[i] ) ); temp_imag = W_add( temp_imag, W_mult0_32_32( mixing_matrix_smooth_fx[idx], input_f_imag_fx[i] ) ); diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 01cc0f717..610a5a4f8 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -3320,7 +3320,7 @@ void ivas_initialize_handles_dec( /* rendering handles */ st_ivas->hBinRenderer = NULL; - for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + FOR ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { st_ivas->hDiracDecBin[i] = NULL; } @@ -3353,7 +3353,7 @@ void ivas_initialize_handles_dec( st_ivas->pAcousticEnvironments = NULL; st_ivas->hSplitBinRend = NULL; - for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { st_ivas->hTdRendHandles[i] = NULL; } @@ -3491,9 +3491,9 @@ void ivas_destroy_dec_fx( ivas_binRenderer_close_fx( &st_ivas->hBinRenderer ); /* TD binaural renderer handles */ - for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { - if ( st_ivas->hTdRendHandles[i] != NULL ) + IF ( st_ivas->hTdRendHandles[i] != NULL ) { st_ivas->hTdRendHandles[i]->HrFiltSet_p = NULL; ivas_td_binaural_close_fx( &st_ivas->hTdRendHandles[i] ); @@ -3544,7 +3544,6 @@ void ivas_destroy_dec_fx( /* CRend binaural renderer handle */ ivas_HRTF_CRend_binary_close_fx( &st_ivas->hHrtfCrend ); - /* Fastconv HRTF filters */ ivas_HRTF_fastconv_binary_close_fx( &st_ivas->hHrtfFastConv ); diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index b929e3a98..a11feddf1 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -440,7 +440,7 @@ ivas_error ivas_param_mc_dec_open_fx( max_param_band_residual = k; move16(); assert( hParamMC->band_grouping[k] == hParamMC->max_band_decorr ); - break; + BREAK; } } diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 3e7664bd7..c21477d9d 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -1803,7 +1803,7 @@ void ivas_omasa_render_objects_from_mix_fx( } /* Create prototype signals */ - for ( n = 0; n < nchan_ism; n++ ) + FOR( n = 0; n < nchan_ism; n++ ) { Word32 panning_gains_fx[2]; Word16 new_panning_gains_fx[2]; diff --git a/lib_dec/ivas_spar_md_dec_fx.c b/lib_dec/ivas_spar_md_dec_fx.c index 9bce073cd..54fc60583 100644 --- a/lib_dec/ivas_spar_md_dec_fx.c +++ b/lib_dec/ivas_spar_md_dec_fx.c @@ -2018,7 +2018,7 @@ static void ivas_decode_arith_bs( { any_diff = 1; move16(); - break; + BREAK; } } diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 0dd016b9d..f79e5f233 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2601,7 +2601,7 @@ ivas_error IVAS_DEC_AddAcousticEnvironment( { move32(); pAE = &st_ivas->pAcousticEnvironments[n]; - break; + BREAK; } } diff --git a/lib_dec/lsf_dec_fx.c b/lib_dec/lsf_dec_fx.c index 32c8c9958..b44441aaa 100644 --- a/lib_dec/lsf_dec_fx.c +++ b/lib_dec/lsf_dec_fx.c @@ -867,7 +867,7 @@ void lsf_mid_dec_fx( case 1: { ratio = tbl_mid_voi_wb_1b_fx; /* Q13 */ - break; + BREAK; } } } @@ -888,7 +888,7 @@ void lsf_mid_dec_fx( case 4: { ratio = tbl_mid_gen_wb_4b_fx; /* Q13 */ - break; + BREAK; } case 2: { diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index b4c10b9ac..89df6423c 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -139,7 +139,7 @@ void acelp_core_switch_enc_fx( #ifdef DEBUGGING assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" ); #endif - while ( hBstr->ind_list[i].id == TAG_ACELP_SUBFR_LOOP_START ) + WHILE( EQ_16( hBstr->ind_list[i].id, TAG_ACELP_SUBFR_LOOP_START ) ) { push_indice( hBstr, IND_CORE_SWITCHING_CELP_SUBFRAME, hBstr->ind_list[i].value, hBstr->ind_list[i].nb_bits ); i++; diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index aff171740..6492e15c1 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -3196,7 +3196,7 @@ void QuantizeTCXSpectrum_fx( { IF( st->element_mode > EVS_MONO ) { - break; + BREAK; } ELSE { diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index a347b086a..0c4af1a3d 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -1498,8 +1498,7 @@ static void BITS_ALLOC_ACELP_config_rf( case RF_GENPRED: /* Es_pred bits 3 bits, LTF: 0, pitch: 8,0,8,0, FCB: 6,7,5,5, gain: 5,0,5,0, Diff GFr: 0*/ /*bits += (3 + 0 + 16 + 23 + 10 + 0); */ /* 72 rf bits */ - *rf_target_bits += ( ACELP_NRG_BITS[nrgMode] + ACELP_LTF_BITS[ltfMode] + ACELP_LTP_BITS_SFR[ltpMode][0] + ACELP_LTP_BITS_SFR[ltpMode][1] + ACELP_LTP_BITS_SFR[ltpMode][2] + ACELP_LTP_BITS_SFR[ltpMode][3] + 14 + ACELP_GAINS_BITS[gainsMode] + ACELP_GAINS_BITS[gainsMode] + 2 /*2 bits for PartialCopy GainFrame*/ - ); + *rf_target_bits += ( ACELP_NRG_BITS[nrgMode] + ACELP_LTF_BITS[ltfMode] + ACELP_LTP_BITS_SFR[ltpMode][0] + ACELP_LTP_BITS_SFR[ltpMode][1] + ACELP_LTP_BITS_SFR[ltpMode][2] + ACELP_LTP_BITS_SFR[ltpMode][3] + 14 + ACELP_GAINS_BITS[gainsMode] + ACELP_GAINS_BITS[gainsMode] + 2 /*2 bits for PartialCopy GainFrame*/); move16(); BREAK; @@ -1517,7 +1516,7 @@ static void BITS_ALLOC_ACELP_config_rf( default: assert( !"RF_Frame_type does not belong to ACELP Partial copy frame types possible!" ); - break; + BREAK; } return; diff --git a/lib_enc/ext_sig_ana_fx.c b/lib_enc/ext_sig_ana_fx.c index d7f64c4bc..9aa5c8d08 100644 --- a/lib_enc/ext_sig_ana_fx.c +++ b/lib_enc/ext_sig_ana_fx.c @@ -579,18 +579,18 @@ void core_signal_analysis_high_bitrate_ivas_fx( * TCX-LTP *---------------------------------------------------------------*/ - if ( EQ_16( st->element_mode, IVAS_CPE_DFT ) ) + IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) ) { - if ( st->element_mode > EVS_MONO ) + IF( st->element_mode > EVS_MONO ) { wspeech_fx = st->buf_wspeech_enc + st->L_frame + L_SUBFR; } - else + ELSE { wspeech_fx = st->buf_wspeech_enc + st->L_frame + idiv1616( st->L_frame, st->nb_subfr ); } } - else if ( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) + ELSE IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) { speech_fx = st->buf_speech_enc + st->encoderPastSamples_enc; speech_ltp_fx = st->hTcxEnc->buf_speech_ltp + st->encoderPastSamples_enc; diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index f3ece9b26..b7fed0e62 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -2979,7 +2979,7 @@ void FdCngEncodeMDCTStereoSID_fx( size_value = BASOP_Util_Divide1616_Scale( sizeof( tmpRAM_fx ), ( sizeof( Word32 ) ), &temp_e ); /*Q15*/ size_value = shr( size_value, sub( 15, temp_e ) ); create_IDCT_N_Matrix_fx( invTrfMatrix_fx, N, FDCNG_VQ_DCT_MAXTRUNC, size_value ); // Q31 /*WB: create truncated IDCT21 matrix */ - for ( ch = 0; ch < CPE_CHANNELS; ch++ ) + FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { /* run DCT_N N==21 , truncated at 18/21 ~= 86% , i.e use a bit better better quality in extrapolation , than subsequent DCT24 analysis which is truncated at 75%*/ /* truncated DCT 21 analysis */ diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index 84abf47be..95c7bcb3f 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -2157,9 +2157,9 @@ static void IGF_Whitening( case IGF_BITRATE_FB_32000: hPrivateData->igfCurrWhiteningLevel[hGrid->nTiles - 1] = hPrivateData->igfCurrWhiteningLevel[hGrid->nTiles - 2]; move16(); - break; + BREAK; default: - break; + BREAK; } } ELSE @@ -2227,7 +2227,7 @@ static void IGF_Whitening( } ELSE { - break; + BREAK; } } test(); diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index e4506609f..ddc01634e 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -159,7 +159,7 @@ ivas_error front_vad_fx( test(); IF( sts[0]->Opt_DTX_ON && hFrontVads[0] == NULL ) { - for ( n = 0; n < n_chan; n++ ) + FOR( n = 0; n < n_chan; n++ ) { *front_create_flag = 1; move16(); diff --git a/lib_enc/ivas_ism_param_enc_fx.c b/lib_enc/ivas_ism_param_enc_fx.c index 62a88ed99..5ec986ec7 100644 --- a/lib_enc/ivas_ism_param_enc_fx.c +++ b/lib_enc/ivas_ism_param_enc_fx.c @@ -187,7 +187,7 @@ static void ivas_param_ism_compute_obj_parameters_fx( { hParamIsm->flag_equal_energy = s_and( hParamIsm->flag_equal_energy, 0 ); move16(); - break; + BREAK; } } } diff --git a/lib_enc/ivas_mc_paramupmix_enc_fx.c b/lib_enc/ivas_mc_paramupmix_enc_fx.c index 2776799ed..ffead3327 100644 --- a/lib_enc/ivas_mc_paramupmix_enc_fx.c +++ b/lib_enc/ivas_mc_paramupmix_enc_fx.c @@ -170,7 +170,7 @@ ivas_error ivas_mc_paramupmix_enc_open_fx( move16(); st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; move16(); - break; + BREAK; } /* Transient Detector handle */ @@ -372,7 +372,7 @@ static void get_huff_table_fx( move16(); df->length = huff_alpha_table.df.length; move16(); - break; + BREAK; case BETA: df0->value = huff_beta_table.df0.value; move16(); @@ -382,7 +382,7 @@ static void get_huff_table_fx( move16(); df->length = huff_beta_table.df.length; move16(); - break; + BREAK; } return; diff --git a/lib_enc/ivas_sns_enc_fx.c b/lib_enc/ivas_sns_enc_fx.c index 01ff6b24e..7c10978d3 100644 --- a/lib_enc/ivas_sns_enc_fx.c +++ b/lib_enc/ivas_sns_enc_fx.c @@ -70,13 +70,13 @@ static Word16 sns_1st_cod_fx( { case L_FRAME16k: means = &sns_1st_means_16k[core - 1][0]; // Q14 - break; + BREAK; case L_FRAME25_6k: means = &sns_1st_means_25k6[core - 1][0]; // Q14 - break; + BREAK; case L_FRAME32k: means = &sns_1st_means_32k[core - 1][0]; // Q14 - break; + BREAK; default: assert( !"illegal frame length in sns_1st_cod" ); } @@ -167,13 +167,13 @@ static Word16 sns_1st_cod_fx( { case L_FRAME16k: means = &sns_1st_means_16k[core - 1][0]; - break; + BREAK; case L_FRAME25_6k: means = &sns_1st_means_25k6[core - 1][0]; - break; + BREAK; case L_FRAME32k: means = &sns_1st_means_32k[core - 1][0]; - break; + BREAK; default: assert( !"illegal frame length in sns_1st_cod" ); } @@ -556,7 +556,7 @@ void sns_avq_cod_stereo_fx( { flag_zero = 0; move16(); - break; + BREAK; } } if ( flag_zero ) diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index b6ab26c5a..234652072 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -1024,10 +1024,12 @@ static void corrStatsEst_fx( reg_prv_corr_exp = add( reg_prv_corr_exp, 1 ); Word16 x = TRUNC_FX( reg_prv_corr_fx, reg_prv_corr_exp ); /* Q0 */ move16(); - for ( i = 0, j = ( L_NCSHIFT_DS - x ); i < 2 * L_NCSHIFT_DS + 1; i++, j++ ) + j = sub( L_NCSHIFT_DS, x ); + FOR( i = 0; i < 2 * L_NCSHIFT_DS + 1; i++ ) { corrEst_fx[i] = Mpy_32_16_1( corrEst_fx[i], loc_weight_win_fx[j] ); /* Q31-corrEst_exp */ move32(); + j = add( j, 1 ); } test(); test(); @@ -1154,7 +1156,9 @@ static void corrStatsEst_fx( interpMax = s_min( sub( dsFactor, 1 ), sub( i_mult( L_NCSHIFT_DS, dsFactor ), corrLagStats[1] ) ); interpLen = add( sub( interpMax, interpMin ), 1 ); - for ( i = interpMin, k = 0; i <= interpMax; i++, k++ ) + k = 0; + move16(); + FOR( i = interpMin; i <= interpMax; i++ ) { rInterp_fx[k] = 0; move32(); @@ -1187,6 +1191,7 @@ static void corrStatsEst_fx( } } } + k = add( k, 1 ); } temp = rInterp_exp[0]; move16(); diff --git a/lib_enc/ivas_stereo_mdct_igf_enc_fx.c b/lib_enc/ivas_stereo_mdct_igf_enc_fx.c index 397d72c32..e2c5303f7 100644 --- a/lib_enc/ivas_stereo_mdct_igf_enc_fx.c +++ b/lib_enc/ivas_stereo_mdct_igf_enc_fx.c @@ -234,17 +234,17 @@ static void IGF_MsStereoDecision_fx( numMsMaskFalse = add( numMsMaskFalse, 1 ); /* Q0 */ msMaskFalseSomewhere = 1; move16(); - break; + BREAK; case IGF_PATCH_MS: msMask[sfb] = 1; move16(); numMsMaskTrue = add( numMsMaskTrue, 1 ); /* Q0 */ msMaskTrueSomewhere = 1; move16(); - break; + BREAK; default: assert( 0 ); - break; + BREAK; } } } diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index 6cb93e941..d5a2ba063 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -1580,7 +1580,7 @@ void swb_tbe_enc_fx( IF( LT_16( norm_s( lpc_shb_fx[i] ), lpc_shb_fx0_req_shift ) ) { flag_sat = 1; - break; + BREAK; } } } diff --git a/lib_enc/tcx_ltp_enc_fx.c b/lib_enc/tcx_ltp_enc_fx.c index 697d9f40f..9f481bbd1 100644 --- a/lib_enc/tcx_ltp_enc_fx.c +++ b/lib_enc/tcx_ltp_enc_fx.c @@ -397,7 +397,7 @@ static void tcx_ltp_pitch_search_ivas_fx( { *border_case = 1; move16(); - break; + BREAK; } } } diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index d38d2efd4..622d5ad54 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -1954,7 +1954,7 @@ Word16 tcx_scalar_quantization_rateloop_ivas_fx( } ELSE { - break; /* we cannot go any lower anyway*/ + BREAK; /* we cannot go any lower anyway*/ } } ELSE /* tcxRateLoopOpt != 2 */ diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index e3e2a306b..4e5b68863 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -1110,14 +1110,16 @@ static ivas_error ivas_rend_initCrend_fx( } hHrtf->same_inv_diffuse_weight = 1; - for ( i = 0; i < hHrtf->max_num_ir; i++ ) + move16(); + FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + IF( EQ_16(outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { - if ( hHrtf->inv_diffuse_weight_fx[0][i] != hHrtf->inv_diffuse_weight_fx[1][i] ) + if ( NE_16( hHrtf->inv_diffuse_weight_fx[0][i], hHrtf->inv_diffuse_weight_fx[1][i] ) ) { hHrtf->same_inv_diffuse_weight = 0; - break; + move16(); + BREAK; } } } diff --git a/lib_rend/ivas_dirac_decorr_dec_fx.c b/lib_rend/ivas_dirac_decorr_dec_fx.c index bd5585c08..792ac76de 100644 --- a/lib_rend/ivas_dirac_decorr_dec_fx.c +++ b/lib_rend/ivas_dirac_decorr_dec_fx.c @@ -229,7 +229,7 @@ ivas_error ivas_dirac_dec_decorr_open_fx( { split_frequencies_bands[k] = shl( freq_domain_decorr_ap_params->max_band_decorr, Q8 ); // Q8 move16(); - break; + BREAK; } } diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 10a21dd7d..1775c11f4 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -123,14 +123,14 @@ void ivas_HRTF_td_binary_close_fx( free( ( *hHrtfTD )->ModelParams.elevBsStart_dyn ); free( ( *hHrtfTD )->ModelParams.elevBsShape_dyn_fx ); - for ( i = 0; i < ( *hHrtfTD )->ModelParams.num_unique_azim_splines; i++ ) + FOR( i = 0; i < ( *hHrtfTD )->ModelParams.num_unique_azim_splines; i++ ) { free( ( *hHrtfTD )->ModelParams.azimBsShape_dyn_fx[i] ); } free( ( *hHrtfTD )->ModelParams.azimBsShape_dyn_fx ); free( (void *) ( *hHrtfTD )->ModelParams.azimBsShape_fx ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ - for ( i = 0; i < ( *hHrtfTD )->ModelParams.elevDim3; i++ ) + FOR( i = 0; i < ( *hHrtfTD )->ModelParams.elevDim3; i++ ) { free( ( *hHrtfTD )->ModelParams.azimKSeq_fx[i] ); } diff --git a/lib_rend/ivas_masa_merge_fx.c b/lib_rend/ivas_masa_merge_fx.c index b645be551..ee1480f06 100644 --- a/lib_rend/ivas_masa_merge_fx.c +++ b/lib_rend/ivas_masa_merge_fx.c @@ -513,7 +513,7 @@ ivas_error masaPrerendOpen_fx( move16(); hMasaPrerend->nbands = i; move16(); - break; + BREAK; } } diff --git a/lib_rend/ivas_mcmasa_ana_fx.c b/lib_rend/ivas_mcmasa_ana_fx.c index 8f4149171..baf121956 100644 --- a/lib_rend/ivas_mcmasa_ana_fx.c +++ b/lib_rend/ivas_mcmasa_ana_fx.c @@ -209,7 +209,7 @@ ivas_error ivas_mcmasa_ana_open( move16(); hMcMasa->nbands = i; move16(); - break; + BREAK; } } diff --git a/lib_rend/ivas_td_ring_buffer_fx.c b/lib_rend/ivas_td_ring_buffer_fx.c index 98905d25e..9b41d6ae4 100644 --- a/lib_rend/ivas_td_ring_buffer_fx.c +++ b/lib_rend/ivas_td_ring_buffer_fx.c @@ -244,7 +244,7 @@ void ivas_TD_RINGBUF_PushChannels( assert( h != NULL ); assert( p_channels != NULL ); - for ( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ + FOR( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ { assert( p_channels[c] != NULL ); } @@ -311,7 +311,7 @@ void ivas_TD_RINGBUF_PopChannels( assert( h != NULL ); assert( p_channels != NULL ); - for ( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ + FOR( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ { assert( p_channels[c] != NULL ); } diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index d312c8f10..5e49dc0cc 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -3533,7 +3533,7 @@ static ivas_error updateSbaPanGains( return error; } } - break; + BREAK; } case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: @@ -4389,7 +4389,7 @@ static void *getInputByIndex_fx( case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: return (input_masa *) inputsArray + index; default: - break; + BREAK; } /* this should be unreachable */ assert( 0 ); @@ -7443,7 +7443,7 @@ static ivas_error renderInputIsm( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderIsmToSplitBinaural( ismInput, outAudio ); - break; + BREAK; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderIsmToBinauralReverb( ismInput, outAudio ); BREAK; @@ -8391,7 +8391,7 @@ static ivas_error renderInputMc( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderMcToSplitBinaural( mcInput, outConfig, outAudio ); - break; + BREAK; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; } @@ -8957,11 +8957,11 @@ static ivas_error renderInputSba( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, outConfig, outAudio ); - break; + BREAK; case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); - break; + BREAK; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); BREAK; @@ -9982,8 +9982,8 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( IF( NE_32( hIvasRend->inputsIsm[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { ro_md_flag = 1; - - break; + move16(); + BREAK; } } -- GitLab From 98ce2ed70849de10ff1b0033b5e53fb05de61368 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Mar 2026 20:35:12 +0100 Subject: [PATCH 2/7] clang-format --- lib_com/bitstream_fx.c | 2 +- lib_com/longarith.c | 8 ++++---- lib_com/parameter_bitmaping_fx.c | 4 ++-- lib_enc/core_enc_ol_fx.c | 4 ++-- lib_rend/ivas_crend_fx.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index dc3cd54fc..e36a2d262 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -3214,7 +3214,7 @@ Word16 find_indice( *value = hBstr->ind_list[i].value; *nb_bits = hBstr->ind_list[i].nb_bits; move16(); - move16 (); + move16(); return i; } } diff --git a/lib_com/longarith.c b/lib_com/longarith.c index bd50768e6..ccef60319 100644 --- a/lib_com/longarith.c +++ b/lib_com/longarith.c @@ -66,14 +66,14 @@ void longadd( { carry += ( (UWord32) a[h] ) + ( (UWord32) b[h] ); a[h] = (UWord16) carry; - carry = L_shr(carry, 16); + carry = L_shr( carry, 16 ); } FOR( ; h < lena; h++ ) { carry = ( (UWord32) a[h] ) + carry; a[h] = (UWord16) carry; - carry = L_shr(carry, 16); + carry = L_shr( carry, 16 ); } assert( carry == 0 ); /* carry != 0 indicates addition overflow */ @@ -175,7 +175,7 @@ void longshiftleft( Word16 fracb_l; /* shift right value for all lower words a[k-1] */ Word16 k = len - 1; - intb = shr(b, 4); + intb = shr( b, 4 ); fracb = b & 0xF; IF( fracb ) @@ -183,7 +183,7 @@ void longshiftleft( fracb_l = 16 - fracb; FOR( ; k > intb; k-- ) { - d[k] = ( shl(a[k - intb], fracb) ) | ( shr(a[k - intb - 1], fracb_l) ); + d[k] = ( shl( a[k - intb], fracb ) ) | ( shr( a[k - intb - 1], fracb_l ) ); } d[k] = shl( a[k - intb], fracb ); k--; diff --git a/lib_com/parameter_bitmaping_fx.c b/lib_com/parameter_bitmaping_fx.c index 8ce98f66e..02ab3ee9a 100644 --- a/lib_com/parameter_bitmaping_fx.c +++ b/lib_com/parameter_bitmaping_fx.c @@ -65,7 +65,7 @@ void GetParameters( #undef WMC_TOOL_SKIP /* If a function for encoding/decoding value is defined than it should take care of 0 */ test(); - IF ( param->fZeroAllowed || ( param->EncodeValue != NULL ) ) + IF( param->fZeroAllowed || ( param->EncodeValue != NULL ) ) { *( *pStream )++ = value; } @@ -78,7 +78,7 @@ void GetParameters( *pnBits += ( param->nBits != 0 ) ? param->nBits : param->GetNumberOfBits( value, index ); #undef WMC_TOOL_SKIP test(); - IF ( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) + IF( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) { GetParameters( param->pSubParamBitMap, value, ( pSubStruct != NULL ) ? pSubStruct : pParameter, pStream, pnSize, pnBits ); } diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index 0c4af1a3d..8cc858b77 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -1497,8 +1497,8 @@ static void BITS_ALLOC_ACELP_config_rf( case RF_GENPRED: /* Es_pred bits 3 bits, LTF: 0, pitch: 8,0,8,0, FCB: 6,7,5,5, gain: 5,0,5,0, Diff GFr: 0*/ - /*bits += (3 + 0 + 16 + 23 + 10 + 0); */ /* 72 rf bits */ - *rf_target_bits += ( ACELP_NRG_BITS[nrgMode] + ACELP_LTF_BITS[ltfMode] + ACELP_LTP_BITS_SFR[ltpMode][0] + ACELP_LTP_BITS_SFR[ltpMode][1] + ACELP_LTP_BITS_SFR[ltpMode][2] + ACELP_LTP_BITS_SFR[ltpMode][3] + 14 + ACELP_GAINS_BITS[gainsMode] + ACELP_GAINS_BITS[gainsMode] + 2 /*2 bits for PartialCopy GainFrame*/); + /*bits += (3 + 0 + 16 + 23 + 10 + 0); */ /* 72 rf bits */ + *rf_target_bits += ( ACELP_NRG_BITS[nrgMode] + ACELP_LTF_BITS[ltfMode] + ACELP_LTP_BITS_SFR[ltpMode][0] + ACELP_LTP_BITS_SFR[ltpMode][1] + ACELP_LTP_BITS_SFR[ltpMode][2] + ACELP_LTP_BITS_SFR[ltpMode][3] + 14 + ACELP_GAINS_BITS[gainsMode] + ACELP_GAINS_BITS[gainsMode] + 2 /*2 bits for PartialCopy GainFrame*/ ); move16(); BREAK; diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 4e5b68863..989215e4f 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -1113,9 +1113,9 @@ static ivas_error ivas_rend_initCrend_fx( move16(); FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { - IF( EQ_16(outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) + IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { - if ( NE_16( hHrtf->inv_diffuse_weight_fx[0][i], hHrtf->inv_diffuse_weight_fx[1][i] ) ) + IF( NE_16( hHrtf->inv_diffuse_weight_fx[0][i], hHrtf->inv_diffuse_weight_fx[1][i] ) ) { hHrtf->same_inv_diffuse_weight = 0; move16(); -- GitLab From 6515fd012850f5babadd2cc8ed464fbc483db645 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Mar 2026 20:38:26 +0100 Subject: [PATCH 3/7] clang-format --- lib_dec/gain_dec_fx.c | 2 +- lib_dec/ivas_init_dec_fx.c | 4 ++-- lib_enc/core_enc_ol_fx.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/gain_dec_fx.c b/lib_dec/gain_dec_fx.c index 888ec0e52..90d065b0a 100644 --- a/lib_dec/gain_dec_fx.c +++ b/lib_dec/gain_dec_fx.c @@ -62,7 +62,7 @@ void Es_pred_dec_fx( move16(); } - return; + return; } diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 610a5a4f8..52d38ed58 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -3320,7 +3320,7 @@ void ivas_initialize_handles_dec( /* rendering handles */ st_ivas->hBinRenderer = NULL; - FOR ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + FOR( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) { st_ivas->hDiracDecBin[i] = NULL; } @@ -3493,7 +3493,7 @@ void ivas_destroy_dec_fx( /* TD binaural renderer handles */ FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { - IF ( st_ivas->hTdRendHandles[i] != NULL ) + IF( st_ivas->hTdRendHandles[i] != NULL ) { st_ivas->hTdRendHandles[i]->HrFiltSet_p = NULL; ivas_td_binaural_close_fx( &st_ivas->hTdRendHandles[i] ); diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index 8cc858b77..94a306091 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -1497,7 +1497,7 @@ static void BITS_ALLOC_ACELP_config_rf( case RF_GENPRED: /* Es_pred bits 3 bits, LTF: 0, pitch: 8,0,8,0, FCB: 6,7,5,5, gain: 5,0,5,0, Diff GFr: 0*/ - /*bits += (3 + 0 + 16 + 23 + 10 + 0); */ /* 72 rf bits */ + /*bits += (3 + 0 + 16 + 23 + 10 + 0); */ /* 72 rf bits */ *rf_target_bits += ( ACELP_NRG_BITS[nrgMode] + ACELP_LTF_BITS[ltfMode] + ACELP_LTP_BITS_SFR[ltpMode][0] + ACELP_LTP_BITS_SFR[ltpMode][1] + ACELP_LTP_BITS_SFR[ltpMode][2] + ACELP_LTP_BITS_SFR[ltpMode][3] + 14 + ACELP_GAINS_BITS[gainsMode] + ACELP_GAINS_BITS[gainsMode] + 2 /*2 bits for PartialCopy GainFrame*/ ); move16(); BREAK; -- GitLab From 84d59d91887947f02694a88226a20c9c81dd270f Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Mar 2026 11:19:13 +0100 Subject: [PATCH 4/7] address reviewer's comments --- lib_com/bitstream_fx.c | 2 +- lib_com/ivas_tools_fx.c | 2 +- lib_com/tools_fx.c | 2 +- lib_rend/ivas_td_ring_buffer_fx.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index e36a2d262..5adf9dc61 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -3276,7 +3276,7 @@ UWord16 delete_indice( #endif } - return i - j; + return sub( i, j ); } diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index 753c3ae29..d60b8fbde 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -254,7 +254,7 @@ void mvr2r_inc_fx( return; } - IF( y_fx < x_fx ) + IF( LT_16( y_fx, x_fx ) ) { ix = 0; move16(); diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 5cd0296d7..cb9b9a3e5 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -348,7 +348,7 @@ void mvs2s( return; } - IF( y < x ) + IF( LT_16(y, x ) ) { FOR( i = 0; i < n; i++ ) { diff --git a/lib_rend/ivas_td_ring_buffer_fx.c b/lib_rend/ivas_td_ring_buffer_fx.c index 9b41d6ae4..98905d25e 100644 --- a/lib_rend/ivas_td_ring_buffer_fx.c +++ b/lib_rend/ivas_td_ring_buffer_fx.c @@ -244,7 +244,7 @@ void ivas_TD_RINGBUF_PushChannels( assert( h != NULL ); assert( p_channels != NULL ); - FOR( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ + for ( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ { assert( p_channels[c] != NULL ); } @@ -311,7 +311,7 @@ void ivas_TD_RINGBUF_PopChannels( assert( h != NULL ); assert( p_channels != NULL ); - FOR( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ + for ( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ { assert( p_channels[c] != NULL ); } -- GitLab From 2ec5304528a06eeaadb544e3b1f70fa9f04c1574 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Mar 2026 11:27:17 +0100 Subject: [PATCH 5/7] add instrumentation --- lib_com/tools_fx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index cb9b9a3e5..7967a58c5 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -348,7 +348,7 @@ void mvs2s( return; } - IF( LT_16(y, x ) ) + IF( y < x ) { FOR( i = 0; i < n; i++ ) { @@ -620,7 +620,7 @@ Word32 dotp_fx32_o( move16(); test(); test(); - FOR( ; ( suma > MAX_32 ) || ( suma < MIN_32 ) || ( *res_q > 31 ); ) + FOR( ; ( GT_64( suma, MAX_32 ) ) || LT_64( suma, MIN_32 ) || GT_16( *res_q, 31 ); ) { suma = W_shr( suma, 1 ); *res_q = sub( *res_q, 1 ); @@ -1866,8 +1866,8 @@ Word16 minimum_32_fx( if ( min_fx != NULL ) { *min_fx = tmp; - } - move32(); + move32(); + } return ind; } @@ -1905,8 +1905,8 @@ Word16 maximum_32_fx( if ( max_val != NULL ) { *max_val = tmp; - } - move32(); + move32(); + } return ind; } -- GitLab From 354867be82b99a40351f14c30d4f3f6dedbc9cc2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Mar 2026 11:31:10 +0100 Subject: [PATCH 6/7] clang-format --- lib_com/tools_fx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 7967a58c5..fd0eceedb 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -1863,11 +1863,12 @@ Word16 minimum_32_fx( } tmp = L_min( tmp, vec_fx[j] ); } + if ( min_fx != NULL ) { *min_fx = tmp; move32(); - } + } return ind; } @@ -1902,11 +1903,12 @@ Word16 maximum_32_fx( } tmp = L_max( tmp, vec[j] ); } + if ( max_val != NULL ) { *max_val = tmp; move32(); - } + } return ind; } -- GitLab From 487e29e1ecedad7723fe5c3df43cc40c895198eb Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Mar 2026 11:42:28 +0100 Subject: [PATCH 7/7] revert a change in pointers comparison --- lib_com/ivas_tools_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index d60b8fbde..753c3ae29 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -254,7 +254,7 @@ void mvr2r_inc_fx( return; } - IF( LT_16( y_fx, x_fx ) ) + IF( y_fx < x_fx ) { ix = 0; move16(); -- GitLab