From 50f8a10dfbc69c41a406ff1632d5d22897fc3d29 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 7 Mar 2025 11:55:29 +0100 Subject: [PATCH] port FIX_910_REMOVE_DUPLICATION_TD_REND --- lib_com/ivas_prot.h | 4 +-- lib_com/ivas_prot_fx.h | 36 +++++++++++++++++++------- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 2 ++ lib_dec/ivas_objectRenderer_internal.c | 4 +-- lib_dec/ivas_output_config.c | 4 +++ 6 files changed, 38 insertions(+), 13 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 1e7c52df5..da337a8c9 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4010,13 +4010,13 @@ void ivas_omasa_modify_masa_energy_ratios( /*----------------------------------------------------------------------------------* * TD Binaural Object renderer *----------------------------------------------------------------------------------*/ - +#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND ivas_error ivas_td_binaural_renderer( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame /* i : output frame length */ ); - +#endif ivas_error ivas_td_binaural_renderer_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[], /* i/o: SCE channels / Binaural synthesis */ diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index fea1ff7e4..f277f9166 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -46,6 +46,12 @@ #include "ivas_stat_com.h" #include "ivas_error_utils.h" +/* clang-format off */ + +/*----------------------------------------------------------------------------------* + * General IVAS prototypes + *----------------------------------------------------------------------------------*/ + ivas_error ivas_masa_dec_open_fx( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ); @@ -165,11 +171,6 @@ ivas_error ivas_omasa_dec_config_fx( Word16 SrcInd[MAX_NUM_TDREND_CHANNELS], Word16 *data /* o : output synthesis signal */ ); -ivas_error ivas_td_binaural_renderer_sf_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *output_fx[], /* i/o: SCE channels / Binaural synthesis */ - const Word16 n_samples_granularity /* i : granularity of the renderer/buffer */ -); void ivas_omasa_modify_masa_energy_ratios_fx( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ @@ -3894,16 +3895,33 @@ void ivas_omasa_decode_masa_to_total_fx( const Word16 nblocks ); -ivas_error ivas_td_binaural_open_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word16 *SrcInd, /*Temporarily used to store the updated value of SrcInd*/ - Word16 *num_src ); +/*----------------------------------------------------------------------------------* + * TD Binaural Object renderer + *----------------------------------------------------------------------------------*/ +ivas_error ivas_td_binaural_open_fx( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Word16 *SrcInd, /*Temporarily used to store the updated value of SrcInd*/ + Word16 *num_src +); +#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND ivas_error ivas_td_binaural_renderer_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Word32 *output[], /* i/o: SCE channels / Binaural synthesis */ const Word16 output_frame /* i : output frame length */ ); +#endif + +ivas_error ivas_td_binaural_renderer_sf_fx( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Word32 *output_fx[], /* i/o: SCE channels / Binaural synthesis */ + const Word16 n_samples_granularity /* i : granularity of the renderer/buffer */ +); + + +/*----------------------------------------------------------------------------------* + * Filter-bank (FB) Mixer + *----------------------------------------------------------------------------------*/ void ivas_FB_mixer_close_fx( IVAS_FB_MIXER_HANDLE *hFbMixer, /* i/o: FB mixer handle */ diff --git a/lib_com/options.h b/lib_com/options.h index 8eb059537..6c92cf55d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,7 @@ #define SPLIT_REND_POSE_CORRECTION_UNUSED_BITS #define ISAR_BITSTREAM_UPDATE_LC3PLUS /* FhG: Multiple improvements to the ISAR bitstream when LC3plus is used. See MR 1456 for details. */ #endif +#define FIX_910_REMOVE_DUPLICATION_TD_REND /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index cf98199b2..b331a2b84 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -2477,6 +2477,7 @@ ivas_error ivas_jbm_dec_render_fx( { ivas_mc2sba_fx( st_ivas->hIntSetup, p_output_fx, p_output_fx, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0 ); } +#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) { IF( NE_32( ( error = ivas_td_binaural_renderer_fx( st_ivas, p_output_fx, *nSamplesRendered ) ), IVAS_ERR_OK ) ) @@ -2486,6 +2487,7 @@ ivas_error ivas_jbm_dec_render_fx( ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_output_fx, p_output_fx ); } +#endif } ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMMC ) ) { diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 98d9c73fc..03fd3dfe6 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -64,7 +64,7 @@ ivas_error ivas_td_binaural_open_fx( return ivas_td_binaural_open_unwrap_fx( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, *num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity_fx, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns, SrcInd ); } - +#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND /*---------------------------------------------------------------------* * ivas_td_binaural_renderer() * @@ -108,7 +108,7 @@ ivas_error ivas_td_binaural_renderer_fx( } return ivas_td_binaural_renderer_unwrap_fx( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, st_ivas->hCombinedOrientationData, ism_md_subframe_update, output, output_frame, MAX_PARAM_SPATIAL_SUBFRAMES ); } - +#endif /*---------------------------------------------------------------------* * ivas_td_binaural_renderer_sf() diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index b8691bd3d..81214744b 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -248,8 +248,12 @@ void ivas_renderer_select( test(); test(); test(); +#ifdef FIX_910_REMOVE_DUPLICATION_TD_REND + IF( ( EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_7_1 ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) ) +#else test(); IF( ( EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_7_1 ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && ( EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) || EQ_32( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) ) ) +#endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; move16(); -- GitLab