From 4e4af9478b122981d14b117e8d492819ac3d2e24 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 26 Feb 2026 16:03:24 +0100 Subject: [PATCH 1/2] remove tcx_ari_res_Q_spec_ivas_fx(), which is not needed --- lib_com/options.h | 1 + lib_enc/cod_tcx_fx.c | 4 ++++ lib_enc/prot_fx_enc.h | 3 ++- lib_enc/tcx_utils_enc_fx.c | 8 ++++++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 02e0476f5..0eb72bea6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -97,6 +97,7 @@ #define FIX_2431_AVOID_CALLOC /* VA: basp issue 2431: avoid use of calloc() */ #define FIX_2424_REMOVE_GAUSS_L2_ENC /* VA: basop issue 2424: Remove duplicated code in gauss_L2_ivas_fx() */ #define FIX_MDCT_STEREO_ENC_STACK /* VA: basop issue 2428: Move IGF temporary buffers out of the highest stack */ +#define FIX_FLOAT_1535_ARI_RES_Q_CLEANUP /* FhG: remove dead code from tcx_ari_res_Q_spec() */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 111805d42..f5ab18d7e 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -3570,7 +3570,11 @@ void QuantizeTCXSpectrum_fx( prm_resq = sqQ + sub( sqTargetBits, resQTargetBits ); +#ifdef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP + resQBits = tcx_ari_res_Q_spec_fx( x_orig_fx, x_orig_e, hm_cfg->indexBuffer, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, prm_resq, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx ); +#else resQBits = tcx_ari_res_Q_spec_ivas_fx( x_orig_fx, x_orig_e, hm_cfg->indexBuffer, spectrum_fx, *spectrum_e, L_spec, *gain_tcx_fx, *gain_tcx_e, prm_resq, resQTargetBits, resQBits, st->hTcxCfg->sq_rounding, lf_deemph_fact_fx ); +#endif /* Transmit zeros when there bits remain after RESQ */ FOR( i = resQBits; i < resQTargetBits; ++i ) diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 153c24b36..5cb7852cd 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -1311,6 +1311,7 @@ Word16 tcx_ari_res_Q_spec_fx( const Word16 x_fac[] /* i : spectrum post-quantization factors Q14 */ ); +#ifndef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP Word16 tcx_ari_res_Q_spec_ivas_fx( const Word32 x_orig[], /* i : original spectrum Q31-e */ Word16 x_orig_e, /* i : original spectrum exponent Q0 */ @@ -1326,7 +1327,7 @@ Word16 tcx_ari_res_Q_spec_ivas_fx( Word16 deadzone, /* i : quantizer deadzone Q15 */ const Word16 x_fac[] /* i : spectrum post-quantization factors Q14 */ ); - +#endif Word16 tcx_res_Q_gain_fx( Word16 sqGain, Word16 sqGain_e, diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 01fe7c1d5..6e6a9586b 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -2996,6 +2996,10 @@ Word16 tcx_ari_res_Q_spec_fx( num_zeros = 0; move16(); +#ifdef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP + assert( x_fac != NULL ); +#endif + s = sub( add( gain_e, x_Q_e ), x_orig_e ); FOR( i = 0; i < L_frame; i++ ) { @@ -3097,7 +3101,7 @@ Word16 tcx_ari_res_Q_spec_fx( return bits; } - +#ifndef FIX_FLOAT_1535_ARI_RES_Q_CLEANUP Word16 tcx_ari_res_Q_spec_ivas_fx( const Word32 x_orig[], /* i : original spectrum Q31-e */ Word16 x_orig_e, /* i : original spectrum exponent Q0 */ @@ -3328,7 +3332,7 @@ Word16 tcx_ari_res_Q_spec_ivas_fx( return bits; } - +#endif #define kMaxEstimatorOvershoot 5 #define kMaxEstimatorUndershoot 0 -- GitLab From 2f6d7b7234cc842b28fe43a78bb86f4d325bc681 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 4 Mar 2026 10:22:18 +0100 Subject: [PATCH 2/2] empty commit -- GitLab