From 4c0ab9cfe2d604beba01b5e632996ed3886b1bc6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 19 Jun 2026 13:51:05 +0200 Subject: [PATCH] BE improvements on ivas_ism_dec_digest_tc_fx() --- lib_com/options.h | 1 + lib_dec/ivas_ism_param_dec_fx.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5d42aebc4..32bbbe693 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -86,6 +86,7 @@ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */ #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_2648_IVAS_ISM_DEC_DIGEST_TC /* FhG: improvements on ivas_ism_dec_digest_tc_fx() */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 4a00c193c..74ce0273d 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -947,13 +947,26 @@ void ivas_ism_dec_digest_tc_fx( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { Word16 i; +#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC + Word16 output_frame; +#endif /* we have a full frame interpolator, adapt it */ /* for BE testing */ +#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC + output_frame = extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ); + IF( EQ_16( output_frame, st_ivas->hTcBuffer->n_samples_available ) ) +#else i = extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ); IF( EQ_16( i, st_ivas->hTcBuffer->n_samples_available ) ) +#endif { +#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC + Word16 interpolator_length = output_frame; + move16(); +#else Word16 interpolator_length = i; +#endif test(); test(); @@ -985,7 +998,11 @@ void ivas_ism_dec_digest_tc_fx( } ELSE { +#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC + ivas_dec_get_adapted_linear_interpolator_fx( output_frame, st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator_fx ); +#else ivas_dec_get_adapted_linear_interpolator_fx( extract_l( Mpy_32_32( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator_fx ); +#endif move16(); } @@ -1001,13 +1018,17 @@ void ivas_ism_dec_digest_tc_fx( { Word16 gains_fx[CPE_CHANNELS]; +#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC + ivas_ism_get_stereo_gains_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &gains_fx[0], &gains_fx[1] ); // gains_fx[]: Q15 +#else ivas_ism_get_stereo_gains_fx( (Word16) L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ), (Word16) L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ), &gains_fx[0], &gains_fx[1] ); +#endif st_ivas->hIsmRendererData->gains_fx[i][0] = L_shr( L_deposit_h( gains_fx[0] ), 1 ); // Q31 -> Q30 move32(); st_ivas->hIsmRendererData->gains_fx[i][1] = L_shr( L_deposit_h( gains_fx[1] ), 1 ); // Q31 -> Q30 move32(); - // TODO: Align Q values + IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], CPE_CHANNELS ); // Q30, Q29 --> Q28 -- GitLab