diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 074b6d8845ceb7c405735fba0914e1a3b2aa6330..5645b8e9bf46fa6b5903314d7975da46e8f52d1f 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -40,20 +40,13 @@ #include "stat_enc.h" #include "stat_dec.h" #include "stat_com.h" -#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H #ifdef FIX_197_CREND_INTERFACE #include "ivas_stat_rend.h" #endif -#endif #include "ivas_stat_enc.h" #include "ivas_stat_dec.h" #include "ivas_stat_com.h" #include "ivas_error_utils.h" -#ifdef FIX_197_CREND_INTERFACE -#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H -#include "lib_rend.h" -#endif -#endif /* clang-format off */ @@ -5428,9 +5421,8 @@ ivas_error ivas_crend_process( float output[][L_FRAME48k] /* i/o: input/output audio channels */ ); -#else /* FIX_197_CREND_INTERFACE */ +#else -#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H IVAS_REND_AudioConfigType getAudioConfigType( const IVAS_REND_AudioConfig config ); @@ -5440,30 +5432,19 @@ ivas_error getAudioConfigNumChannels( IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( AUDIO_CONFIG config ); -#endif /* FIX_197_CREND_INTERFACE_LIB_REND_H */ ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - const AUDIO_CONFIG inConfig, - const AUDIO_CONFIG outConfig, -#else const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#endif RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, const int32_t output_Fs ); ivas_error ivas_rend_openCrend( CREND_WRAPPER_HANDLE *pCrend, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - const AUDIO_CONFIG inConfig, - const AUDIO_CONFIG outConfig, -#else const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#endif RENDER_CONFIG_DATA *hRendCfg, int16_t Opt_Headrotation, HRTFS_CREND_HANDLE hSetOfHRTF, @@ -5478,13 +5459,8 @@ ivas_error ivas_rend_closeCrend( ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - const AUDIO_CONFIG inConfig, - const AUDIO_CONFIG outConfig, -#else const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#endif DECODER_CONFIG_HANDLE hDecoderConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_OUTPUT_SETUP_HANDLE hIntSetup, diff --git a/lib_com/options.h b/lib_com/options.h index f3074839fec3198965acfef4628791d90597d373..a5a6a8cfb8f734aef92e375d3cafc964d6a18e4e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,10 +150,6 @@ #define FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE -#define FIX_197_CREND_INTERFACE_LIB_REND_H -#endif - #define FIX_MEMORY_COUNTING_HRTF_BINARY_FILE #define FIX_334_DEBUG_BE_STEREO_SWITCHING /* FhG: Fix non-BE issue for stereo switching when DEBUGGING is enabled */ #define FIX_198_TDREND_INTERFACE /* Issue 198: Harmonize interface for TD renderer between decoder and external renderer */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index e1337204908eba9f0fbc1ab05a5db068742aab03..384baa0bb26482918c2e122394c771f8658c6294 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -209,13 +209,8 @@ ivas_error ivas_dec( { #ifdef FIX_197_CREND_INTERFACE if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - AUDIO_CONFIG_7_1_4, - AUDIO_CONFIG_BINAURAL_ROOM, -#else IVAS_REND_AUDIO_CONFIG_7_1_4, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM, -#endif NULL, NULL, NULL, @@ -427,14 +422,8 @@ ivas_error ivas_dec( { #ifdef FIX_197_CREND_INTERFACE if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - st_ivas->intern_config, - st_ivas->hOutSetup.output_config, -#else getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hOutSetup.output_config ), - -#endif st_ivas->hDecoderConfig, st_ivas->hHeadTrackData, &st_ivas->hIntSetup, diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d9cb37f6ddcb287eb5a60e285c8b2d5703f1f27d..dd094892e3694f5ef90b20e6fcbc74c4f03344f5 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1249,13 +1249,8 @@ ivas_error ivas_init_decoder( } if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - st_ivas->intern_config, - st_ivas->hDecoderConfig->output_config, -#else getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ), -#endif st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 60121fcbae7c038ed310a4f70ad2a197bf1b2bd2..f2f008ff376d28c7ba1f4d0b3fa772df42a493b7 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -1087,13 +1087,8 @@ static ivas_error ivas_ism_bitrate_switching( /* Open Crend Binaural renderer */ #ifdef FIX_197_CREND_INTERFACE if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - st_ivas->intern_config, - st_ivas->hOutSetup.output_config, -#else getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hOutSetup.output_config ), -#endif st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hSetOfHRTF, diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 72a2fcacbba49ccae7184561c310aa03b9b8642e..9c8e6407841d1cf2415f332ab4a5855c76797f82 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1158,13 +1158,8 @@ static ivas_error ivas_mc_dec_reconfig( else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - st_ivas->intern_config, - st_ivas->hDecoderConfig->output_config, -#else getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ), -#endif st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index d13849a60c45bfdf978ad4d43c1797818d1e6603..a78f747b6a3495be691f12e4beca64b5c0896792 100755 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -40,13 +40,16 @@ #include "ivas_cnst.h" #include "ivas_stat_com.h" #include "ivas_stat_rend.h" +#ifndef FIX_197_CREND_INTERFACE #include "common_api_types.h" // VE2AT: don't we want to avoid this include in the library? I admit that the rules hefre are not 100% clear to me but introducing it just for IVAS_QUATERNION is not necessry I think +#endif + +#ifndef FIX_197_CREND_INTERFACE + /*----------------------------------------------------------------------------------* * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) *----------------------------------------------------------------------------------*/ -#if !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H - typedef struct ivas_output_setup_structure { AUDIO_CONFIG output_config; @@ -825,7 +828,7 @@ typedef struct ivas_spar_md_dec_state_t int16_t spar_hoa_md_flag; } ivas_spar_md_dec_state_t; -#if !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H +#ifndef FIX_197_CREND_INTERFACE /* AGC structure */ typedef struct ivas_agc_dec_chan_state_t @@ -865,7 +868,7 @@ typedef struct ivas_td_decorr_state_t } ivas_td_decorr_state_t; -#endif /* !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H */ +#endif /* PCA structure */ typedef struct @@ -998,7 +1001,7 @@ typedef struct mct_dec_data_structure } MCT_DEC_DATA, *MCT_DEC_HANDLE; -#if !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H +#ifndef FIX_197_CREND_INTERFACE /*----------------------------------------------------------------------------------* * EFAP structures @@ -1187,7 +1190,7 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; -#if !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H +#ifndef FIX_197_CREND_INTERFACE /*----------------------------------------------------------------------------------* * Binaural Rendering structure @@ -1512,7 +1515,6 @@ typedef struct TDREND_HRFILT_FiltSet_struct ModelEval_t ModelEval; ModelParamsITD_t ModelParamsITD; TDREND_HRFILT_Method_t FilterMethod; /* HR filtering method */ - float latency_s; } TDREND_HRFILT_FiltSet_t; @@ -1820,20 +1822,6 @@ typedef struct ivas_hrtfs_file_header_t } ivas_hrtfs_file_header_t; -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H -#ifdef FIX_197_CREND_INTERFACE - -/* Main Crend wrapper structure */ -typedef struct ivas_binaural_crend_wrapper_struct -{ - int32_t binaural_latency_ns; - CREND_HANDLE hCrend; - HRTFS_HANDLE hHrtfCrend; -} CREND_WRAPPER, *CREND_WRAPPER_HANDLE; - -#endif /* FIX_197_CREND_INTERFACE */ -#endif /* FIX_197_CREND_INTERFACE_LIB_REND_H */ - /*----------------------------------------------------------------------------------* * LFE decoder structure *----------------------------------------------------------------------------------*/ @@ -1903,8 +1891,7 @@ typedef struct decoder_config_structure } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; -#endif /* !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H */ - +#endif /*----------------------------------------------------------------------------------* * * Main IVAS decoder structure diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 2ddb2f642cbc282d91a26d9f9b8b0e8dc8652dec..f3ea41f08156d92ad28ddefe55f2640feb425742 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -36,15 +36,9 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "ivas_rom_rend.h" -#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H #include "ivas_stat_dec.h" -#endif #include #include "ivas_rom_binaural_crend_head.h" -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H -#include "lib_rend.h" -#include "ivas_lib_rend_internal.h" -#else #ifdef FIX_197_CREND_INTERFACE #include "ivas_stat_rend.h" #include "lib_rend.h" @@ -52,7 +46,6 @@ #include "lib_rend.h" #include "ivas_lib_rend_internal.h" #endif -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -1463,13 +1456,8 @@ ivas_error ivas_crend_process( ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - const AUDIO_CONFIG inIvasConfig, - const AUDIO_CONFIG outIvasConfig, -#else const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#endif RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, const int32_t output_Fs ) @@ -1480,15 +1468,8 @@ ivas_error ivas_rend_initCrend( IVAS_REND_AudioConfigType inConfigType; HRTFS_HANDLE hHrtf; ivas_error error; -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - IVAS_REND_AudioConfig inConfig; - IVAS_REND_AudioConfig outConfig; - inConfig = getRendAudioConfigFromIvasAudioConfig( inIvasConfig ); - outConfig = getRendAudioConfigFromIvasAudioConfig( outIvasConfig ); -#endif inConfigType = getAudioConfigType( inConfig ); - hHrtf = pCrend->hHrtfCrend; /* Do all error checks up front so that the nested if later is easier */ @@ -1522,6 +1503,7 @@ ivas_error ivas_rend_initCrend( } #endif + if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) { return error; @@ -1998,13 +1980,8 @@ ivas_error ivas_rend_openCrend( #else CREND_WRAPPER *pCrend, #endif -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - const AUDIO_CONFIG inConfig, - const AUDIO_CONFIG outConfig, -#else const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#endif RENDER_CONFIG_DATA *hRendCfg, #ifdef FIX_197_CREND_INTERFACE int16_t Opt_Headrotation, @@ -2179,11 +2156,7 @@ ivas_error ivas_rend_openCrend( if ( ( hRendCfg != NULL ) && ( hRendCfg->roomAcoustics.late_reverb_on ) ) { if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - inConfig, -#else getIvasAudioConfigFromRendAudioConfig( inConfig ), -#endif #ifdef FIX_197_CREND_INTERFACE ( *pCrend )->hHrtfCrend, #else @@ -2535,13 +2508,8 @@ static ivas_error ivas_rend_crendConvolver( ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - const AUDIO_CONFIG inConfig, - const AUDIO_CONFIG outConfig, -#else const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#endif #ifdef FIX_197_CREND_INTERFACE DECODER_CONFIG_HANDLE hDecoderConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, @@ -2561,24 +2529,12 @@ ivas_error ivas_rend_crendProcess( AUDIO_CONFIG in_config; IVAS_REND_AudioConfigType inConfigType; ivas_error error; -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - IVAS_REND_AudioConfig inRendConfig; - IVAS_REND_AudioConfig outRendConfig; - inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig ); - outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig ); -#endif push_wmops( "ivas_rend_crendProcess" ); -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig ); - inConfigType = getAudioConfigType( inRendConfig ); - getAudioConfigNumChannels( outRendConfig, &nchan_out ); -#else in_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); inConfigType = getAudioConfigType( inConfig ); getAudioConfigNumChannels( outConfig, &nchan_out ); -#endif output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); #ifdef FIX_197_CREND_INTERFACE subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; @@ -2625,11 +2581,7 @@ ivas_error ivas_rend_crendProcess( if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, output, pcm_tmp, output_Fs, subframe_idx ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, output, pcm_tmp, output_Fs, subframe_idx ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_lib_rend_internal.h b/lib_rend/ivas_lib_rend_internal.h index a4951fedd84ae1860bd79c401110d25bbc5dbee1..60d6ed7b51694d234b9154b21f9e2fce31823b97 100644 --- a/lib_rend/ivas_lib_rend_internal.h +++ b/lib_rend/ivas_lib_rend_internal.h @@ -30,30 +30,18 @@ *******************************************************************************************************/ -#ifndef IVAS_LIB_REND_INTERNALS_H -#define IVAS_LIB_REND_INTERNALS_H - -#include "options.h" #include "ivas_error.h" - -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H -#include "lib_rend.h" -#include "ivas_cnst.h" -#include -#include "ivas_stat_dec.h" - -#else /* FIX_197_CREND_INTERFACE_LIB_REND_H */ - #ifdef FIX_197_CREND_INTERFACE #include "ivas_stat_rend.h" -#else /* FIX_197_CREND_INTERFACE */ +#else #include "lib_rend.h" -#endif /* FIX_197_CREND_INTERFACE */ - +#endif #include "ivas_stat_dec.h" -#endif /* FIX_197_CREND_INTERFACE_LIB_REND_H */ +#ifndef IVAS_LIB_REND_INTERNALS_H +#define IVAS_LIB_REND_INTERNALS_H +#ifndef FIX_197_CREND_INTERFACE typedef struct { int8_t headRotEnabled; @@ -68,8 +56,6 @@ typedef struct TDREND_HRFILT_FiltSet_t *hHrtfTD; } TDREND_WRAPPER; -#ifndef FIX_197_CREND_INTERFACE - typedef struct { int32_t binaural_latency_ns; @@ -77,8 +63,6 @@ typedef struct HRTFS_HANDLE hHrtfCrend; } CREND_WRAPPER; -#endif - IVAS_REND_AudioConfigType getAudioConfigType( const IVAS_REND_AudioConfig config ); @@ -86,16 +70,9 @@ ivas_error getAudioConfigNumChannels( const IVAS_REND_AudioConfig config, int16_t *numChannels ); -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H -IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( - AUDIO_CONFIG config ); -#endif - AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( IVAS_REND_AudioConfig config ); -#ifndef FIX_197_CREND_INTERFACE - ivas_error ivas_rend_openCrend( CREND_WRAPPER *pCrend, const IVAS_REND_AudioConfig inConfig, diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index fd3bcde641704e739ec53a77af740a9b09837a36..e57044930ec037e3743140f736e76639a17e67d5 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -34,76 +34,6 @@ #define IVAS_STAT_REND_H #include -#include "options.h" -#include "ivas_cnst.h" - -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - -#define MAX_SPEAKERS 12 /* Max number of speakers (including LFE) in a channel-based config */ - -/*----------------------------------------------------------------------------------* - * Loudspeaker Configuration Conversion structure - *----------------------------------------------------------------------------------*/ - -typedef struct ivas_LS_setupconversion_struct -{ - float *dmxMtx[MAX_OUTPUT_CHANNELS]; - float *targetEnergyPrev[MAX_OUTPUT_CHANNELS]; - float *dmxEnergyPrev[MAX_OUTPUT_CHANNELS]; - int16_t sfbOffset[MAX_SFB + 2]; - int16_t sfbCnt; - -} LSSETUP_CONVERSION_STRUCT, *LSSETUP_CONVERSION_HANDLE; - - -typedef struct ivas_LS_setupconversion_matrix -{ - int16_t index; - float value; -} LS_CONVERSION_MATRIX; - -typedef struct ivas_LS_setupconversion_mapping -{ - AUDIO_CONFIG input_config; - AUDIO_CONFIG output_config; - const LS_CONVERSION_MATRIX *conversion_matrix; -} LS_CONVERSION_MAPPING; - -typedef struct ivas_mono_downmix_renderer_struct -{ - float inputEnergy[CLDFB_NO_CHANNELS_MAX]; - float protoEnergy[CLDFB_NO_CHANNELS_MAX]; - -} MONO_DOWNMIX_RENDERER_STRUCT, *MONO_DOWNMIX_RENDERER_HANDLE; - - -/*----------------------------------------------------------------------------------* - * Custom Loudspeaker configuration structure - *----------------------------------------------------------------------------------*/ - -typedef struct ivas_LS_setup_custom -{ - int16_t is_planar_setup; /* flag to indicate if setup is planar or not */ - int16_t num_spk; /* number of custom loudspeakers */ - float ls_azimuth[MAX_OUTPUT_CHANNELS]; /* custom loudspeaker azimuths */ - float ls_elevation[MAX_OUTPUT_CHANNELS]; /* custom loudspeaker elevations */ - int16_t num_lfe; /* number of LFE channels */ - int16_t lfe_idx[MAX_OUTPUT_CHANNELS]; /* index for LFE channel insertion */ - int16_t separate_ch_found; /* flag to indicate if a center channel was found */ - float separate_ch_gains[MAX_OUTPUT_CHANNELS]; /* gains to pan McMASA separateChannel in case no center channel is present */ - -} LSSETUP_CUSTOM_STRUCT, *LSSETUP_CUSTOM_HANDLE; - -/* Channel types in a channel-based config */ -typedef enum -{ - CHANNEL_TYPE_UNUSED = 0, - CHANNEL_TYPE_SPEAKER, - CHANNEL_TYPE_LFE -} ChannelType; - -#else - #ifdef FIX_197_CREND_INTERFACE #include "cnst.h" #include "ivas_cnst.h" @@ -209,8 +139,6 @@ typedef struct float lfeOutputGains[IVAS_MAX_INPUT_LFE_CHANNELS][IVAS_MAX_OUTPUT_CHANNELS]; } IVAS_REND_LfeRouting; -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - typedef struct { int8_t headRotEnabled; @@ -218,7 +146,6 @@ typedef struct float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; } IVAS_REND_HeadRotData; -#endif /*----------------------------------------------------------------------------------* * Binaural Rendering structure *----------------------------------------------------------------------------------*/ @@ -1117,16 +1044,12 @@ typedef struct decoder_config_structure } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - typedef struct { int32_t binaural_latency_ns; BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd; TDREND_HRFILT_FiltSet_t *hHrtfTD; } TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE; - -#endif #endif /*----------------------------------------------------------------------------------* @@ -1190,6 +1113,4 @@ typedef enum CHANNEL_TYPE_LFE } ChannelType; -#endif - #endif /* IVAS_STAT_REND_H */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 300130bcfe72f8f9e3702722a6d7587d3ce6e567..ed0039296446039c96b3e4b4ece03caaa99731e0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -38,6 +38,9 @@ #include "ivas_rom_dec.h" #include "ivas_rom_rend.h" #include "ivas_lib_rend_internal.h" +#ifdef FIX_197_CREND_INTERFACE +#include "lib_rend.h" +#endif #include "prot.h" #include "wmc_auto.h" @@ -1061,13 +1064,8 @@ static ivas_error setRendInputActiveIsm( else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) { error = ivas_rend_openCrend( &inputIsm->crendWrapper, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - AUDIO_CONFIG_7_1_4, - getIvasAudioConfigFromRendAudioConfig( outConfig ), -#else IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, -#endif hRendCfg, #ifdef FIX_197_CREND_INTERFACE 0, @@ -1771,13 +1769,8 @@ static ivas_error initMcBinauralRendering( { if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - getIvasAudioConfigFromRendAudioConfig( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_REND_AUDIO_CONFIG_7_1_4 : inConfig ), - getIvasAudioConfigFromRendAudioConfig( outConfig ), -#else ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_REND_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, -#endif hRendCfg, #ifdef FIX_197_CREND_INTERFACE 0, @@ -2054,11 +2047,7 @@ static ivas_error updateSbaPanGains( { case IVAS_REND_AUDIO_CONFIG_BINAURAL: #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - error = ivas_rend_openCrend( &inputSba->crendWrapper, getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, 0, -#else error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, 0, -#endif NULL, *rendCtx.pOutSampleRate ); #else @@ -2073,11 +2062,7 @@ static ivas_error updateSbaPanGains( return error; } #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - error = ivas_rend_openCrend( &inputSba->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, 0, -#else error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, 0, -#endif NULL, *rendCtx.pOutSampleRate ); #else @@ -4131,11 +4116,7 @@ static ivas_error renderIsmToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, NULL, NULL, NULL, NULL, tmpCrendBuffer, *ismInput->base.ctx.pOutSampleRate ); -#else ivas_rend_crendProcess( ismInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM, NULL, NULL, NULL, NULL, tmpCrendBuffer, *ismInput->base.ctx.pOutSampleRate ); -#endif #else ivas_rend_crendProcess( &ismInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM, tmpCrendBuffer, *ismInput->base.ctx.pOutSampleRate ); #endif @@ -4441,11 +4422,7 @@ static ivas_error renderMcToBinaural( /* call CREND */ #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, mcInput->base.inConfig, outConfig, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -4501,11 +4478,7 @@ static ivas_error renderMcToBinauralRoom( /* call CREND */ #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, mcInput->base.inConfig, outConfig, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -4576,11 +4549,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( /* call CREND */ #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -4812,11 +4781,7 @@ static ivas_error renderSbaToBinaural( /* call CREND */ #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -4880,11 +4845,7 @@ static ivas_error renderSbaToBinauralRoom( /* call CREND */ #ifdef FIX_197_CREND_INTERFACE -#ifdef FIX_197_CREND_INTERFACE_LIB_REND_H - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #else if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -5290,3 +5251,23 @@ int32_t IVAS_REND_GetCntFramesLimited( return hIvasRend->hLimiter->cnt_frames_limited; } #endif + +#ifdef FIX_197_CREND_INTERFACE +ivas_error ivas_rend_initEfap( + AUDIO_CONFIG outConfig, + EFAP_HANDLE *hEfap ) +{ + ivas_error err; + IVAS_REND_AudioConfig audioCfg; + EFAP_WRAPPER wrap; + LSSETUP_CUSTOM_STRUCT customLsOut; + wrap.hEfap = NULL; + wrap.pCustomLsSetup = NULL; + audioCfg = getRendAudioConfigFromIvasAudioConfig( outConfig ); + memset( &customLsOut, 0, sizeof( LSSETUP_CUSTOM_STRUCT ) ); + err = initEfap( &wrap, audioCfg, &customLsOut ); + *hEfap = wrap.hEfap; + + return err; +} +#endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 789b426070aa29ed24638ecf77f23458ea50ba73..b2ca45c70c5e877cc5d123d74b8baaf0af112b20 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -40,8 +40,7 @@ #include "options.h" #include "common_api_types.h" #include "ivas_error.h" - -#if defined FIX_197_CREND_INTERFACE && !defined FIX_197_CREND_INTERFACE_LIB_REND_H +#ifdef FIX_197_CREND_INTERFACE #include "ivas_stat_rend.h" #endif @@ -50,7 +49,7 @@ #define RENDERER_MAX_SBA_INPUTS 1 #define RENDERER_MAX_MASA_INPUTS 1 -#if !defined FIX_197_CREND_INTERFACE || defined FIX_197_CREND_INTERFACE_LIB_REND_H +#ifndef FIX_197_CREND_INTERFACE #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 @@ -140,25 +139,12 @@ typedef enum typedef uint16_t IVAS_REND_InputId; -#endif -#ifndef FIX_197_CREND_INTERFACE_LIB_REND_H -#ifdef FIX_197_CREND_INTERFACE +#else + AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( IVAS_REND_AudioConfig config ); -IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( - AUDIO_CONFIG config ); -#endif - -#ifdef FIX_197_CREND_INTERFACE -IVAS_REND_AudioConfigType getAudioConfigType( - const IVAS_REND_AudioConfig config ); - -ivas_error getAudioConfigNumChannels( - const IVAS_REND_AudioConfig config, - int16_t *numChannels ); -#endif #endif /* clang-format off */ @@ -305,6 +291,12 @@ int32_t IVAS_REND_GetCntFramesLimited( ); #endif +#ifdef FIX_197_CREND_INTERFACE +ivas_error ivas_rend_initEfap( + AUDIO_CONFIG outConfig, + EFAP_HANDLE *hEfap + ); +#endif /* clang-format on */ #endif