diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index 1bd9b1cadd73e4bccb7374fab67b73c914caa68c..60c27808722cc8e99a56afcc0c9fbd40a3ae2bb0 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -127,12 +127,12 @@ char *to_upper( char *str ); void usage_gen_crend_tables( void ); void get_ls_layout_config( AUDIO_CONFIG ls_layout_config, struct ivas_layout_config *ls_struct ); int generate_crend_ivas_tables_from_sofa( const char *sofa_file_path, ConfigReader *cfgReader ); -void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); -void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); +void update_h_file( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); +void update_c_file( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherence, const int32_t samplerate, const int16_t len ); void update_h_file_with_reverb( const int32_t samplerate ); -void update_h_file_fx( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); -void update_c_file_fx( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); +void update_h_file_fx( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); +void update_c_file_fx( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); void update_c_file_with_reverb_fx( int16_t *pEner_l_fx, int16_t *pEner_r_fx, int16_t *pCoherence_fx, int16_t factorQ, const int32_t samplerate, const int16_t len ); void update_h_file_with_reverb_fx( const int32_t samplerate ); int generate_reverb_ivas_tables_from_sofa( const char *file_path ); @@ -140,11 +140,11 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ); extern int32_t float2int32_t( float, int16_t ); extern int16_t float2int16_t( float, int16_t ); -void get_binary_tables_dimensions( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ); -uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims ); -ivas_error make_fx_be( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); +void get_binary_tables_dimensions( HRTFS_CREND_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ); +uint32_t compute_binary_size( HRTFS_CREND_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims ); +ivas_error make_fx_be( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); ivas_error make_reverb_fx_be( float *pEner_l, float *pEner_r, float *pCoherence, const int32_t samplerate, int16_t *factorQ ); -ivas_error write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); +ivas_error write_binary_file( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ); ivas_error write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCoherence, int16_t factorQ, const int32_t samplerate ); /*---------------------------------------------------------------------* @@ -1635,7 +1635,7 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c } } - HRTFS_DATA hrtf_data = { 0 }; + HRTFS_CREND_DATA hrtf_data = { 0 }; int32_t index_start, index_end, max_ir_len; hrtf_data.max_num_ir = ivas_hrtf->m; @@ -2774,7 +2774,7 @@ void update_c_file_with_reverb_fx( int16_t *pEner_l_fx, int16_t *pEner_r_fx, int /*---------------------------------------------------------------------* *update_c_file(); *---------------------------------------------------------------------*/ -void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ) +void update_c_file( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ) { if ( c_file_path == NULL ) @@ -3015,7 +3015,7 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /*---------------------------------------------------------------------* *update_c_file(); *---------------------------------------------------------------------*/ -void update_c_file_fx( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factor_Q[3] ) +void update_c_file_fx( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factor_Q[3] ) { if ( c_file_path_fx == NULL ) @@ -3297,7 +3297,7 @@ void update_h_file_with_reverb( int32_t samplerate ) /*---------------------------------------------------------------------* *update_h_file(); *---------------------------------------------------------------------*/ -void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ) +void update_h_file( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ) { uint16_t i, j; uint32_t *pTotalNumFreqSampPerIterations[2], maxTotalNumFreqSampPerIterations; @@ -3490,7 +3490,7 @@ void update_h_file_with_reverb_fx( int32_t samplerate ) /*---------------------------------------------------------------------* *update_h_file(); *---------------------------------------------------------------------*/ -void update_h_file_fx( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ) +void update_h_file_fx( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ) { uint16_t i, j; uint32_t *pTotalNumFreqSampPerIterations[2], maxTotalNumFreqSampPerIterations; @@ -3650,7 +3650,7 @@ void update_h_file_fx( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const /*---------------------------------------------------------------------* * get_tables_dimensions(); *---------------------------------------------------------------------*/ -void get_binary_tables_dimensions( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ) +void get_binary_tables_dimensions( HRTFS_CREND_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ) { int16_t iIR, iIter, iChan; uint32_t total_num_fsamp_per_iteration, total_num_fsamp_per_iteration_diff; @@ -3713,7 +3713,7 @@ void get_binary_tables_dimensions( HRTFS_DATA *hrtf, crend_hrtf_tables_dimension /*---------------------------------------------------------------------* * compute_binary_size(); *---------------------------------------------------------------------*/ -uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims ) +uint32_t compute_binary_size( HRTFS_CREND_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims ) { int16_t iIR, iIter, iChan; uint32_t hrtf_data_size; @@ -3780,7 +3780,7 @@ uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hr /*---------------------------------------------------------------------* * make_fx_be(); *---------------------------------------------------------------------*/ -ivas_error make_fx_be( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ) +ivas_error make_fx_be( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ) { int16_t iIR, iIter, iChan, iTap; uint32_t data_size_tmp; @@ -4060,7 +4060,7 @@ ivas_error make_fx_be( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const /*---------------------------------------------------------------------* * write_binary_file(); *---------------------------------------------------------------------*/ -ivas_error write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ) +ivas_error write_binary_file( HRTFS_CREND_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len, int16_t factorQ[3] ) { FILE *output_binary_file; diff --git a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c index 98b3413a958601a32b96e1ef8234ed8a4c02be30..c50d1c13fc98da91d1bcb130fda673083ed3812e 100644 --- a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c +++ b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c @@ -137,7 +137,7 @@ static void printMatrix_int32_t(int32_t** buf, int32_t size1, int32_t size2) static void printfAudioBufferOutFilterParams( - HRTFS_DATA *pParam, + HRTFS_CREND_DATA *pParam, int32_t index_start, int32_t index_end ) { @@ -199,7 +199,7 @@ int16_t float2int16_t( float val, int16_t Q ) } ivas_error ivas_hrtf_close( - HRTFS_HANDLE hHRTF /* i/o: HRTF handle */ + HRTFS_CREND_HANDLE hHRTF /* i/o: HRTF handle */ ) { int16_t i, j; @@ -279,7 +279,7 @@ static void FFT_Complex_to_Mag( * @param pFirData : source ptr to ivas_hrtf_t struct * @param framelen : size of the blocks linked to sample rate and fft size * @param framelen : index of channel LFE if any. if no LFE channel set the value to -1 - * @param pParam : dest ptr to a HRTFS_DATA struct for storing computed params + * @param pParam : dest ptr to a HRTFS_CREND_DATA struct for storing computed params * * @return 0 if no error, 1 otherwise */ @@ -287,7 +287,7 @@ static void FFT_Complex_to_Mag( ivas_error ivas_crend_binaural_filter_design_compute_filters_params( ivas_hrtf_t *pFirData, const int16_t framelen, - HRTFS_DATA *pParam, + HRTFS_CREND_DATA *pParam, int32_t *index_start, int32_t *index_end, int32_t *max_ir_len, @@ -700,8 +700,8 @@ ivas_error ivas_crend_binaural_filter_design_compute_filters_params( * * @param pFirData : source ptr to ivas_hrtf_t struct * @param framelen : size of the blocks linked to sample rate and fft size - * @param pParam : dest ptr to a HRTFS_DATA struct for storing computed params - * @param pParam : dest ptr to a HRTFS_DATA struct for storing computed params + * @param pParam : dest ptr to a HRTFS_CREND_DATA struct for storing computed params + * @param pParam : dest ptr to a HRTFS_CREND_DATA struct for storing computed params * @param index_start : index of first sample to use in IRs * @param index_end : index of first sample to use in IRs * @param *max_ir_len : return max if length @@ -713,7 +713,7 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( ivas_hrtf_t *pFirData, const int16_t frame_len, float mdft_scale_fact, - HRTFS_DATA *pParam, + HRTFS_CREND_DATA *pParam, int32_t index_start, int32_t index_end, int32_t *max_ir_len, @@ -1322,12 +1322,12 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( * ivas_hrtf_t **hrtf * * Outputs - - * HRTFS_DATA *crend_hrtf + * HRTFS_CREND_DATA *crend_hrtf * *-----------------------------------------------------------------------------------------*/ ivas_error ivas_set_hrtf_fr( - HRTFS_DATA *crend_hrtf, + HRTFS_CREND_DATA *crend_hrtf, ivas_hrtf_t *hrtf, const int16_t output_frame, float mdft_scale_fact ) @@ -1418,12 +1418,12 @@ ivas_error ivas_set_hrtf_fr( * ivas_hrtf_t **hrtf * * Outputs - - * HRTFS_DATA *crend_hrtf + * HRTFS_CREND_DATA *crend_hrtf *-----------------------------------------------------------------------------------------*/ ivas_error ivas_get_hrtf_lens( ivas_hrtf_t *hrtf, - HRTFS_DATA *crend_hrtf, + HRTFS_CREND_DATA *crend_hrtf, const int16_t frame_len ) { int32_t i, j, k, tmp_ir_len; diff --git a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h index 60937969e9f7045089166ffe162c648b3154129f..d6e77bdefdff3986d79c2380ffc3506f7849a19b 100644 --- a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h +++ b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h @@ -36,10 +36,10 @@ #include "ivas_stat_dec.h" #include "config_reader.h" -#define IVAS_SOFA_MAX_VAL_M ( 16 ) -#define IVAS_SOFA_MAX_VAL_R ( 2 ) -#define IVAS_SOFA_MAX_VAL_N ( 48000 ) -#define IVAS_SOFA_MAX_VAL_I ( 1 ) +#define IVAS_SOFA_MAX_VAL_M ( 16 ) +#define IVAS_SOFA_MAX_VAL_R ( 2 ) +#define IVAS_SOFA_MAX_VAL_N ( 48000 ) +#define IVAS_SOFA_MAX_VAL_I ( 1 ) #define IVAS_MAX_HRTF_LATENCY_MS ( 0.1 ) /* max hrtf latency */ typedef struct ivas_hrtf_t @@ -57,21 +57,12 @@ typedef struct ivas_hrtf_t * function declarations *------------------------------------------------------------------------------------------*/ -ivas_error ivas_get_hrtf_lens( ivas_hrtf_t *hrtf, HRTFS_DATA *crend_hrtf, const int16_t frame_len ); -ivas_error ivas_set_hrtf_fr( HRTFS_DATA *crend_hrtf, ivas_hrtf_t *hrtf, const int16_t frame_len - , - float mdft_scale_fact -); +ivas_error ivas_get_hrtf_lens( ivas_hrtf_t *hrtf, HRTFS_CREND_DATA *crend_hrtf, const int16_t frame_len ); +ivas_error ivas_set_hrtf_fr( HRTFS_CREND_DATA *crend_hrtf, ivas_hrtf_t *hrtf, const int16_t frame_len, float mdft_scale_fact ); -ivas_error ivas_crend_binaural_filter_design_compute_filters_params( ivas_hrtf_t *pFirData, const int16_t framelen, HRTFS_DATA *pParam, int32_t *index_start, int32_t *index_end, int32_t *max_ir_len, ConfigReader *cfgReader ); -ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( ivas_hrtf_t *pFirData, const int16_t frame_len, - float mdft_scale_fact, - HRTFS_DATA *pParam, - int32_t index_start, - int32_t index_end, - int32_t *max_ir_len, - ConfigReader *cfgReader ); +ivas_error ivas_crend_binaural_filter_design_compute_filters_params( ivas_hrtf_t *pFirData, const int16_t framelen, HRTFS_CREND_DATA *pParam, int32_t *index_start, int32_t *index_end, int32_t *max_ir_len, ConfigReader *cfgReader ); +ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( ivas_hrtf_t *pFirData, const int16_t frame_len, float mdft_scale_fact, HRTFS_CREND_DATA *pParam, int32_t index_start, int32_t index_end, int32_t *max_ir_len, ConfigReader *cfgReader ); -ivas_error ivas_hrtf_close( HRTFS_HANDLE hHRTF ); +ivas_error ivas_hrtf_close( HRTFS_CREND_HANDLE hHRTF ); #endif /* IVAS_SOFA_PARSER_H_ */