diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 634659c7f4c5d1d069847b96a7215018a9ba2761..5adf9dc61a9701aae9572decff543425b430a51d 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; } } @@ -3273,7 +3276,7 @@ UWord16 delete_indice( #endif } - return i - j; + return sub( i, j ); } @@ -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 4677016f810dc3bc8db05133cca07af98c782153..3dfe624dcb2bc15e95390b02dbe3c02ab9da3b54 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 ffb5265541bcf1335433b8f494f2a71e624455c5..05414368407bdc39c54f8dd1a04eb458761e6b41 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 193c358cb5808f579aa0237862c8b88408cb2ab1..ccef603198f13707ae254e060fd9183b1dbe31c2 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 8a9ac872a2fe6e7e1ed073b517c0cad3f42de4de..02ab3ee9a5736b3358bd52829a6e86c4dd4a99f2 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 71fd2b6553235c5b48b628be7571d01d1dd5de65..ebe14f5f301477cc427861d83cbcf19de5052d6a 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 47111db3eb9ad25710cc100e42b458d5890a8c0f..fd0eceedb65d5b7218bed50924e9061984884c63 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]; } @@ -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 ); @@ -1863,11 +1863,12 @@ Word16 minimum_32_fx( } tmp = L_min( tmp, vec_fx[j] ); } + if ( min_fx != NULL ) { *min_fx = tmp; + move32(); } - 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(); } - move32(); return ind; } @@ -3713,7 +3715,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 +3739,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 001cfa97539798bfae17a065ddfa926cc34c7188..7dcb25dcb2f94ce1e289c10242fd5bef338a50aa 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 551e04205f4030c9b5c74c55883e0f286a580299..90d065b0a9f45b5e3a40297e386c0761eb49206a 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 d867298d1926d68040c4c6a1c2c7b45aaa09ddcf..917e966d3b8069f273a913ed1ac3ea1c94773a70 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 358d5eba61d1b6e91cb8369c242a9b7eb3f59d4a..86035f089a8d90c46cd87159a41775d819ba2e2e 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 01cc0f717ac844e15c5bdccc0104bea0e87dfba6..52d38ed586bcd68d0c265432284ff07f5adcb5ba 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 b929e3a98a3a6426defabef3409181d54452414b..a11feddf170f335f8c9a59fa493e29e3cd9d6739 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 3e7664bd7fb7b649a0cb5970185e949ea55229c2..c21477d9de44b8c0008d20146c1eb7a76d0a04dd 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 9bce073cdd0a4ed0de63902af745980eae919633..54fc60583b4dd9b5bc1e81b18c313aa1be9c0c4a 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 0dd016b9d543f1585e181dc1feb278141f240a22..f79e5f233d10e15649773eeb55e946d2f5e28388 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 32c8c99581caeac996bc96bdbd233d9afb94c2a3..b44441aaa07e70b31e1286fa30fc740e20454639 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 b4c10b9acc5795dd1ab5351e9cca00f36055c22e..89df6423ca1339b2071e23e63733b66c2240e24c 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 aff171740f749d2c5cfec104ee6332047ae0be13..6492e15c102ad0b83c20c6dd4ffd1b448bb9d192 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 a347b086a4f24c973265a4fe8e4de98d73eb88e2..94a306091a3df4c17b49c0dbb6dae776a32d777d 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -1497,9 +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; @@ -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 d7f64c4bcb837232118b66122d1933be49ba28d1..9aa5c8d08a18bcff6a8d98e116fef264103765a0 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 f3ece9b264c56da9ad0886a6da0a67b2aca7a5c7..b7fed0e62684243fb91a202b3d81b981395320db 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 84abf47be39b1e9eda11356249b2dbfd4cd9098c..95c7bcb3f8da170d22367c286cea9df892aa7bc9 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 e4506609f015fb358a85e4ae784ddc8ef926cf17..ddc01634e9252cd19513e519e477087cccb43d4b 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 62a88ed999ad10d497a096a91d40608d32c4bae2..5ec986ec75f9f28fdc8acac08f44b3129e00f7fd 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 2776799ed37158dfbc44c3ad607f1ef8b46d34a0..ffead33272189327ff9baf765b54efbaca335217 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 01ff6b24ee6e5e67ff3c5ac2c3668fbef659c9a8..7c10978d3058504afb39d9ff44b2216e1b31ff31 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 b6ab26c5a4e8195ef2192d21bc3a2424d2a99208..234652072aafb5da36bdc5e843e522bd6928ad00 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 397d72c32386b2ac36c5e0bcf153e19e3b0e0106..e2c5303f72d1720c80f494f68ebf69a9066881a8 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 6cb93e9413c762178afc946c10af503c4e0d6f4e..d5a2ba0637a3f960449c4d0b330d7faf6e324aef 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 697d9f40fc75e3a207420fe0a17d46816aa694e4..9f481bbd12747c020078badcaec616d50e164bc8 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 d38d2efd4f25e42f793bbe2c539ea3f77b7b838d..622d5ad54f0759a6f6269b34056f1c3236ea6aea 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 e3e2a306b28d9b8dca90f09b3b94720a6f57e176..989215e4fb1e4677408eed5bd1607018d49b94ee 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 bd5585c088f1dc1c86f7f13130bf54bc688080c2..792ac76de21f62a354cdecf58298ae099928af0b 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 10a21dd7d5b1e3c11972ae5f2a075576b01beb59..1775c11f439bb3e60fcca503ad34bcaf595fc1df 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 b645be551d16619f0bf1e643ee0c5ca87241fadb..ee1480f06a1cd9db70f861d05954200362df8148 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 8f4149171fceb11c6109c2bbcc73f506ec4c8a65..baf121956523e7a544fb8ed46195f63445906533 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/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index d312c8f105f45068c9f0b1d4785963334e60f031..5e49dc0cc06f4876bb148a8a79bef27033fb5b06 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; } }