From 0355b2de75dff2475ceb3a9485bdbb7ab5602fa5 Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Wed, 10 Jun 2026 17:33:19 +0200 Subject: [PATCH 1/9] Add instrumentation corrections found in static code analysis. --- lib_com/bits_alloc_fx.c | 4 +++ lib_com/cldfb_evs_fx.c | 3 ++ lib_com/fft_fx_evs.c | 52 ++++++++++++++++++++++++++++++ lib_com/gs_bitallocation_fx.c | 4 +++ lib_com/ivas_dirac_com_fx.c | 4 +++ lib_com/ivas_tools_fx.c | 4 +++ lib_com/lsf_tools_fx.c | 3 ++ lib_com/options.h | 1 + lib_com/tcq_position_arith_fx.c | 8 +++++ lib_com/wi_fx.c | 4 +++ lib_dec/FEC_HQ_core_fx.c | 6 ++++ lib_dec/FEC_clas_estim_fx.c | 3 ++ lib_dec/dec4t64_fx.c | 17 ++++++++++ lib_dec/dec_tran_fx.c | 4 +++ lib_dec/decision_matrix_dec_fx.c | 4 +++ lib_dec/gain_dec_fx.c | 3 ++ lib_dec/ivas_stereo_eclvq_dec_fx.c | 4 +++ lib_dec/ivas_td_low_rate_dec_fx.c | 3 ++ lib_dec/lib_dec_fx.c | 25 ++++++++++++++ lib_dec/peak_vq_dec_fx.c | 4 +++ lib_dec/waveadjust_fec_dec_fx.c | 7 ++++ lib_enc/FEC_enc_fx.c | 4 +++ lib_enc/ari_enc_fx.c | 8 +++++ lib_enc/decision_matrix_enc_fx.c | 4 +++ lib_enc/dtx_fx.c | 12 +++++++ lib_enc/ivas_front_vad_fx.c | 6 ++++ lib_enc/lib_enc_fx.c | 8 +++++ lib_enc/swb_tbe_enc_fx.c | 4 +++ lib_isar/lib_isar_post_rend.c | 12 +++++++ lib_rend/ivas_dirac_rend_fx.c | 5 +++ lib_rend/lib_rend_fx.c | 16 +++++++++ 31 files changed, 246 insertions(+) diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index 720196316..da45e5eab 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -1480,7 +1480,11 @@ ivas_error config_acelp1_fx( if ( EQ_16( L_frame, L_FRAME16k ) ) { Pitch_BR = core_brate; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } ELSE diff --git a/lib_com/cldfb_evs_fx.c b/lib_com/cldfb_evs_fx.c index b2c15eb21..c2aa4b521 100644 --- a/lib_com/cldfb_evs_fx.c +++ b/lib_com/cldfb_evs_fx.c @@ -1649,6 +1649,9 @@ void cldfb_restore_memory( } hs->memory_length = 0; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif free( hs->memory ); hs->memory = NULL; diff --git a/lib_com/fft_fx_evs.c b/lib_com/fft_fx_evs.c index 5cbfbc250..ffc274121 100644 --- a/lib_com/fft_fx_evs.c +++ b/lib_com/fft_fx_evs.c @@ -64,9 +64,17 @@ void DoRTFTn_fx( FOR( i = 0; i < n; i++ ) { *pt++ = spec[i].re; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif *pt++ = spec[i].im; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } ELSE @@ -75,9 +83,17 @@ void DoRTFTn_fx( FOR( i = 0; i < n; i++ ) { *pt++ = x[i]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif *pt++ = y[i]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } @@ -113,31 +129,63 @@ void DoRTFTn_fx( IF( spec != NULL ) { spec[0].re = z[0]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif spec[0].im = z[1]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif pt = &z[2]; FOR( i = n - 1; i >= 1; i-- ) { spec[i].re = *pt++; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif spec[i].im = *pt++; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } ELSE { x[0] = z[0]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif y[0] = z[1]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif pt = &z[2]; FOR( i = n - 1; i >= 1; i-- ) { x[i] = *pt++; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif y[i] = *pt++; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } @@ -982,7 +1030,11 @@ static void dctsub_fx( move32(); } a[m] = Mult_32_16( L_shl( a[m], 1 ), c[0] ); // Qx +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } /*-----------------------------------------------------------------* diff --git a/lib_com/gs_bitallocation_fx.c b/lib_com/gs_bitallocation_fx.c index 697fc2153..d056e2184 100644 --- a/lib_com/gs_bitallocation_fx.c +++ b/lib_com/gs_bitallocation_fx.c @@ -674,7 +674,11 @@ void bands_and_bit_alloc_fx( *--------------------------------------------------------------------------*/ sum_bit = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif j = 0; move16(); FOR( i = 0; i < nb_bands; i++ ) diff --git a/lib_com/ivas_dirac_com_fx.c b/lib_com/ivas_dirac_com_fx.c index a6aa486f2..c1c663c0c 100644 --- a/lib_com/ivas_dirac_com_fx.c +++ b/lib_com/ivas_dirac_com_fx.c @@ -1090,7 +1090,11 @@ void deindex_spherical_component_fx( *az_idx = sph_idx; move16(); *az_fx = deindex_azimuth_fx( *az_idx, no_bits, 0, 0, mc_format ); +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif BREAK; default: *el_idx = deindex_sph_idx_general_fx( sph_idx, no_bits, el_fx, az_fx, az_idx, mc_format ); diff --git a/lib_com/ivas_tools_fx.c b/lib_com/ivas_tools_fx.c index 753c3ae29..643061ebd 100644 --- a/lib_com/ivas_tools_fx.c +++ b/lib_com/ivas_tools_fx.c @@ -556,7 +556,11 @@ Word64 dot_product_cholesky_fx( FOR( i = 0; i < N; i++ ) { tmp_sum = 0; +#ifdef FIX_2564_INSTRUMENTATION + move64(); +#else move32(); +#endif pt_x = x; FOR( j = 0; j <= i; j++ ) diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index c69503350..85f21e417 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -1266,6 +1266,9 @@ void E_LPC_f_lsp_a_conversion( move16(); } j = m; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif FOR( i = 1; i <= nc; i++ ) { /* a[i] = 0.5*(f1[i] + f2[i]) */ diff --git a/lib_com/options.h b/lib_com/options.h index f37a0c7a8..280f8da51 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -87,6 +87,7 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */ +#define FIX_2564_INSTRUMENTATION /* FhG: Instrumentation fix */ /* #################### End BE switches ################################## */ diff --git a/lib_com/tcq_position_arith_fx.c b/lib_com/tcq_position_arith_fx.c index 431a509b1..e3d5a4f60 100644 --- a/lib_com/tcq_position_arith_fx.c +++ b/lib_com/tcq_position_arith_fx.c @@ -216,7 +216,11 @@ static Word32 ar_make_model_fx( } } +#ifdef FIX_2564_INSTRUMENTATION + return ( GT_16( model[0], model[1] ) ); +#else return ( model[0] > model[1] ); +#endif } void ar_encoder_start_fx( @@ -322,7 +326,11 @@ void ar_encoder_done_fx( { arInst->bits_to_follow = add( arInst->bits_to_follow, 1 ); move16(); +#ifdef FIX_2564_INSTRUMENTATION + transmission_bits( arInst, GE_32( arInst->low, AR_FIRST ) ); +#else transmission_bits( arInst, arInst->low >= AR_FIRST ); +#endif return; } diff --git a/lib_com/wi_fx.c b/lib_com/wi_fx.c index ce5a0e7f0..6a33ec8dc 100644 --- a/lib_com/wi_fx.c +++ b/lib_com/wi_fx.c @@ -1634,7 +1634,11 @@ static Word32 DTFS_setEngy_fx( HalfLag_fx = s_min( shr( X_DTFS_FX->lag_fx, 1 ), X_DTFS_FX->nH_fx ); move16(); en1_fx = DTFS_getEngy_fx( X_DTFS_FX ); +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif IF( en1_fx == 0 ) { diff --git a/lib_dec/FEC_HQ_core_fx.c b/lib_dec/FEC_HQ_core_fx.c index 641f60059..83fa45d3f 100644 --- a/lib_dec/FEC_HQ_core_fx.c +++ b/lib_dec/FEC_HQ_core_fx.c @@ -997,7 +997,11 @@ static Word16 FEC_phase_matching_fx( FOR( i = L_overlap; i < N_LEAD_NB; i++ ) { OldauOut_pha_fx[1][i] = OldauOut2_fx[i + N_ZERO_NB]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#else move32(); +#endif } return 0; @@ -1328,7 +1332,9 @@ static void common_overlapping_fx( } FOR( i = start2; i < end2; i++ ) { +#ifndef FIX_2564_INSTRUMENTATION /*auOut_fx[i+offset2] = ImdctOutWin_fx[i+offset_i2]; move32();*/ +#endif auOut_fx[i + offset2] = ImdctOutWin_fx[i + offset_i2]; move16(); } diff --git a/lib_dec/FEC_clas_estim_fx.c b/lib_dec/FEC_clas_estim_fx.c index 946f770e8..c8ff47dce 100644 --- a/lib_dec/FEC_clas_estim_fx.c +++ b/lib_dec/FEC_clas_estim_fx.c @@ -875,6 +875,9 @@ Word16 FEC_pos_dec_fx( /* decode last pulse position */ *last_pulse_pos = (Word16) get_next_indice_fx( st_fx, FEC_BITS_POS ); +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /* respect the sign */ IF( GE_16( *last_pulse_pos, 128 ) ) diff --git a/lib_dec/dec4t64_fx.c b/lib_dec/dec4t64_fx.c index bef7b1905..e2b7e1a48 100644 --- a/lib_dec/dec4t64_fx.c +++ b/lib_dec/dec4t64_fx.c @@ -177,7 +177,11 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { +#ifdef FIX_2564_INSTRUMENTATION + ind1[k] = L_deposit_l( get_next_indice_fx( st_fx, 2 ) ); +#else ind1[k] = get_next_indice_fx( st_fx, 2 ); +#endif move32(); } FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) @@ -192,12 +196,20 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T - 2; k++ ) { +#ifdef FIX_2564_INSTRUMENTATION + ind1[k] = L_deposit_l( get_next_indice_fx( st_fx, 10 ) ); +#else ind1[k] = get_next_indice_fx( st_fx, 10 ); +#endif move32(); } FOR( k = 2; k < NB_TRACK_FCB_4T; k++ ) { +#ifdef FIX_2564_INSTRUMENTATION + ind1[k] = L_deposit_l( get_next_indice_fx( st_fx, 2 ) ); +#else ind1[k] = get_next_indice_fx( st_fx, 2 ); +#endif move32(); } FOR( k = 0; k < NB_TRACK_FCB_4T - 2; k++ ) @@ -219,8 +231,13 @@ void dec_acelp_4t64_fx( { FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { +#ifdef FIX_2564_INSTRUMENTATION + ind1[k] = L_deposit_l( get_next_indice_fx( st_fx, 11 ) ); + move32(); +#else ind1[k] = get_next_indice_fx( st_fx, 11 ); move16(); +#endif } FOR( k = 0; k < NB_TRACK_FCB_4T; k++ ) { diff --git a/lib_dec/dec_tran_fx.c b/lib_dec/dec_tran_fx.c index 20d5f4b22..a7c899d28 100644 --- a/lib_dec/dec_tran_fx.c +++ b/lib_dec/dec_tran_fx.c @@ -127,7 +127,11 @@ void decod_tran_fx( IF( GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) ) { gain_code_fx = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif transf_cdbk_dec_fx( st_fx, 0, i_subfr, Es_pred_fx, gain_code_fx, &gain_preQ_fx, &norm_gain_preQ_fx, code_preQ_fx, unbits ); } diff --git a/lib_dec/decision_matrix_dec_fx.c b/lib_dec/decision_matrix_dec_fx.c index 055f1325f..6dc92cb82 100644 --- a/lib_dec/decision_matrix_dec_fx.c +++ b/lib_dec/decision_matrix_dec_fx.c @@ -370,7 +370,11 @@ void decision_matrix_dec_fx( st->bwidth = st->last_bwidth; move16(); st->total_brate = st->last_total_brate; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif test(); IF( EQ_16( st->last_core, AMR_WB_CORE ) ) diff --git a/lib_dec/gain_dec_fx.c b/lib_dec/gain_dec_fx.c index 90d065b0a..752c69209 100644 --- a/lib_dec/gain_dec_fx.c +++ b/lib_dec/gain_dec_fx.c @@ -49,6 +49,9 @@ void Es_pred_dec_fx( BREAK; case 3: *Es_pred = Es_pred_qua_3b_fx[enr_idx]; /*Q8*/ +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif BREAK; default: *Es_pred = Es_pred_qua_5b_fx[enr_idx]; /*Q8*/ diff --git a/lib_dec/ivas_stereo_eclvq_dec_fx.c b/lib_dec/ivas_stereo_eclvq_dec_fx.c index f487d2f0c..7fc93990c 100644 --- a/lib_dec/ivas_stereo_eclvq_dec_fx.c +++ b/lib_dec/ivas_stereo_eclvq_dec_fx.c @@ -209,7 +209,11 @@ void ECSQ_decode_fx( } ELSE { +#ifdef FIX_2564_INSTRUMENTATION + count0 = imult1616( left0, ECSQ_tab_inverse[left0 + left1] ); /* left0 * round(ECSQ_PROB_TOTAL / (left0 + left1)) Q0*/ +#else count0 = left0 * ECSQ_tab_inverse[left0 + left1]; /* left0 * round(ECSQ_PROB_TOTAL / (left0 + left1)) Q0*/ +#endif sym = rc_uni_dec_read_bit_prob_fast( rc_st_dec, count0, ECSQ_PROB_BITS ); /* Q0 */ } diff --git a/lib_dec/ivas_td_low_rate_dec_fx.c b/lib_dec/ivas_td_low_rate_dec_fx.c index a5141e398..43dae95db 100644 --- a/lib_dec/ivas_td_low_rate_dec_fx.c +++ b/lib_dec/ivas_td_low_rate_dec_fx.c @@ -257,6 +257,9 @@ void decod_gen_2sbfr_fx( *----------------------------------------------------------------------*/ *pt_pitch = pit_decode_fx( st, st->core_brate, 0, L_frame, i_subfr, GENERIC, &pitch_limit_flag, &T0, &T0_frac, &T0_min, &T0_max, 2 * L_SUBFR, tdm_Pitch_reuse_flag, tdm_Pri_pitch_buf ); /* Q6 */ +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif test(); test(); diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 7356bf734..699377f55 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2934,6 +2934,11 @@ static ivas_error copyRendererConfigStruct( hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay_fx = hRCin->roomAcoustics.acousticPreDelay_fx; hRCout->roomAcoustics.inputPreDelay_fx = hRCin->roomAcoustics.inputPreDelay_fx; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move32(); + move32(); +#endif Copy32( hRCin->roomAcoustics.pFc_input_fx, hRCout->roomAcoustics.pFc_input_fx, CLDFB_NO_CHANNELS_MAX ); // Q16 Copy32( hRCin->roomAcoustics.pAcoustic_rt60_fx, hRCout->roomAcoustics.pAcoustic_rt60_fx, CLDFB_NO_CHANNELS_MAX ); // Q26 @@ -2942,15 +2947,35 @@ static ivas_error copyRendererConfigStruct( Copy32( hRCin->distAtt_fx, hRCout->distAtt_fx, 3 ); hRCout->split_rend_config = hRCin->split_rend_config; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move16(); + move16(); + move16(); + move16(); + move16(); + move32(); + move32(); + move32(); + move16(); +#endif hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif + hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); move16(); move16(); move32(); move32(); move32(); +#endif return IVAS_ERR_OK; } diff --git a/lib_dec/peak_vq_dec_fx.c b/lib_dec/peak_vq_dec_fx.c index cf12153fd..478b544ff 100644 --- a/lib_dec/peak_vq_dec_fx.c +++ b/lib_dec/peak_vq_dec_fx.c @@ -448,7 +448,11 @@ static void dequant_peaks_fx( } } vect_out[2] = *peak_gain; /* vect_out in Q12 */ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif Mpy_32_16_ss( *peak_gain, xq[2], &vect_out[3], &dontCare ); Mpy_32_16_ss( *peak_gain, xq[3], &vect_out[4], &dontCare ); diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index 8ac2be167..fa9a66f85 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -881,7 +881,11 @@ void concealment_init_x( move16(); hPlcInfo->subframe_fx = 0; move16(); +#ifdef FIX_2564_INSTRUMENTATION + hPlcInfo->nbLostCmpt = 0; +#else hPlcInfo->nbLostCmpt = (Word16) L_deposit_l( 0 ); +#endif move16(); hPlcInfo->seed = 21845; move16(); @@ -933,6 +937,9 @@ void concealment_decode_fix( Word16 *seed = &( hPlcInfo->seed ); Word16 sign = 0; move16(); +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif IF( hPlcInfo->concealment_method == TCX_NONTONAL ) /* #define TCX_NONTONAL 0 */ { diff --git a/lib_enc/FEC_enc_fx.c b/lib_enc/FEC_enc_fx.c index 3be0ff74c..5f9d0698a 100644 --- a/lib_enc/FEC_enc_fx.c +++ b/lib_enc/FEC_enc_fx.c @@ -59,7 +59,11 @@ void FEC_encode_fx( tmpS = 0; move16(); enr_q = 1; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif sign = 0; move16(); diff --git a/lib_enc/ari_enc_fx.c b/lib_enc/ari_enc_fx.c index 23e422e6b..cc40e83bc 100644 --- a/lib_enc/ari_enc_fx.c +++ b/lib_enc/ari_enc_fx.c @@ -53,9 +53,17 @@ void ari_copy_states_fx( dest->high = source->high; move32(); dest->value = source->value; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif dest->bits_to_follow = source->bits_to_follow; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif return; } diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index 0bf5c8dfa..aa737d1e2 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -137,7 +137,11 @@ void decision_matrix_enc_fx( { /* PPP mode */ st_fx->core_brate = PPP_NELP_2k80; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } ELSE IF( ( ( EQ_16( st_fx->coder_type, UNVOICED ) || EQ_16( st_fx->coder_type, TRANSITION ) ) && st_fx->sp_aud_decision1 == 0 ) || NE_16( st_fx->bwidth, NB ) ) { diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index b6b4e5a34..2d0523437 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -943,18 +943,30 @@ void dtx_hangover_control_fx( IF( GT_32( C[i], max_val[0] ) ) { max_val[1] = max_val[0]; /*x6.5536*/ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif max_idx[1] = max_idx[0]; /*Q0*/ move16(); max_val[0] = C[i]; /*x6.5536*/ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif max_idx[0] = i; move16(); } ELSE IF( GT_32( C[i], max_val[1] ) ) { max_val[1] = C[i]; /*x6.5536*/ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif max_idx[1] = i; move16(); } diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index ddc01634e..6d289fa80 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -393,7 +393,13 @@ ivas_error front_vad_create_fx( hFrontVad->q_mem_preemph_fx = Q15; move16(); hFrontVad->q_buffer_12k8 = Q15; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif hFrontVad->q_mem_decim = Q15; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif hFrontVad->ini_frame = 0; move16(); hFrontVad->hVAD->vad_flag = 1; diff --git a/lib_enc/lib_enc_fx.c b/lib_enc/lib_enc_fx.c index 057bde7d9..dadaad3de 100644 --- a/lib_enc/lib_enc_fx.c +++ b/lib_enc/lib_enc_fx.c @@ -2495,6 +2495,10 @@ static ivas_error bandwidthApiToInternal( return IVAS_ERR_INVALID_BANDWIDTH; } +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif + return IVAS_ERR_OK; } @@ -2521,6 +2525,10 @@ static ivas_error fecIndicatorApiToInternal( return IVAS_ERR_INTERNAL; } +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif + return IVAS_ERR_OK; } diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index f06795ad8..fc80cc93e 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -1329,7 +1329,11 @@ void fb_tbe_reset_enc_fx( set32_fx( elliptic_bpf_2_48k_mem_fx[2], 0, 4 ); set32_fx( elliptic_bpf_2_48k_mem_fx[3], 0, 4 ); *prev_fb_energy_fx = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif set16_fx( elliptic_bpf_2_48k_mem_fx_Q, 0, 4 ); *prev_fb_energy_fx_Q = 0; move16(); diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index 58394fb6c..5b8dc57a4 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -196,6 +196,18 @@ static void convertBitsBufferToInternalBitsBuff( hBits->isar_frame_size_ms = outBits.config.isar_frame_size_ms; hBits->lc3plus_highres = outBits.config.lc3plusHighRes; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move32(); + move32(); + move32(); + move32(); + move32(); + move16(); + move16(); + move16(); +#endif + return; } diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 994e61c4b..234917ce9 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -3556,7 +3556,12 @@ void computeIntensityVector_dec_fx( Word16 min_q_shift; min_q_shift = Q31; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#else move32(); +#endif + /* calculate the max possible shift for the buffers Cldfb_RealBuffer_fx and Cldfb_ImagBuffer_fx*/ FOR( i = 0; i < 4; i++ ) { diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 2eba6449a..239af0cc5 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -359,7 +359,11 @@ static void convertBitsBufferToInternalBitsBuff( move32(); move32(); move32(); +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#else move32(); +#endif return; } @@ -5505,6 +5509,18 @@ ivas_error IVAS_REND_GetRenderConfig( hRCout->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; hRCout->split_rend_config.rendererSelection = hRCin->split_rend_config.rendererSelection; hRCout->split_rend_config.lc3plus_highres = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move16(); + move16(); + move16(); + move16(); + move16(); + move32(); + move32(); + move32(); + move16(); +#endif hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; -- GitLab From 62c848cc1272c695f1f6a7c2b4c4645093a5def2 Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Wed, 10 Jun 2026 18:04:23 +0200 Subject: [PATCH 2/9] clang format --- lib_dec/ivas_stereo_eclvq_dec_fx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_stereo_eclvq_dec_fx.c b/lib_dec/ivas_stereo_eclvq_dec_fx.c index 7fc93990c..be45ed6c9 100644 --- a/lib_dec/ivas_stereo_eclvq_dec_fx.c +++ b/lib_dec/ivas_stereo_eclvq_dec_fx.c @@ -210,9 +210,9 @@ void ECSQ_decode_fx( ELSE { #ifdef FIX_2564_INSTRUMENTATION - count0 = imult1616( left0, ECSQ_tab_inverse[left0 + left1] ); /* left0 * round(ECSQ_PROB_TOTAL / (left0 + left1)) Q0*/ + count0 = imult1616( left0, ECSQ_tab_inverse[left0 + left1] ); /* left0 * round(ECSQ_PROB_TOTAL / (left0 + left1)) Q0*/ #else - count0 = left0 * ECSQ_tab_inverse[left0 + left1]; /* left0 * round(ECSQ_PROB_TOTAL / (left0 + left1)) Q0*/ + count0 = left0 * ECSQ_tab_inverse[left0 + left1]; /* left0 * round(ECSQ_PROB_TOTAL / (left0 + left1)) Q0*/ #endif sym = rc_uni_dec_read_bit_prob_fast( rc_st_dec, count0, ECSQ_PROB_BITS ); /* Q0 */ } -- GitLab From 380f747d10a7aeb31ab9f0a5da6e0f6769118f01 Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Thu, 11 Jun 2026 18:47:09 +0200 Subject: [PATCH 3/9] Add more instrumentation fixes found by static code analysis. --- lib_com/fd_cng_com_fx.c | 4 +++ lib_com/hq_tools_fx.c | 12 +++++++ lib_com/ivas_spar_com_fx.c | 14 ++++++++ lib_com/lsf_tools_fx.c | 4 +++ lib_com/parameter_bitmaping_fx.c | 12 +++++++ lib_com/tcx_ltp_fx.c | 47 ++++++++++++++++++++++++++ lib_com/tools_fx.c | 21 ++++++++++++ lib_dec/avq_dec_fx.c | 4 +++ lib_dec/ivas_out_setup_conversion_fx.c | 4 +++ lib_dec/ivas_range_uni_dec_fx.c | 22 ++++++++++++ lib_enc/decision_matrix_enc_fx.c | 35 +++++++++++++++++++ lib_enc/ivas_dirac_enc_fx.c | 4 +++ lib_enc/ivas_ism_metadata_enc_fx.c | 8 +++++ lib_enc/ivas_qmetadata_enc_fx.c | 24 +++++++++++++ lib_enc/ivas_stereo_classifier_fx.c | 8 +++++ lib_enc/lsf_enc_fx.c | 8 +++++ lib_enc/lsf_msvq_ma_enc_fx.c | 4 +++ lib_enc/tns_base_enc_fx.c | 3 ++ lib_enc/transient_detection_fx.c | 8 +++++ lib_isar/lib_isar_post_rend.c | 23 +++++++++++++ lib_rend/ivas_dirac_decorr_dec_fx.c | 4 +++ lib_rend/ivas_dirac_rend_fx.c | 20 +++++++++++ lib_rend/ivas_orient_trk_fx.c | 7 ++++ lib_rend/ivas_reverb_fx.c | 11 ++++++ lib_rend/ivas_reverb_utils_fx.c | 8 +++++ lib_rend/ivas_td_ring_buffer_fx.c | 6 ++++ lib_rend/lib_rend_fx.c | 32 ++++++++++++++++++ 27 files changed, 357 insertions(+) diff --git a/lib_com/fd_cng_com_fx.c b/lib_com/fd_cng_com_fx.c index 77b9d418f..280bad36b 100644 --- a/lib_com/fd_cng_com_fx.c +++ b/lib_com/fd_cng_com_fx.c @@ -2280,7 +2280,11 @@ static void mhvals( tmp2_m = BASOP_Util_Add_Mant32Exp( tmp2_m, tmp2_e, L_deposit_h( m_array[i] ), 0, &tmp2_e ); assert( tmp2_e == 0 ); *m = extract_h( tmp2_m ); +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#else move32(); +#endif } } diff --git a/lib_com/hq_tools_fx.c b/lib_com/hq_tools_fx.c index 1128ec0c6..64d4c1042 100644 --- a/lib_com/hq_tools_fx.c +++ b/lib_com/hq_tools_fx.c @@ -81,7 +81,11 @@ void hq_swb_harmonic_calc_norm_envelop_fx( /* Apply MA filter */ L_envelope[env_index] = EPSILLON_FX; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { @@ -99,7 +103,11 @@ void hq_swb_harmonic_calc_norm_envelop_fx( { /* Apply MA filter */ L_envelope[env_index] = EPSILLON_FX; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif FOR( n_lag = 0; n_lag < n_lag_now; n_lag++ ) { L_tmp = L_abs( L_SWB_signal[( n_freq + n_lag )] ); /*Q12*/ @@ -531,7 +539,11 @@ void harm_bwe_fine_fx( FOR( i = sfm_start[sfm]; i < sfm_end[sfm]; i++ ) { coeff_out[i] = L_deposit_l( 0 ); /*Q12*/ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } } diff --git a/lib_com/ivas_spar_com_fx.c b/lib_com/ivas_spar_com_fx.c index 4733e4fa0..f970a1a3b 100644 --- a/lib_com/ivas_spar_com_fx.c +++ b/lib_com/ivas_spar_com_fx.c @@ -6764,11 +6764,18 @@ void ivas_dirac_dec_get_response_fx( } f_fx = 1; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif if ( GT_16( index_azimuth, 180 ) ) { f_fx = -1; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } cos_1_fx = L_shr( dirac_gains_trg_term_fx[az][0], 1 ); // q30 @@ -6898,11 +6905,18 @@ void ivas_dirac_dec_get_response_fx_29( } f_fx = 1; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif if ( GT_16( index_azimuth, 180 ) ) { f_fx = -1; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } cos_1_fx = L_shr( dirac_gains_trg_term_fx[az][0], 1 ); // q30 diff --git a/lib_com/lsf_tools_fx.c b/lib_com/lsf_tools_fx.c index 85f21e417..c1d3e92e9 100644 --- a/lib_com/lsf_tools_fx.c +++ b/lib_com/lsf_tools_fx.c @@ -3082,7 +3082,11 @@ void lsf_syn_mem_restore_fx( FOR( i = 0; i < L_FFT; i++ ) { st_fx->Bin_E_fx[i] = Bin_E[i]; // Q_new + Q_SCALE - 2 +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } FOR( i = 0; i < ( L_FFT / 2 ); i++ ) diff --git a/lib_com/parameter_bitmaping_fx.c b/lib_com/parameter_bitmaping_fx.c index 02ab3ee9a..9b4e75596 100644 --- a/lib_com/parameter_bitmaping_fx.c +++ b/lib_com/parameter_bitmaping_fx.c @@ -54,6 +54,9 @@ void GetParameters( assert( ( paramsBitMap != NULL ) && ( nArrayLength > 0 ) && ( pParameter != NULL ) && ( pStream != NULL ) && ( pnSize != NULL ) && ( pnBits != NULL ) ); nParams = paramsBitMap->nParams; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif FOR( index = 0; index < nArrayLength; index++ ) { FOR( iParam = 0; iParam < nParams; iParam++ ) @@ -165,6 +168,9 @@ void SetParameters( assert( ( paramsBitMap != NULL ) && ( nArrayLength > 0 ) && ( pParameter != NULL ) && ( pStream != NULL ) && ( pnSize != NULL ) ); nParams = paramsBitMap->nParams; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif FOR( index = 0; index < nArrayLength; index++ ) { FOR( iParam = 0; iParam < nParams; iParam++ ) @@ -202,6 +208,9 @@ void SetParameters_fx( void *pTmp; assert( ( paramsBitMap != NULL ) && ( nArrayLength > 0 ) && ( pParameter != NULL ) && ( pStream != NULL ) && ( pnSize != NULL ) ); nParams = paramsBitMap->nParams; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif FOR( index = 0; index < nArrayLength; index++ ) { @@ -257,6 +266,9 @@ void WriteToBitstream_fx( assert( ( paramsBitMap != NULL ) && ( nArrayLength > 0 ) && ( pStream != NULL ) && ( pnSize != NULL ) && ( hBstr != NULL ) && ( pnBits != NULL ) ); nParams = paramsBitMap->nParams; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif FOR( index = 0; index < nArrayLength; index++ ) { diff --git a/lib_com/tcx_ltp_fx.c b/lib_com/tcx_ltp_fx.c index ebe14f5f3..160755850 100644 --- a/lib_com/tcx_ltp_fx.c +++ b/lib_com/tcx_ltp_fx.c @@ -921,6 +921,9 @@ static void tcx_ltp_synth_filter_10( } 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 */ +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif x0++; x1++; @@ -972,9 +975,17 @@ static void tcx_ltp_synth_filter_10_fx( FOR( j = 0; j < length; j++ ) { s = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif s2 = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif k = 0; move16(); FOR( i = 0; i < L; i++ ) @@ -1036,9 +1047,17 @@ static void tcx_ltp_synth_filter_01( FOR( j = 0; j < length; j++ ) { s = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif s2 = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif k = 0; move16(); @@ -1050,7 +1069,11 @@ static void tcx_ltp_synth_filter_01( } 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 */ +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#else move32(); +#endif x0++; x1++; @@ -1102,9 +1125,17 @@ static void tcx_ltp_synth_filter_01_fx( FOR( j = 0; j < length; j++ ) { s = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif s2 = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif k = 0; move16(); FOR( i = 0; i < L; i++ ) @@ -1201,9 +1232,17 @@ static void tcx_ltp_synth_filter_11_unequal_pitch( FOR( j = 0; j < length; j++ ) { s = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif s2 = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif k = 0; move16(); FOR( i = 0; i < prev_L; i++ ) @@ -1328,9 +1367,17 @@ static void tcx_ltp_synth_filter_11_unequal_pitch_fx( FOR( j = 0; j < length; j++ ) { s = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif s2 = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif k = 0; move16(); FOR( i = 0; i < prev_L; i++ ) diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index eba00b918..56cea14e5 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -294,6 +294,9 @@ void set_c( FOR( i = 0; i < N; i++ ) { y[i] = a; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } return; @@ -311,6 +314,9 @@ void set_s( FOR( i = 0; i < N; i++ ) { y[i] = a; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } return; @@ -328,6 +334,9 @@ void set_l( FOR( i = 0; i < N; i++ ) { y[i] = a; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } return; @@ -353,6 +362,9 @@ void mvs2s( FOR( i = 0; i < n; i++ ) { y[i] = x[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } } ELSE @@ -360,6 +372,9 @@ void mvs2s( FOR( i = n - 1; i >= 0; i-- ) { y[i] = x[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } } @@ -385,6 +400,9 @@ void mvl2l( FOR( i = 0; i < n; i++ ) { y[i] = x[i]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } } ELSE @@ -392,6 +410,9 @@ void mvl2l( FOR( i = n - 1; i >= 0; i-- ) { y[i] = x[i]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } } diff --git a/lib_dec/avq_dec_fx.c b/lib_dec/avq_dec_fx.c index 4e4735b83..74f29e725 100644 --- a/lib_dec/avq_dec_fx.c +++ b/lib_dec/avq_dec_fx.c @@ -465,7 +465,11 @@ static void read_cv_fx( FOR( j = 0; j < 8; j++ ) { kv[j] = get_next_indice_fx( st, order_v ); +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#else move32(); +#endif } bits = sub( bits, shl( order_v, 3 ) ); } diff --git a/lib_dec/ivas_out_setup_conversion_fx.c b/lib_dec/ivas_out_setup_conversion_fx.c index a8fe1d0b0..07eba204b 100644 --- a/lib_dec/ivas_out_setup_conversion_fx.c +++ b/lib_dec/ivas_out_setup_conversion_fx.c @@ -339,7 +339,11 @@ static ivas_error get_ls_conversion_matrix_fx( index = conversion_matrix_fx[k].index; move16(); value = conversion_matrix_fx[k].value; // Q30 +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif IF( index != 0 ) { diff --git a/lib_dec/ivas_range_uni_dec_fx.c b/lib_dec/ivas_range_uni_dec_fx.c index aa16565f6..d012207d3 100644 --- a/lib_dec/ivas_range_uni_dec_fx.c +++ b/lib_dec/ivas_range_uni_dec_fx.c @@ -74,18 +74,33 @@ void rc_uni_dec_init_fx( rc_st_dec->rc_low = 0; rc_st_dec->rc_range = 0xFFFFFFFF; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move32(); +#endif rc_st_dec->bit_buffer = bit_buffer; /*Q0*/ rc_st_dec->bit_count = 0; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move16(); +#endif /* the renormalization procedure reads at most 32 - 2 extra bits than available */ rc_st_dec->max_allowable_bit_count = add( max_available_bits, 30 ); /*Q0*/ rc_st_dec->bit_error_detected = 0; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif FOR( i = 0; i < 4; i++ ) { +#ifdef FIX_2564_INSTRUMENTATION + rc_st_dec->rc_low = UL_addNsD( UL_lshl( rc_st_dec->rc_low, 8 ), UL_deposit_l( rc_uni_dec_read_fx( rc_st_dec ) ) ); /*Q0*/ +#else // Not adding basops becuase the resultant value greater than Word32 rc_st_dec->rc_low = ( rc_st_dec->rc_low << 8 ) + rc_uni_dec_read_fx( rc_st_dec ); /*Q0*/ +#endif } return; @@ -465,11 +480,18 @@ static Word16 rc_uni_dec_read_fx( IF( GT_16( rc_st_dec->bit_count, rc_st_dec->max_allowable_bit_count ) ) { rc_st_dec->bit_error_detected = 1; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /* for valid bitstreams, always low < range, therefore setting low = range */ /* will always reach the bitstream error condition branch on the next call */ rc_st_dec->rc_range = 0xFFFFFFFF; rc_st_dec->rc_low = rc_st_dec->rc_range; /*Q0*/ +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move32(); +#endif return 0; /* reading the 8 bits would trigger an out-of-bounds array access */ } diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index aa737d1e2..5a2eded14 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -777,6 +777,9 @@ void signaling_enc_rf_fx( { enc_prm_rf_fx( st, hRF->rf_indx_frametype[st->rf_fec_offset], st->rf_fec_offset ); hRF->rf_indx_tbeGainFr[0] = hRF->RF_bwe_gainFr_ind; /*Q0*/ +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } /* Shift the RF indices such that the partial copy associated with @@ -786,16 +789,30 @@ void signaling_enc_rf_fx( { /* rf frame type */ hRF->rf_indx_frametype[i + 1] = hRF->rf_indx_frametype[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /* rf target bits buffer */ hRF->rf_targetbits_buff[i + 1] = hRF->rf_targetbits_buff[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /* lsf indx */ hRF->rf_indx_lsf[i + 1][0] = hRF->rf_indx_lsf[i][0]; hRF->rf_indx_lsf[i + 1][1] = hRF->rf_indx_lsf[i][1]; hRF->rf_indx_lsf[i + 1][2] = hRF->rf_indx_lsf[i][2]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move16(); + move16(); +#endif /* ES pred energy */ hRF->rf_indx_EsPred[i + 1] = hRF->rf_indx_EsPred[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /* LTF mode, sfr params: pitch, fcb and gain */ FOR( sfr = 0; sfr < st->nb_subfr; sfr++ ) @@ -804,6 +821,12 @@ void signaling_enc_rf_fx( hRF->rf_indx_pitch[i + 1][sfr] = hRF->rf_indx_pitch[i][sfr]; hRF->rf_indx_fcb[i + 1][sfr] = hRF->rf_indx_fcb[i][sfr]; hRF->rf_indx_gain[i + 1][sfr] = hRF->rf_indx_gain[i][sfr]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move16(); + move16(); + move16(); +#endif } /* shift the nelp indices */ @@ -811,12 +834,24 @@ void signaling_enc_rf_fx( hRF->rf_indx_nelp_iG2[i + 1][0] = hRF->rf_indx_nelp_iG2[i][0]; hRF->rf_indx_nelp_iG2[i + 1][1] = hRF->rf_indx_nelp_iG2[i][1]; hRF->rf_indx_nelp_fid[i + 1] = hRF->rf_indx_nelp_fid[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move16(); + move16(); + move16(); +#endif /* tbe gain Fr shift */ hRF->rf_indx_tbeGainFr[i + 1] = hRF->rf_indx_tbeGainFr[i]; hRF->rf_clas[i + 1] = hRF->rf_clas[i]; hRF->rf_gain_tcx[i + 1] = hRF->rf_gain_tcx[i]; hRF->rf_tcxltp_param[i + 1] = hRF->rf_tcxltp_param[i]; +#ifdef FIX_2564_INSTRUMENTATION + move16(); + move16(); + move16(); + move16(); +#endif } return; diff --git a/lib_enc/ivas_dirac_enc_fx.c b/lib_enc/ivas_dirac_enc_fx.c index 169348225..3b6474be3 100644 --- a/lib_enc/ivas_dirac_enc_fx.c +++ b/lib_enc/ivas_dirac_enc_fx.c @@ -116,7 +116,11 @@ ivas_error ivas_dirac_enc_open_fx( move16(); } dirac_slot_ns = DIRAC_SLOT_ENC_NS; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif /* initialize delay for SPAR/DirAC delay synchronization */ /* intensity 3-dim */ diff --git a/lib_enc/ivas_ism_metadata_enc_fx.c b/lib_enc/ivas_ism_metadata_enc_fx.c index ff8a47f5e..4bf642ef9 100644 --- a/lib_enc/ivas_ism_metadata_enc_fx.c +++ b/lib_enc/ivas_ism_metadata_enc_fx.c @@ -103,9 +103,17 @@ ivas_error ivas_set_ism_metadata_fx( hIsmMeta->radius_fx = radius_meta; // Q9 move16(); hIsmMeta->yaw_fx = yaw; // Q22 +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif hIsmMeta->pitch_fx = pitch; // Q22 +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif hIsmMeta->non_diegetic_flag = non_diegetic_flag; move16(); diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index f46665440..fc56f0653 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -5748,6 +5748,18 @@ static Word16 ivas_qmetadata_quantize_coherence_hr_512_fx( return nbits; } +#ifdef FIX_2564_INSTRUMENTATION +static Word64 W_mult0_64_16( Word64 L64_var1, Word16 L16_var2 ) +{ + Word64 L64_result; + + L64_result = W_shl_nosat( W_mult0_32_32( W_extract_h( W_lshl( L64_var1, 1 ) ), L_deposit_l( L16_var2 ) ), 31 ); + L64_result = W_add_nosat( L64_result, W_mult0_32_32( L_and( W_extract_l( L64_var1 ), 0x7fffffff ), L_deposit_l( L16_var2 ) ) ); + + return L64_result; +} +#endif + /*-------------------------------------------------------------------* * ivas_qmetadata_quantize_coherence() * @@ -5906,7 +5918,11 @@ static Word16 ivas_qmetadata_quantize_coherence_fx( FOR( j = 0; j < coding_subbands / 2; j++ ) { +#ifdef FIX_2564_INSTRUMENTATION + no_cb = W_mult0_64_16( no_cb, no_cb_vec[j] ); +#else no_cb = no_cb * no_cb_vec[j]; +#endif } // nbits = (Word16) ceilf( logf( (float) no_cb ) * INV_LOG_2 ); @@ -5924,7 +5940,11 @@ static Word16 ivas_qmetadata_quantize_coherence_fx( FOR( j = coding_subbands / 2; j < coding_subbands; j++ ) { +#ifdef FIX_2564_INSTRUMENTATION + no_cb = W_mult0_64_16( no_cb, no_cb_vec[j] ); +#else no_cb = no_cb * no_cb_vec[j]; +#endif } // nbits1 = (Word16) ceilf( logf( (float) no_cb ) * INV_LOG_2 ); IF( LE_64( no_cb, 1 ) ) @@ -5944,7 +5964,11 @@ static Word16 ivas_qmetadata_quantize_coherence_fx( FOR( j = 0; j < coding_subbands; j++ ) { +#ifdef FIX_2564_INSTRUMENTATION + no_cb = W_mult0_64_16( no_cb, no_cb_vec[j] ); +#else no_cb = no_cb * no_cb_vec[j]; +#endif } // nbits = (Word16) ceilf( logf( (float) no_cb ) * INV_LOG_2 ); diff --git a/lib_enc/ivas_stereo_classifier_fx.c b/lib_enc/ivas_stereo_classifier_fx.c index 5ab5f2213..8a8cd478c 100644 --- a/lib_enc/ivas_stereo_classifier_fx.c +++ b/lib_enc/ivas_stereo_classifier_fx.c @@ -930,7 +930,11 @@ void unclr_classifier_td_fx( ELSE { relE_ST = hStereoClassif->relE_buf_fx[0]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } IF( hStereoClassif->relE_0_1_fx > relE_ST ) @@ -1067,7 +1071,11 @@ void unclr_classifier_dft_fx( ELSE { relE_ST = hStereoClassif->relE_buf_fx[0]; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } IF( GT_32( hStereoClassif->relE_0_1_fx, relE_ST ) ) diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index bc1f4cb3a..d1f38e9c8 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -417,7 +417,11 @@ static void lsfq_CNG_fx( IF( LT_32( dist, min_dist ) ) { min_dist = dist; +#ifdef FIX_2564_INSTRUMENTATION + move32(); /*Q-4 */ +#else move16(); /*Q-4 */ +#endif idx_cv = i; move16(); } @@ -2849,7 +2853,11 @@ static void lsf_mid_enc_fx( /* loop over codevectors */ err_min = MAXINT32; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif idx = 0; move16(); k1 = 0; diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index 3557f0a37..c67dbb575 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -1511,7 +1511,11 @@ void midlsf_enc_fx( lpcorder /* i : LP order */ ); err_min = MAXINT32; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif *idx = 0; move16(); k1 = 0; diff --git a/lib_enc/tns_base_enc_fx.c b/lib_enc/tns_base_enc_fx.c index 11ef9ee70..8a064d28a 100644 --- a/lib_enc/tns_base_enc_fx.c +++ b/lib_enc/tns_base_enc_fx.c @@ -548,6 +548,9 @@ static void GetFilterParameters( Word32 rxx[], Word16 maxOrder, STnsFilter *pTns BASOP_SATURATE_WARNING_OFF_EVS /* Allow saturation, this value is compared against a threshold. */ pTnsFilter->predictionGain = divide3232( L_shr( epsP[0], PRED_GAIN_E ), L_tmp ); BASOP_SATURATE_WARNING_ON_EVS +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } ELSE { diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c index f68923d69..e3032002e 100644 --- a/lib_enc/transient_detection_fx.c +++ b/lib_enc/transient_detection_fx.c @@ -1538,7 +1538,11 @@ void set_transient_stereo_fx( move16(); hCPE->hStereoDft->hItd->currFlatness_fx = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif FOR( n = 0; n < CPE_CHANNELS; n++ ) { hCPE->hStereoDft->hItd->currFlatness_fx = L_max( hCPE->hStereoDft->hItd->currFlatness_fx, currFlatness[n] ); @@ -1549,7 +1553,11 @@ void set_transient_stereo_fx( IF( hCPE->hStereoMdct != NULL ) { hCPE->hStereoMdct->hItd->currFlatness_fx = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif FOR( n = 0; n < CPE_CHANNELS; n++ ) { hCPE->hStereoMdct->hItd->currFlatness_fx = L_max( hCPE->hStereoMdct->hItd->currFlatness_fx, currFlatness[n] ); diff --git a/lib_isar/lib_isar_post_rend.c b/lib_isar/lib_isar_post_rend.c index 5b8dc57a4..f54573045 100644 --- a/lib_isar/lib_isar_post_rend.c +++ b/lib_isar/lib_isar_post_rend.c @@ -1246,11 +1246,34 @@ ivas_error ISAR_POST_REND_SetHeadRotation( ELSE { rotQuat = headRot; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move32(); + move32(); + move32(); + move16(); +#endif } hIvasRend->headRotData.headPositions[sf_idx] = rotQuat; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move32(); + move32(); + move32(); + move16(); +#endif hIvasRend->headRotData.Pos[sf_idx] = Pos; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move32(); + move32(); + move16(); +#endif hIvasRend->headRotData.sr_pose_pred_axis = rot_axis; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_dirac_decorr_dec_fx.c b/lib_rend/ivas_dirac_decorr_dec_fx.c index 792ac76de..beba6bb70 100644 --- a/lib_rend/ivas_dirac_decorr_dec_fx.c +++ b/lib_rend/ivas_dirac_decorr_dec_fx.c @@ -1213,7 +1213,11 @@ static void lattice2allpass_fx( FOR( p = 1; p < filter_length; p++ ) { alpha_real_p_fx[p] = L_shr( lattice_coeffs_fx[( p - 1 )], 3 ); /* Q28 */ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif FOR( i = 1; i < p; i++ ) { diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 234917ce9..99922b9b9 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -1659,7 +1659,11 @@ void protoSignalComputation1_fx( move16(); } +#ifdef FIX_2564_INSTRUMENTATION + idx = shl( l, 1 ); +#else idx = 2 * l; +#endif p_proto_buffer_fx[idx] = RealBuffer_fx[0][0][l]; // q_cldfb move32(); p_proto_buffer_fx[idx + 1] = ImagBuffer_fx[0][0][l]; // q_cldfb @@ -2909,6 +2913,9 @@ void protoSignalComputation4_fx( FOR( l = 0; l < s_min( CLDFB_NO_CHANNELS_HALF, num_freq_bands ); l++ ) { reference_power_fx[l] = W_extract_h( W_shl( ref_pow64[l], sf1 ) ); +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } reference_power_q[0] = sub( add( shl( q_cldfb, 1 ), sf1 ), 31 ); @@ -2916,10 +2923,19 @@ void protoSignalComputation4_fx( FOR( l = CLDFB_NO_CHANNELS_HALF; l < num_freq_bands; l++ ) { reference_power_fx[l] = W_extract_h( W_shl( ref_pow64[l], sf2 ) ); +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } reference_power_q[1] = sub( add( shl( q_cldfb, 1 ), sf2 ), 31 ); +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif min_q_shift = Q31; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /* calculate the shift possible for both RealBuffer_fx and ImagBuffer_fx buffers*/ FOR( k = 0; k < s_max( 4, nchan_transport ); k++ ) { @@ -2982,7 +2998,11 @@ void protoSignalComputation4_fx( { FOR( l = 0; l < num_freq_bands; l++ ) { +#ifdef FIX_2564_INSTRUMENTATION + idx = shl( add( imult1616( k, num_freq_bands ), l ), 1 ); +#else idx = 2 * ( k * num_freq_bands + l ); +#endif sq_tmp_fx = Madd_32_32( Mpy_32_32( proto_frame_f_fx[idx], proto_frame_f_fx[idx] ), proto_frame_f_fx[idx + 1], proto_frame_f_fx[idx + 1] ); // 2*(proto_frame_f_q)-31 sq_tmp_q = sub( add( *proto_frame_f_q, *proto_frame_f_q ), 31 ); diff --git a/lib_rend/ivas_orient_trk_fx.c b/lib_rend/ivas_orient_trk_fx.c index 3c911bd0a..38011d75b 100644 --- a/lib_rend/ivas_orient_trk_fx.c +++ b/lib_rend/ivas_orient_trk_fx.c @@ -137,6 +137,13 @@ void QuaternionProduct_fx( move16(); *r = tmp; +#ifdef FIX_2564_INSTRUMENTATION + move32(); /* r->w_fx */ + move32(); /* r->x_fx */ + move32(); /* r->y_fx */ + move32(); /* r->z_fx */ + move16(); /* r->q_fact */ +#endif return; } diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 50bd990ad..04e659e86 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1379,6 +1379,9 @@ static void set_fft_and_datablock_sizes_fx( const Word16 subframe_len ) { hReverb->full_block_size = subframe_len; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif IF( EQ_16( subframe_len, 240 /*L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES*/ ) ) { hReverb->fft_size = IVAS_REVERB_FFT_SIZE_48K; @@ -1949,9 +1952,17 @@ static void reverb_block_fx( FOR( i = 0; i < inner_bsize; i++ ) { pO0[i] = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif pO1[i] = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } /* feedback network: */ diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index 1b8c9835d..5ff954fe0 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -99,6 +99,10 @@ void ivas_reverb_prepare_cldfb_params( exp_argument_fx = L_shr_sat( exp_argument_fx, sub( 6, tmp_exp ) ); // Q26 /* Limit exponent to approx +/-100 dB in case of incoherent value of delay_diff, to prevent overflow */ +#ifdef FIX_2564_INSTRUMENTATION + exp_argument_fx = L_min( exp_argument_fx, 1543503872 ); + exp_argument_fx = L_max( exp_argument_fx, -1543503872 ); +#else IF( GT_32( exp_argument_fx, 1543503872 ) ) // 23 in Q26 { exp_argument_fx = 1543503872; @@ -107,6 +111,7 @@ void ivas_reverb_prepare_cldfb_params( { exp_argument_fx = -1543503872; } +#endif tmp = Mpy_32_32( 96817114, exp_argument_fx ); // Q21 @@ -118,6 +123,9 @@ void ivas_reverb_prepare_cldfb_params( move32(); pOutput_t60[idx] = output_t60_fx[idx]; // Q26 +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif } ivas_reverb_set_energies( hHrtfStatistics->average_energy_l, hHrtfStatistics->average_energy_r, output_Fs, avg_pwr_left_fx, avg_pwr_right_fx ); // Q28 diff --git a/lib_rend/ivas_td_ring_buffer_fx.c b/lib_rend/ivas_td_ring_buffer_fx.c index 98905d25e..394828c3f 100644 --- a/lib_rend/ivas_td_ring_buffer_fx.c +++ b/lib_rend/ivas_td_ring_buffer_fx.c @@ -103,10 +103,16 @@ static void ivas_td_ringbuf_push_interleaved( if ( EQ_32( h->write_pos, h->capacity ) ) { h->write_pos = 0; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } read_s = L_add( read_s, L_deposit_l( read_stride ) ); +#ifndef FIX_2564_INSTRUMENTATION move32(); +#endif } if ( EQ_32( h->read_pos, h->write_pos ) ) diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 239af0cc5..bbbea070e 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4788,6 +4788,10 @@ ivas_error IVAS_REND_AddInput_fx( return IVAS_ERR_INVALID_INPUT_FORMAT; } +#ifdef FIX_2564_INSTRUMENTATION + move32(); /* maxNumInputsOfType */ +#endif + /* Find first free input in array corresponding to input type */ IF( NE_32( ( error = findFreeInputSlot_fx( inputsArray, inputType, maxNumInputsOfType, &inputIndex ) ), IVAS_ERR_OK ) ) { @@ -5485,6 +5489,13 @@ ivas_error IVAS_REND_GetRenderConfig( } hRCin = hIvasRend->hRendererConfig; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move16(); + move16(); + move16(); + move16(); +#endif hRCout->roomAcoustics.aeID = hRCin->roomAcoustics.aeID; move16(); hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; @@ -5836,8 +5847,17 @@ ivas_error IVAS_REND_SetHeadRotation( } hIvasRend->headRotData.sr_pose_pred_axis = rot_axis; +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#endif hIvasRend->headRotData.Pos[sf_idx] = Pos; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move32(); + move32(); + move16(); +#endif return IVAS_ERR_OK; } @@ -6951,7 +6971,11 @@ static ivas_error renderIsmToBinauralReverb( FOR( Word16 j = 0; j < outAudio.config.numSamplesPerChannel; j++ ) { tmpRendBuffer_fx[i][j] = L_shl( tmpRendBuffer_fx[i][j], 2 ); /* Q(exp + 2) */ +#ifdef FIX_2564_INSTRUMENTATION + move32(); +#else move16(); +#endif } } } @@ -10102,6 +10126,14 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( *poseCorrection = hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode; *pLc3plusHighRes = hIvasRend->hRendererConfig->split_rend_config.lc3plus_highres; +#ifdef FIX_2564_INSTRUMENTATION + move32(); + move16(); + move16(); + move32(); + move16(); +#endif + return IVAS_ERR_OK; } -- GitLab From 498c5869fa7385f1401dca3eeea0b31b099cfced Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Thu, 11 Jun 2026 20:06:11 +0200 Subject: [PATCH 4/9] clang format --- lib_enc/ivas_qmetadata_enc_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index fc56f0653..4d02d5b05 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -5752,7 +5752,7 @@ static Word16 ivas_qmetadata_quantize_coherence_hr_512_fx( static Word64 W_mult0_64_16( Word64 L64_var1, Word16 L16_var2 ) { Word64 L64_result; - + L64_result = W_shl_nosat( W_mult0_32_32( W_extract_h( W_lshl( L64_var1, 1 ) ), L_deposit_l( L16_var2 ) ), 31 ); L64_result = W_add_nosat( L64_result, W_mult0_32_32( L_and( W_extract_l( L64_var1 ), 0x7fffffff ), L_deposit_l( L16_var2 ) ) ); -- GitLab From 941c0c9dac6a2cf82bd7abfe1debcc03f52329a3 Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Tue, 16 Jun 2026 15:02:32 +0200 Subject: [PATCH 5/9] Fix instrumentation issue from #2633 --- lib_rend/ivas_reverb_fx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 04e659e86..d4d19f96e 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1089,7 +1089,11 @@ static ivas_error calc_jot_t60_coeffs_fx( exph = add( e, sub( exph, 15 ) ); e = BASOP_Util_Add_MantExp( lf_target_gain_dB_fx, expl, negate( hf_target_gain_dB_fx ), exph, &tmp_fx ); +#ifdef FIX_2564_INSTRUMENTATION + exp = BASOP_Util_Add_MantExp( hf_target_gain_dB_fx, exph, tmp_fx, sub( e, 1 ), &mid_crossing_gain_dB_fx ); +#else exp = BASOP_Util_Add_MantExp( hf_target_gain_dB_fx, exph, tmp_fx, e - 1, &mid_crossing_gain_dB_fx ); +#endif FOR( f_idx = 1; f_idx < nrFrequencies - 1; f_idx++ ) { -- GitLab From 513c56807b26f180bc5920e5eb4d9d24e68c637e Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Wed, 17 Jun 2026 08:49:02 +0200 Subject: [PATCH 6/9] Correct comment about format (from static analysis). --- lib_enc/ivas_stereo_mdct_igf_enc_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_stereo_mdct_igf_enc_fx.c b/lib_enc/ivas_stereo_mdct_igf_enc_fx.c index e2c5303f7..97bac7382 100644 --- a/lib_enc/ivas_stereo_mdct_igf_enc_fx.c +++ b/lib_enc/ivas_stereo_mdct_igf_enc_fx.c @@ -108,7 +108,7 @@ static Word16 calcCoh_fx( // Q15 move32(); IF( ener1_fx > 0 ) { - *predCoeff = BASOP_Util_Divide3232_Scale( cc_fx, ener1_fx, predCoeff_e ); /* Q31-predCoeff_e */ + *predCoeff = BASOP_Util_Divide3232_Scale( cc_fx, ener1_fx, predCoeff_e ); /* Q15-predCoeff_e */ move32(); *predCoeff_e = add( *predCoeff_e, sub( q_ener1, q_cc ) ); move16(); -- GitLab From dc5f347343011aecf1f4e460cf89cc5707490f6a Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Wed, 17 Jun 2026 08:49:45 +0200 Subject: [PATCH 7/9] Instrumentation: add a few missing move16(). --- lib_dec/ivas_stereo_mdct_stereo_dec_fx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c index 6e5fa6b77..26d59f92b 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c @@ -95,14 +95,23 @@ void parse_stereo_from_bitstream( IF( ( EQ_16( sts[0]->core, TCX_20_CORE ) ) ) { sfbConf = &hStereoMdct->stbParamsTCX20; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } ELSE { sfbConf = &hStereoMdct->stbParamsTCX10; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } if ( sts[0]->last_core_from_bs == ACELP_CORE ) { sfbConf = &hStereoMdct->stbParamsTCX20afterACELP; +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif } IF( hStereoMdct->use_itd ) @@ -110,6 +119,9 @@ void parse_stereo_from_bitstream( Word16 I; hStereoMdct->itd_mode = extract_l( get_next_indice_fx( st0, STEREO_DFT_ITD_MODE_NBITS ) ); /* Q0 */ +#ifdef FIX_2564_INSTRUMENTATION + move16(); +#endif /*(*nb_bits) += STEREO_DFT_ITD_MODE_NBITS;*/ /*ITD mode flag: 1bit*/ hStereoMdct->itd_fx = 0; -- GitLab From 5be39464a61bb37bf11154973095681f11d410bc Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Wed, 17 Jun 2026 09:17:26 +0200 Subject: [PATCH 8/9] clang format --- lib_dec/ivas_stereo_mdct_stereo_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c index 26d59f92b..36bef3019 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c @@ -122,7 +122,7 @@ void parse_stereo_from_bitstream( #ifdef FIX_2564_INSTRUMENTATION move16(); #endif - /*(*nb_bits) += STEREO_DFT_ITD_MODE_NBITS;*/ /*ITD mode flag: 1bit*/ + /*(*nb_bits) += STEREO_DFT_ITD_MODE_NBITS;*/ /*ITD mode flag: 1bit*/ hStereoMdct->itd_fx = 0; move32(); -- GitLab From 2f4a8308bd4e4d60b220d55dd13c80ef83b2c846 Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Thu, 18 Jun 2026 10:54:27 +0200 Subject: [PATCH 9/9] Fix another instrumentation of 64 bit multiplication in ivas_qmetadata_enc_fx.c. --- lib_enc/ivas_qmetadata_enc_fx.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index 4d02d5b05..2360d7632 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -4588,6 +4588,18 @@ static ivas_error write_ec_direction_fx( return IVAS_ERR_OK; } +#ifdef FIX_2564_INSTRUMENTATION +static Word64 W_mult0_64_16( Word64 L64_var1, Word16 L16_var2 ) +{ + Word64 L64_result; + + L64_result = W_shl_nosat( W_mult0_32_32( W_extract_h( W_lshl( L64_var1, 1 ) ), L_deposit_l( L16_var2 ) ), 31 ); + L64_result = W_add_nosat( L64_result, W_mult0_32_32( L_and( W_extract_l( L64_var1 ), 0x7fffffff ), L_deposit_l( L16_var2 ) ) ); + + return L64_result; +} +#endif + /*-----------------------------------------------------------------------* * Local functions (coherence Q and coding) *-----------------------------------------------------------------------*/ @@ -4608,7 +4620,13 @@ static UWord64 create_combined_index_fx( FOR( i = 0; i < len; i++ ) { idx = W_add( idx, base * idx_dct[i] ); +#ifdef FIX_2564_INSTRUMENTATION + assert( base <= (UWord64) MIN_64 ); + base = (UWord64) W_mult0_64_16( (Word64) base, no_cb_vec[i] ); + assert( base <= (UWord64) MIN_64 ); +#else base *= no_cb_vec[i]; +#endif } return idx; @@ -5748,18 +5766,6 @@ static Word16 ivas_qmetadata_quantize_coherence_hr_512_fx( return nbits; } -#ifdef FIX_2564_INSTRUMENTATION -static Word64 W_mult0_64_16( Word64 L64_var1, Word16 L16_var2 ) -{ - Word64 L64_result; - - L64_result = W_shl_nosat( W_mult0_32_32( W_extract_h( W_lshl( L64_var1, 1 ) ), L_deposit_l( L16_var2 ) ), 31 ); - L64_result = W_add_nosat( L64_result, W_mult0_32_32( L_and( W_extract_l( L64_var1 ), 0x7fffffff ), L_deposit_l( L16_var2 ) ) ); - - return L64_result; -} -#endif - /*-------------------------------------------------------------------* * ivas_qmetadata_quantize_coherence() * -- GitLab