diff --git a/lib_com/options.h b/lib_com/options.h index 339ca8a072e6bfbbc0539befe0c85289645c5e8f..a5263a49211ffedee314a98108f9e2301f19e86d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -88,6 +88,7 @@ #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 HARMONIZE_2502_GENERATE_COMFORT_NOISE_DEC /* FhG: harmonize generate_comfort_noise_dec_fx() and generate_comfort_noise_dec_ivas_fx() */ #define FIX_BASOP_2650_DEC_PRM_TCX /* FhG: Simplify calculation of st->bits_frame_core in dec_prm_tcx(), align function name to float */ +#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 4a00c193c703a89fbfffcba56ee390a324ee8a8a..74ce0273dd8d6cbc2618b5a17f6c4516c9ada97e 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