diff --git a/apps/renderer.c b/apps/renderer.c index 1fb83acc5ae1689af041495acb51c5cd2e031916..dec564b69cffa5ae939825db969b01cf2583456f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -663,8 +663,8 @@ int main( RotFileReader *headRotReader = NULL; RotFileReader *externalOrientationFileReader = NULL; RotFileReader *referenceRotReader = NULL; - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS]; - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS]; + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS]; + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_INPUT_CHANNELS]; int16_t cldfb_in_flag, CLDFBframeSize_smpls; SplitRendBFIFileReader *splitRendBFIReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL; @@ -3739,7 +3739,7 @@ static ivas_error parseLfePanMtxFile( { int16_t i, lfe_in, ch_out; const char *tok; - char line[200]; /* > (10 chars * IVAS_MAX_OUTPUT_CHANNELS) i.e. "-999, " */ + char line[200]; /* > (10 chars * RENDERER_MAX_OUTPUT_CHANNELS) i.e. "-999, " */ FILE *mtxFile; if ( strlen( lfeRoutingMatrixFilePath ) < 1 ) @@ -3758,7 +3758,7 @@ static ivas_error parseLfePanMtxFile( any subsequent issue in file reading will gracefully exit the function */ for ( lfe_in = 0; lfe_in < RENDERER_MAX_INPUT_LFE_CHANNELS; lfe_in++ ) { - for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) + for ( i = 0; i < RENDERER_MAX_OUTPUT_CHANNELS; i++ ) { ( *lfePanMtx )[lfe_in][i] = 0.0f; } @@ -3786,7 +3786,7 @@ static ivas_error parseLfePanMtxFile( { continue; } - if ( ch_out > IVAS_MAX_OUTPUT_CHANNELS ) + if ( ch_out > RENDERER_MAX_OUTPUT_CHANNELS ) { break; } @@ -3827,13 +3827,13 @@ static void convertInputBuffer( if ( cldfb_in_flag ) { int16_t slotIdx, numCldfbBands, numFloatPcmSamples; - float fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE]; + float fIn[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE]; numFloatPcmSamples = numFloatSamplesPerChannel >> 1; numCldfbBands = numFloatPcmSamples / IVAS_CLDFB_NO_COL_MAX; /* CLDFB Analysis*/ - assert( numIntSamplesPerChannel <= IVAS_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE ); + assert( numIntSamplesPerChannel <= RENDERER_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE ); for ( smpl = 0; smpl < numFloatPcmSamples; ++smpl ) { for ( chnl = 0; chnl < numChannels; ++chnl ) @@ -3908,9 +3908,9 @@ static void convertOutputBuffer( if ( cldfb_in_flag ) { int16_t slotIdx, numCldfbBands, numPcmSamples, b; - float fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE]; - float re[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX]; - float im[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX]; + float fIn[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE]; + float re[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX]; + float im[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX]; numPcmSamples = numSamplesPerChannel >> 1; numCldfbBands = numPcmSamples / IVAS_CLDFB_NO_COL_MAX; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index dd1f707ffb1ba7b4780b49a37617a37f4c9aa1fc..f5b13c0dea05c0ffb7dec08f670352afe428112d 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -50,8 +50,7 @@ #define IVAS_MAX_BITS_PER_FRAME ( 512000 / IVAS_NUM_FRAMES_PER_SEC ) /* maximum bits per frame; corresponds to maximum bitrate of 512 kbps */ #define IVAS_MAX_NUM_OBJECTS 4 -#define IVAS_MAX_INPUT_CHANNELS 16 -#define IVAS_MAX_OUTPUT_CHANNELS 16 /* Note: there is an exception for OSBA and EXT otuput where it can be 20 (HOA3 + 4 ISM channels) */ +#define IVAS_MAX_LS_CHANNELS 16 #define IVAS_CLDFB_NO_COL_MAX 16 #define IVAS_CLDFB_NO_CHANNELS_MAX 60 @@ -190,10 +189,10 @@ typedef struct ivas_LS_setup_custom IVAS_LSSETUP_CUSTOM_STRUCT; typedef struct _IVAS_LS_CUSTOM_LAYOUT { int16_t num_spk; - float azimuth[IVAS_MAX_OUTPUT_CHANNELS]; - float elevation[IVAS_MAX_OUTPUT_CHANNELS]; + float azimuth[IVAS_MAX_LS_CHANNELS]; + float elevation[IVAS_MAX_LS_CHANNELS]; int16_t num_lfe; - int16_t lfe_idx[IVAS_MAX_OUTPUT_CHANNELS]; + int16_t lfe_idx[IVAS_MAX_LS_CHANNELS]; } IVAS_CUSTOM_LS_DATA; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 155fa08eb26d50163fe4597ad345fff3c49c2a83..61639537644a4c4759ab36713d9610a278688aa0 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -128,12 +128,12 @@ typedef enum * IVAS general constants *----------------------------------------------------------------------------------*/ -#define MAX_INPUT_CHANNELS 16 /* Maximum number of input channels (HOA 3rd order), == IVAS_MAX_INPUT_CHANNELS */ +#define MAX_INPUT_CHANNELS 16 /* Maximum number of input channels (HOA 3rd order or IVAS_MAX_LS_CHANNELS) without separate objects in combined formats */ #define MAX_TRANSPORT_CHANNELS 12 /* Maximum number of transport channels */ #define MAX_INTERN_CHANNELS 16 /* Maximum number of intern channels (HOA 3rd order) */ #define HEAD_ROTATION_HOA_ORDER 3 /* HOA 3rd order */ -#define MAX_CICP_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts)*/ -#define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order) without separate objects in combined formats */ +#define MAX_LS_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts), == IVAS_MAX_LS_CHANNELS */ +#define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order or IVAS_MAX_LS_CHANNELS) without separate objects in combined formats */ #define MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN 2 /* Maximum number of output channels with non diegetic panning */ #define BINAURAL_CHANNELS 2 /* number of channels for binaural output configuration */ @@ -1505,7 +1505,7 @@ typedef enum * TD Binaural Object renderer *----------------------------------------------------------------------------------*/ -#define MAX_NUM_TDREND_CHANNELS MAX_CICP_CHANNELS /* max. number of channels in TD renderer (objects or loudspeaker channels) */ +#define MAX_NUM_TDREND_CHANNELS MAX_LS_CHANNELS /* max. number of channels in TD renderer (objects or loudspeaker channels) */ #define SFX_SPAT_BIN_MAX_NO_OF_OUTPUT_SAMPLES 288 /* 288 = 6 msec @ 48 kHz. */ #define HRTF_MODEL_N_SECTIONS 3 /* No. sections used in approximate evaluation of model */ @@ -1608,7 +1608,7 @@ typedef enum #define IVAS_MAX_FB_MIXER_OUT_CH IVAS_SPAR_MAX_CH #define IVAS_MAX_SPAR_FB_MIXER_IN_CH IVAS_SPAR_MAX_CH -#define IVAS_MAX_FB_MIXER_IN_CH MAX_CICP_CHANNELS +#define IVAS_MAX_FB_MIXER_IN_CH MAX_LS_CHANNELS #define MAX_NUM_BANDS_DIFF_NON48K 3 diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index ab7f7362b5c3e226cc15776af2c8b77de7922650..8121030b1cc0ab67501bcbcfef1eb162098942ac 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5304,9 +5304,9 @@ void ivas_ls_setup_conversion_process_mdct_param_mc( void ivas_lssetupconversion_process_param_mc( Decoder_Struct *st_ivas, /* i/o: LS setup conversion renderer handle */ const int16_t num_timeslots, /* i : number of time slots to process */ - float Cldfb_RealBuffer_InOut[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ - float Cldfb_ImagBuffer_InOut[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ - int16_t channel_active[MAX_CICP_CHANNELS] /* i : bitmap indicating which output channels are active */ + float Cldfb_RealBuffer_InOut[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ + float Cldfb_ImagBuffer_InOut[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ + int16_t channel_active[MAX_LS_CHANNELS] /* i : bitmap indicating which output channels are active */ ); diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 7d84b0a739b693fa261eb70795f245ac8097c545..237583bb589061e11db0b5fd7d0259ecf8605907 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1826,7 +1826,7 @@ const int16_t param_mc_coding_band_mapping_10[10] = 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; -const int16_t Param_MC_index[MAX_CICP_CHANNELS] = +const int16_t Param_MC_index[MAX_LS_CHANNELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 3bf30289b6e030df649a25d4c8d91e10ef8bf17c..c68e16ba9af30cb5ae1938ad35098899261479c2 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -219,7 +219,7 @@ extern const int16_t param_mc_start_bin_per_band_14[14]; extern const int16_t param_mc_active_bins_per_band_14[14]; extern const int16_t param_mc_start_bin_per_band_10[10]; extern const int16_t param_mc_active_bins_per_band_10[10]; -extern const int16_t Param_MC_index[MAX_CICP_CHANNELS]; +extern const int16_t Param_MC_index[MAX_LS_CHANNELS]; extern const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS]; extern const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS]; extern const float ivas_param_mc_quant_icc[PARAM_MC_SZ_ICC_QUANTIZER]; diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 80b28d63d63ff614dc63d7d335250d47c37d42db..18697006c2b827a7c6c45c87f306a9a6f0b9de13 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -561,9 +561,9 @@ typedef struct ivas_param_mc_ild_mapping_struct { int16_t ild_map_size_wo_lfe; int16_t ild_map_size_lfe; - int16_t ild_index[MAX_CICP_CHANNELS]; - int16_t num_ref_channels[MAX_CICP_CHANNELS]; - int16_t ref_channel_idx[MAX_CICP_CHANNELS][PARAM_MC_MAX_ILD_REF_CHANNELS]; + int16_t ild_index[MAX_LS_CHANNELS]; + int16_t num_ref_channels[MAX_LS_CHANNELS]; + int16_t ref_channel_idx[MAX_LS_CHANNELS][PARAM_MC_MAX_ILD_REF_CHANNELS]; } PARAM_MC_ILD_MAPPING, *HANDLE_PARAM_MC_ILD_MAPPING; diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index 68f7f9ed258bd8354744649602e641c0ad1384c7..bfad98855652ac814e84714f048e3b1b64261784 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -380,25 +380,25 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot( ) { int16_t param_band_idx, band, ch_idx; - float mixing_matrix_smooth[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float mixing_matrix_res_smooth[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float mixing_matrix_buffer[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; + float mixing_matrix_smooth[MAX_LS_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; + float mixing_matrix_res_smooth[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; + float mixing_matrix_buffer[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; int16_t have_residual; float input_f_real[PARAM_MC_MAX_TRANSPORT_CHANS]; float input_f_imag[PARAM_MC_MAX_TRANSPORT_CHANS]; - float output_f_real[MAX_CICP_CHANNELS]; - float output_f_imag[MAX_CICP_CHANNELS]; - float diff_f_real[MAX_CICP_CHANNELS]; - float diff_f_imag[MAX_CICP_CHANNELS]; + float output_f_real[MAX_LS_CHANNELS]; + float output_f_imag[MAX_LS_CHANNELS]; + float diff_f_real[MAX_LS_CHANNELS]; + float diff_f_imag[MAX_LS_CHANNELS]; int16_t brange[2]; DIRAC_OUTPUT_SYNTHESIS_COV_STATE h_synthesis_state = hParamMC->h_output_synthesis_cov_state; set_zero( input_f_real, PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( input_f_imag, PARAM_MC_MAX_TRANSPORT_CHANS ); - set_zero( output_f_real, MAX_CICP_CHANNELS ); - set_zero( output_f_imag, MAX_CICP_CHANNELS ); - set_zero( diff_f_real, MAX_CICP_CHANNELS ); - set_zero( diff_f_imag, MAX_CICP_CHANNELS ); + set_zero( output_f_real, MAX_LS_CHANNELS ); + set_zero( output_f_imag, MAX_LS_CHANNELS ); + set_zero( diff_f_real, MAX_LS_CHANNELS ); + set_zero( diff_f_imag, MAX_LS_CHANNELS ); for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 1c9870433a9d271f0cf647a5e9a020f1a4783b37..9b63388afde95f0a97783a5fd663827b5812ae2f 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1376,7 +1376,7 @@ ivas_error ivas_jbm_dec_flush_renderer( int16_t n_slots_still_available; int16_t n_samples_to_render; DECODER_TC_BUFFER_HANDLE hTcBuffer; - float *p_output[MAX_CICP_CHANNELS + MAX_NUM_OBJECTS]; + float *p_output[MAX_LS_CHANNELS + MAX_NUM_OBJECTS]; if ( !st_ivas->hDecoderConfig->Opt_tsm ) { diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 2bf96ca0342b3abbbac647a9b5811b2016fed073..ed7c9fb0b4838961b52c6acc6fe3aa07d9931205 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -78,7 +78,7 @@ static void ivas_param_mc_dec_init( PARAM_MC_DEC_HANDLE hParamMC, const int16_t static void param_mc_protoSignalComputation( float *RealBuffer, float *ImagBuffer, float *proto_frame_f, const PARAM_MC_DIFF_PROTO_INFO *diff_proto_info, const int16_t num_freq_bands ); -static void ivas_param_mc_dec_copy_diffuse_proto( PARAM_MC_DEC_HANDLE hParamMC, float Cldfb_buffer_real[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float Cldfb_buffer_imag[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t nY, const int16_t slot_idx ); +static void ivas_param_mc_dec_copy_diffuse_proto( PARAM_MC_DEC_HANDLE hParamMC, float Cldfb_buffer_real[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float Cldfb_buffer_imag[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], const int16_t nY, const int16_t slot_idx ); static int16_t ivas_param_mc_range_decoder_LC( uint16_t *bit_buffer, int16_t *x, int16_t *BER_detect, const int16_t sz_seq, const int16_t sz_alphabet, const uint16_t *cft, const uint16_t *sft, const int16_t tot_shift, const int16_t nbbits ); @@ -114,7 +114,7 @@ ivas_error ivas_param_mc_dec_open( PARAM_MC_DEC_HANDLE hParamMC; int16_t nchan_out_transport; int16_t nchan_out_cov; - float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; + float proto_matrix[MAX_LS_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; float proto_mtx_norm; int16_t max_param_band_residual; uint16_t config_index; @@ -552,7 +552,7 @@ ivas_error ivas_param_mc_dec_reconfig( PARAM_MC_DEC_HANDLE hParamMC; int16_t nchan_out_transport; int16_t nchan_out_cov; - float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; + float proto_matrix[MAX_LS_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; float proto_mtx_norm; int16_t max_param_band_residual; uint16_t config_index; @@ -888,9 +888,9 @@ ivas_error ivas_param_mc_dec_reconfig( { DIRAC_OUTPUT_SYNTHESIS_COV_STATE cov_state_old = hParamMC->h_output_synthesis_cov_state; DIRAC_OUTPUT_SYNTHESIS_PARAMS params_old = hParamMC->h_output_synthesis_params; - float tmp_buf[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; + float tmp_buf[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; - set_zero( tmp_buf, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); + set_zero( tmp_buf, MAX_LS_CHANNELS * MAX_LS_CHANNELS ); /* output synthesis */ if ( ( error = ivas_dirac_dec_output_synthesis_cov_open( &( hParamMC->h_output_synthesis_params ), &( hParamMC->h_output_synthesis_cov_state ), hParamMC->max_band_decorr, PARAM_MC_MAX_NSLOTS, @@ -1389,7 +1389,7 @@ void ivas_param_mc_dec_prepare_renderer( push_wmops( "param_mc_dec_digest_tc" ); - set_s( channel_active, 0, MAX_CICP_CHANNELS ); + set_s( channel_active, 0, MAX_LS_CHANNELS ); nchan_transport = st_ivas->nchan_transport; nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; @@ -1558,7 +1558,7 @@ void ivas_param_mc_dec_render( float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; /*Decorrelator*/ - float onset_filter[MAX_CICP_CHANNELS * CLDFB_NO_CHANNELS_MAX]; + float onset_filter[MAX_LS_CHANNELS * CLDFB_NO_CHANNELS_MAX]; /* format converter */ int16_t channel_active[MAX_OUTPUT_CHANNELS]; uint16_t nband_synth, nbands_to_zero; @@ -1570,7 +1570,7 @@ void ivas_param_mc_dec_render( push_wmops( "param_mc_dec_render" ); - set_s( channel_active, 0, MAX_CICP_CHANNELS ); + set_s( channel_active, 0, MAX_LS_CHANNELS ); nchan_transport = st_ivas->nchan_transport; nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; nchan_out_init = nchan_out_transport; @@ -1976,11 +1976,11 @@ static void param_mc_protoSignalComputation( *------------------------------------------------------------------------*/ static void ivas_param_mc_dec_copy_diffuse_proto( - PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ - float Cldfb_buffer_real[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : CLDFB buffer used in the final synthesis (real part) */ - float Cldfb_buffer_imag[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : CLDFB buffer used in the final synthesis (imaginary part) */ - const int16_t nY, /* i : number of decorrelated channels */ - const int16_t slot_idx /* i : current time slot index */ + PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ + float Cldfb_buffer_real[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : CLDFB buffer used in the final synthesis (real part) */ + float Cldfb_buffer_imag[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* o : CLDFB buffer used in the final synthesis (imaginary part) */ + const int16_t nY, /* i : number of decorrelated channels */ + const int16_t slot_idx /* i : current time slot index */ ) { int16_t k, l; @@ -2219,18 +2219,18 @@ static void ivas_param_mc_get_mixing_matrices( ) { float Cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float Cy[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float Cy_diag[MAX_CICP_CHANNELS]; - float Cr[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float Cproto_diag[MAX_CICP_CHANNELS]; - float Cproto[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float mat_mult_buffer1[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; + float Cy[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; + float Cy_diag[MAX_LS_CHANNELS]; + float Cr[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; + float Cproto_diag[MAX_LS_CHANNELS]; + float Cproto[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; + float mat_mult_buffer1[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; float *Cx_state; float *Cx_old_state; - float Cy_state[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; + float Cy_state[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; float *Cy_old_state; int16_t nY_band; - float proto_matrix_noLFE[PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS]; + float proto_matrix_noLFE[PARAM_MC_MAX_TRANSPORT_CHANS * MAX_LS_CHANNELS]; float *proto_matrix_ptr; int16_t num_lfe_bands; int16_t brange[2]; @@ -2238,15 +2238,15 @@ static void ivas_param_mc_get_mixing_matrices( int16_t ch_idx1, ch_idx2, lfe_idx1, lfe_idx2; float *ptrMM; float *ptrMM_out; - float Cy_full[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float mixing_matrix_local[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float mixing_matrix_res_local[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; + float Cy_full[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; + float mixing_matrix_local[MAX_LS_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; + float mixing_matrix_res_local[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; int16_t remove_lfe; int16_t lfe_indices[PARAM_MC_LOCAL_SZ_LFE_MAP]; - set_zero( Cproto, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); - set_zero( mat_mult_buffer1, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); - set_zero( proto_matrix_noLFE, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS ); + set_zero( Cproto, MAX_LS_CHANNELS * MAX_LS_CHANNELS ); + set_zero( mat_mult_buffer1, MAX_LS_CHANNELS * MAX_LS_CHANNELS ); + set_zero( proto_matrix_noLFE, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_LS_CHANNELS ); nY_band = nY_cov; num_lfe_bands = 0; @@ -2266,7 +2266,7 @@ static void ivas_param_mc_get_mixing_matrices( lfe_indices[hSynthesisOutputSetup->num_lfe + 1] = nY_cov; proto_matrix_ptr = &proto_matrix_noLFE[0]; proto_matrix_ptr_in = &hParamMC->h_output_synthesis_params.proto_matrix[0]; - set_zero( proto_matrix_noLFE, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS ); + set_zero( proto_matrix_noLFE, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_LS_CHANNELS ); for ( ch_idx1 = 0; ch_idx1 < nX; ch_idx1++ ) { @@ -2589,12 +2589,12 @@ static void ivas_param_mc_dequantize_cov( if ( synth_conf == PARAM_MC_SYNTH_LS_CONV_COV ) { /* Cy = dmx*Cy*dmx' */ - float mat_mult_buffer1[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float target_ch_ener[MAX_CICP_CHANNELS]; - float dmx_ch_ener[MAX_CICP_CHANNELS]; + float mat_mult_buffer1[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; + float target_ch_ener[MAX_LS_CHANNELS]; + float dmx_ch_ener[MAX_LS_CHANNELS]; - set_zero( target_ch_ener, MAX_CICP_CHANNELS ); - set_zero( dmx_ch_ener, MAX_CICP_CHANNELS ); + set_zero( target_ch_ener, MAX_LS_CHANNELS ); + set_zero( dmx_ch_ener, MAX_LS_CHANNELS ); matrix_product( hParamMC->ls_conv_dmx_matrix, nY_cov, nY_int, 0, Cy_state_int, nY_int, nY_int, 0, @@ -2705,7 +2705,7 @@ static ivas_error param_mc_get_diff_proto_info( PARAM_MC_DIFF_PROTO_INFO *p_diff_proto_info /* o : generated diffuse prototype info */ ) { - float proto_fac[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; + float proto_fac[MAX_LS_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; uint16_t cur_out_ch; uint16_t cur_diff_proto; uint16_t cur_transport_ch; @@ -2713,7 +2713,7 @@ static ivas_error param_mc_get_diff_proto_info( /* Initializations */ max_num_src_chan = 0; - set_zero( proto_fac, MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS ); + set_zero( proto_fac, MAX_LS_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS ); if ( ( p_diff_proto_info->proto_index_diff = (int16_t *) malloc( nchan_out_cov * sizeof( int16_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC\n" ) ); diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 3371c6554c96a40071aa61fe7e2c60c948fa0e45..6d406fccc1b3961b9c01a534b6a021f6c5dae36c 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -212,7 +212,7 @@ ivas_error ivas_mct_dec( else if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { - float *x_all[MAX_CICP_CHANNELS][NB_DIV]; + float *x_all[MAX_LS_CHANNELS][NB_DIV]; for ( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index f897ad87b7a6dc00af7ce8d957f49278053b6c0f..08d9d260543fe5d0894ff6fb3dc19b00b8aa6411 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -348,7 +348,7 @@ ivas_error ivas_ls_setup_conversion_open( set_f( hLsSetUpConversion->targetEnergyPrev[chIdx], 0.0f, hLsSetUpConversion->sfbCnt ); set_f( hLsSetUpConversion->dmxEnergyPrev[chIdx], 0.0f, hLsSetUpConversion->sfbCnt ); } - for ( ; chIdx < MAX_CICP_CHANNELS; chIdx++ ) + for ( ; chIdx < MAX_LS_CHANNELS; chIdx++ ) { hLsSetUpConversion->targetEnergyPrev[chIdx] = NULL; hLsSetUpConversion->dmxEnergyPrev[chIdx] = NULL; @@ -383,7 +383,7 @@ ivas_error ivas_ls_setup_conversion_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LS configuration Conversion Handle \n" ) ); } - for ( chIdx = 1; chIdx < MAX_CICP_CHANNELS; chIdx++ ) + for ( chIdx = 1; chIdx < MAX_LS_CHANNELS; chIdx++ ) { hLsSetUpConversion->targetEnergyPrev[chIdx] = NULL; hLsSetUpConversion->dmxEnergyPrev[chIdx] = NULL; @@ -404,7 +404,7 @@ ivas_error ivas_ls_setup_conversion_open( set_zero( hLsSetUpConversion->dmxMtx[chIdx], outChannels ); } - for ( ; chIdx < MAX_CICP_CHANNELS; chIdx++ ) + for ( ; chIdx < MAX_LS_CHANNELS; chIdx++ ) { hLsSetUpConversion->dmxMtx[chIdx] = NULL; } @@ -464,7 +464,7 @@ void ivas_ls_setup_conversion_close( return; } - for ( idx = 0; idx < MAX_CICP_CHANNELS; idx++ ) + for ( idx = 0; idx < MAX_LS_CHANNELS; idx++ ) { if ( ( *hLsSetUpConversion )->dmxMtx[idx] != NULL ) { @@ -571,17 +571,17 @@ void ivas_ls_setup_conversion_process_mdct( /* Declaration of all required variables */ int16_t i, bandIdx, chInIdx, chOutIdx, cpe_idx, subFrameIdx, binIdx, idx; int16_t inChannels, outChannels, num_CPE; - int16_t transform_type[MAX_CICP_CHANNELS][2]; + int16_t transform_type[MAX_LS_CHANNELS][2]; int16_t frameSize; float targetEnergy[MAX_SFB + 2], dmxEnergy[MAX_SFB + 2]; float dmxCoeff; float dmxSignalReal[L_FRAME48k], dmxSignalImag[L_FRAME48k]; float eqGain; - float *sig[NB_DIV], *pTmp[NB_DIV], *x[MAX_CICP_CHANNELS][NB_DIV]; + float *sig[NB_DIV], *pTmp[NB_DIV], *x[MAX_LS_CHANNELS][NB_DIV]; float mdst[L_FRAME48k]; float convertRes[L_FRAME48k]; int16_t start, stop, start_tcx5, stop_tcx5; - int16_t mct_chan_mode[MAX_CICP_CHANNELS]; + int16_t mct_chan_mode[MAX_LS_CHANNELS]; /* Declare all handles */ LSSETUP_CONVERSION_HANDLE hLsSetUpConversion; @@ -812,20 +812,20 @@ void ivas_ls_setup_conversion_process_mdct_param_mc( int16_t band, bandIdx, num_bands; int16_t num_CPE; - int16_t transform_type[MAX_CICP_CHANNELS][2]; + int16_t transform_type[MAX_LS_CHANNELS][2]; int16_t frameSize; float targetEnergy[MAX_SFB + 2], dmxEnergy[MAX_SFB + 2]; float eqGain; - float *sig[MAX_CICP_CHANNELS][NB_DIV], *pTmp[NB_DIV]; - float mdst[MAX_CICP_CHANNELS][L_FRAME48k]; - float convertRes[MAX_CICP_CHANNELS][L_FRAME48k]; + float *sig[MAX_LS_CHANNELS][NB_DIV], *pTmp[NB_DIV]; + float mdst[MAX_LS_CHANNELS][L_FRAME48k]; + float convertRes[MAX_LS_CHANNELS][L_FRAME48k]; int16_t start, stop, start_tcx5, stop_tcx5; - int16_t mct_chan_mode[MAX_CICP_CHANNELS]; + int16_t mct_chan_mode[MAX_LS_CHANNELS]; float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float cy[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; + float cy[MAX_LS_CHANNELS * MAX_LS_CHANNELS]; float real_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * PARAM_MC_BAND_TO_MDCT_BAND_RATIO * MAX_TRANSPORT_CHANNELS]; float imag_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * PARAM_MC_BAND_TO_MDCT_BAND_RATIO * MAX_TRANSPORT_CHANNELS]; float real_buffer[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -970,7 +970,7 @@ void ivas_ls_setup_conversion_process_mdct_param_mc( for ( bandIdx = 0; bandIdx < hLsSetUpConversion->sfbCnt; bandIdx++ ) { DMXEne = 0.0f; - set_zero( cy, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); + set_zero( cy, MAX_LS_CHANNELS * MAX_LS_CHANNELS ); set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); set_zero( target_ch_ener, MAX_OUTPUT_CHANNELS ); @@ -1135,19 +1135,19 @@ void ivas_ls_setup_conversion_process_mdct_param_mc( void ivas_lssetupconversion_process_param_mc( Decoder_Struct *st_ivas, /* i/o: LS setup conversion renderer handle */ const int16_t num_timeslots, - float Cldfb_RealBuffer_InOut[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ - float Cldfb_ImagBuffer_InOut[MAX_CICP_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ - int16_t channel_active[MAX_CICP_CHANNELS] /* i : bitmap indicating which output channels are active */ + float Cldfb_RealBuffer_InOut[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ + float Cldfb_ImagBuffer_InOut[MAX_LS_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* i/o: LS signals */ + int16_t channel_active[MAX_LS_CHANNELS] /* i : bitmap indicating which output channels are active */ ) { int16_t slotIdx, chOutIdx, chInIdx, bandIdx; int16_t inChannels, outChannels; - float targetEnergy[MAX_CICP_CHANNELS][CLDFB_NO_CHANNELS_MAX]; - float dmxEnergy[MAX_CICP_CHANNELS][CLDFB_NO_CHANNELS_MAX]; + float targetEnergy[MAX_LS_CHANNELS][CLDFB_NO_CHANNELS_MAX]; + float dmxEnergy[MAX_LS_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float tmpDMXSig, dmxCoeff, tmpReal, tmpImag; float EQ; - float Cldfb_RealBuffer_tmp[MAX_CICP_CHANNELS][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_tmp[MAX_CICP_CHANNELS][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_RealBuffer_tmp[MAX_LS_CHANNELS][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_tmp[MAX_LS_CHANNELS][CLDFB_NO_CHANNELS_MAX]; LSSETUP_CONVERSION_HANDLE hLsSetUpConversion; push_wmops( "LS_Renderer_Process_Param_MC" ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 25b5982aad902ed6471b71b58e821818ef6ec886..0e04971fc390a79cb44ed93ef9629b80dfa555e7 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2213,7 +2213,7 @@ static int16_t getOutputBufferSize( if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { - return (int16_t) ( st_ivas->hDecoderConfig->output_Fs * ( IVAS_MAX_OUTPUT_CHANNELS + IVAS_MAX_NUM_OBJECTS ) / FRAMES_PER_SEC ); + return (int16_t) ( st_ivas->hDecoderConfig->output_Fs * ( MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ) / FRAMES_PER_SEC ); } else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 4edc948b6d38b47dbf85440e05eb6550da0ac87f..25314cd89e0e7b1f7ceea01620ff1e4c10869f19 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -56,15 +56,15 @@ static void ivas_param_mc_dmx( PARAM_MC_ENC_HANDLE hParamMC, float *data_f[], float data_dmx[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); -static void ivas_param_mc_param_est_enc( PARAM_MC_ENC_HANDLE hParamMC, float *data_f[], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); +static void ivas_param_mc_param_est_enc( PARAM_MC_ENC_HANDLE hParamMC, float *data_f[], float Cy_sum[][MAX_LS_CHANNELS][MAX_LS_CHANNELS], float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t input_frame, const int16_t nchan_input, const int16_t nchan_transport ); static void ivas_param_mc_parameter_quantizer( const float *x, const int16_t L, const int16_t sz_quantizer, const float *quantizer, int16_t *quant_idx, float *y ); static void ivas_param_mc_transient_detection( PARAM_MC_ENC_HANDLE hParamMC, TRAN_DET_HANDLE hTranDet, int16_t *bAttackPresent, int16_t *attackIdx ); -static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); +static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_LS_CHANNELS][MAX_LS_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); -static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t freq_idx, const int16_t nchan_input, const int16_t nchan_transport, int16_t *ILD_idx_out, float ILD_q[PARAM_MC_SZ_ILD_MAP] ); +static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_LS_CHANNELS][MAX_LS_CHANNELS], float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t freq_idx, const int16_t nchan_input, const int16_t nchan_transport, int16_t *ILD_idx_out, float ILD_q[PARAM_MC_SZ_ILD_MAP] ); static void ivas_param_mc_write_bs( const PARAM_MC_ENC_HANDLE hParamMC, int16_t *ILD_idx, int16_t *ICC_idx, uint16_t bit_buffer[PARAM_MC_MAX_BITS], int16_t *bit_pos ); @@ -349,7 +349,7 @@ void ivas_param_mc_enc( ) { int16_t k; - float Cy_sum[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; + float Cy_sum[PARAM_MC_MAX_PARAMETER_BANDS][MAX_LS_CHANNELS][MAX_LS_CHANNELS]; float Cx_sum[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP]; int16_t ILD_idx[PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_SZ_ILD_MAP]; @@ -373,9 +373,9 @@ void ivas_param_mc_enc( for ( band = 0; band < PARAM_MC_MAX_PARAMETER_BANDS; band++ ) { - for ( ch = 0; ch < MAX_CICP_CHANNELS; ch++ ) + for ( ch = 0; ch < MAX_LS_CHANNELS; ch++ ) { - set_zero( Cy_sum[band][ch], MAX_CICP_CHANNELS ); + set_zero( Cy_sum[band][ch], MAX_LS_CHANNELS ); } for ( ch = 0; ch < PARAM_MC_MAX_TRANSPORT_CHANS; ch++ ) { @@ -555,7 +555,7 @@ static void ivas_param_mc_dmx( static void ivas_param_mc_param_est_enc( PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ float *data_f[], /* i : Input frame in the time domain */ - float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* o : Covariance matrix for the original frame */ + float Cy_sum[][MAX_LS_CHANNELS][MAX_LS_CHANNELS], /* o : Covariance matrix for the original frame */ float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* o : Covariance matrix for the downmixed frame */ const int16_t input_frame, /* i : Input frame length */ const int16_t nchan_input, /* i : number of input channels */ @@ -571,16 +571,16 @@ static void ivas_param_mc_param_est_enc( int16_t band_step; const int16_t *map_ls = Param_MC_index; /* Loudspeakers mapping */ int16_t idx_ls; - float *pcm_in[MAX_CICP_CHANNELS]; - float slot_frame_f_real[MAX_CICP_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; /* Output of the MDFT FB - real part */ - float slot_frame_f_imag[MAX_CICP_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; /* Output of the MDFT FB - imag part */ - float *p_slot_frame_f_real[MAX_CICP_CHANNELS]; /* Output of the MDFT FB - real part */ - float *p_slot_frame_f_imag[MAX_CICP_CHANNELS]; /* Output of the MDFT FB - imag part */ + float *pcm_in[MAX_LS_CHANNELS]; + float slot_frame_f_real[MAX_LS_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; /* Output of the MDFT FB - real part */ + float slot_frame_f_imag[MAX_LS_CHANNELS][DIRAC_NO_FB_BANDS_MAX]; /* Output of the MDFT FB - imag part */ + float *p_slot_frame_f_real[MAX_LS_CHANNELS]; /* Output of the MDFT FB - real part */ + float *p_slot_frame_f_imag[MAX_LS_CHANNELS]; /* Output of the MDFT FB - imag part */ float dmx_real[PARAM_MC_MAX_TRANSPORT_CHANS]; /* Downmix channel - Real Part */ float dmx_imag[PARAM_MC_MAX_TRANSPORT_CHANS]; /* Downmix channel - Imag Part */ float a, b, c, d; /* Tmp complex values */ - float Cy_sum_imag[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; + float Cy_sum_imag[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_LS_CHANNELS][MAX_LS_CHANNELS]; float Cx_sum_imag[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; float real_part, imag_part; int16_t start_ts; @@ -597,9 +597,9 @@ static void ivas_param_mc_param_est_enc( for ( cur_param_band = 0; cur_param_band < PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC; cur_param_band++ ) { - for ( ch_idx1 = 0; ch_idx1 < MAX_CICP_CHANNELS; ch_idx1++ ) + for ( ch_idx1 = 0; ch_idx1 < MAX_LS_CHANNELS; ch_idx1++ ) { - set_zero( Cy_sum_imag[cur_param_band][ch_idx1], MAX_CICP_CHANNELS ); + set_zero( Cy_sum_imag[cur_param_band][ch_idx1], MAX_LS_CHANNELS ); } for ( ch_idx1 = 0; ch_idx1 < PARAM_MC_MAX_TRANSPORT_CHANS; ch_idx1++ ) @@ -799,7 +799,7 @@ static void ivas_param_mc_param_est_enc( } if ( hParamMC->hMetadataPMC.param_frame_idx != hParamMC->hMetadataPMC.coding_band_mapping[cur_param_band] ) { - float Nrg[MAX_CICP_CHANNELS]; + float Nrg[MAX_LS_CHANNELS]; /* get ICLDs */ for ( k = 0; k < nchan_input; ++k ) @@ -934,12 +934,12 @@ static void ivas_param_mc_param_est_enc( static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ + float Cy[MAX_LS_CHANNELS][MAX_LS_CHANNELS], /* i : Covariance matrix of the input */ float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], /* i : Covariance matrix of the dmx */ const int16_t freq_idx, /* i : frequency index being processed */ const int16_t nchan_input, /* i : number of input channels */ const int16_t nchan_transport, /* i : number of transport channels */ - int16_t *ILD_idx_out, /* o : ILD indices */ + int16_t *ILD_idx_out, /* o : ILD indices */ float ILD_q[PARAM_MC_SZ_ILD_MAP] /* o : Quanzited ILD matrix */ ) { @@ -947,7 +947,7 @@ static void ivas_param_mc_quantize_ilds( int16_t Ny; int16_t num_ilds_to_code; int16_t ild_map_size; - float Nrg[MAX_CICP_CHANNELS]; + float Nrg[MAX_LS_CHANNELS]; float ILD[PARAM_MC_SZ_ILD_MAP]; const PARAM_MC_ILD_MAPPING *h_ild_mapping; float tot_ener, dmx_ener, ener_fac, delta_fac; @@ -956,7 +956,7 @@ static void ivas_param_mc_quantize_ilds( push_wmops( "param_mc_prm_q" ); /* Initialization */ - set_zero( Nrg, MAX_CICP_CHANNELS ); + set_zero( Nrg, MAX_LS_CHANNELS ); set_zero( ILD, PARAM_MC_SZ_ILD_MAP ); Ny = nchan_input; @@ -1086,11 +1086,11 @@ static void ivas_param_mc_quantize_ilds( *------------------------------------------------------------------------*/ static void ivas_param_mc_quantize_iccs( - PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ - float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], /* i : Covariance matrix of the input */ - const int16_t freq_idx, /* i : frequency index being processed */ - const int16_t nchan_input, /* i : number of input channels */ - int16_t *ICC_idx_out /* o : quantizer indices */ + PARAM_MC_ENC_HANDLE hParamMC, /* i/o: Parametric MC encoder handle */ + float Cy[MAX_LS_CHANNELS][MAX_LS_CHANNELS], /* i : Covariance matrix of the input */ + const int16_t freq_idx, /* i : frequency index being processed */ + const int16_t nchan_input, /* i : number of input channels */ + int16_t *ICC_idx_out /* o : quantizer indices */ ) { int16_t i, k; @@ -1099,13 +1099,13 @@ static void ivas_param_mc_quantize_iccs( int16_t icc_map_size; float a; int16_t tmp_map[2]; - float Nrg[MAX_CICP_CHANNELS]; + float Nrg[MAX_LS_CHANNELS]; float ICC_vect[PARAM_MC_SZ_ICC_MAP]; float ICC_vect_q[PARAM_MC_SZ_ICC_MAP]; int16_t ICC_idx[PARAM_MC_SZ_ICC_MAP]; /* Initialization */ - set_zero( Nrg, MAX_CICP_CHANNELS ); + set_zero( Nrg, MAX_LS_CHANNELS ); set_zero( ICC_vect, PARAM_MC_SZ_ICC_MAP ); set_zero( ICC_vect_q, PARAM_MC_SZ_ICC_MAP ); diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 84484aba2219af4b12f74900305af8ed7eaa94cc..9385bc753e6d2b62dd5f216d1b0df3f52bc68cc7 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -366,10 +366,10 @@ void rotateFrame_sd( int16_t azimuth, elevation; float tmp; - float tmp_gains[MAX_CICP_CHANNELS - 1]; - float gains[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - float gains_prev[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - float output_tmp[MAX_CICP_CHANNELS][L_FRAME48k]; + float tmp_gains[MAX_LS_CHANNELS - 1]; + float gains[MAX_LS_CHANNELS][MAX_LS_CHANNELS]; + float gains_prev[MAX_LS_CHANNELS][MAX_LS_CHANNELS]; + float output_tmp[MAX_LS_CHANNELS][L_FRAME48k]; float cross_fade[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; push_wmops( "rotateFrame_sd" ); @@ -591,11 +591,11 @@ void rotateFrame_sd_cldfb( ) { int16_t iBlock, iBand, m, n; - float gains[MAX_CICP_CHANNELS - 1][MAX_CICP_CHANNELS - 1]; + float gains[MAX_LS_CHANNELS - 1][MAX_LS_CHANNELS - 1]; int16_t azimuth, elevation; float g1; - float realRot[MAX_CICP_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; - float imagRot[MAX_CICP_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; + float realRot[MAX_LS_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; + float imagRot[MAX_LS_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; float *p_realRot, *p_imagRot; float *p_real, *p_imag; int16_t nInChannels; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ec4f99cd69d2a551771b0f855a802b018db145bb..08f6c7fbbcd5a43ae123dae6853dd80b1e730984 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1832,7 +1832,7 @@ static ivas_error updateLfePanGainsForAmbiOut( ivas_dirac_dec_get_response( (int16_t) inputMc->lfeRouting.lfeOutputAzimuth, (int16_t) inputMc->lfeRouting.lfeOutputElevation, inputMc->lfeRouting.lfePanMtx[i], outAmbiOrder ); /* linear input gain */ - v_multc( inputMc->lfeRouting.lfePanMtx[i], inputMc->lfeRouting.lfeInputGain, inputMc->lfeRouting.lfePanMtx[i], IVAS_MAX_OUTPUT_CHANNELS ); + v_multc( inputMc->lfeRouting.lfePanMtx[i], inputMc->lfeRouting.lfeInputGain, inputMc->lfeRouting.lfePanMtx[i], RENDERER_MAX_OUTPUT_CHANNELS ); } return error; @@ -2024,13 +2024,13 @@ static ivas_error updateMcPanGains( { for ( i = 0; i < inputMc->customLsInput.num_lfe; ++i ) { - mvr2r( inputMc->lfeRouting.lfePanMtx[i], inputMc->panGains[inputMc->customLsInput.lfe_idx[i]], IVAS_MAX_OUTPUT_CHANNELS ); + mvr2r( inputMc->lfeRouting.lfePanMtx[i], inputMc->panGains[inputMc->customLsInput.lfe_idx[i]], RENDERER_MAX_OUTPUT_CHANNELS ); } } else { /* For code simplicity, always copy LFE gains. If config has no LFE, gains will be zero anyway. */ - mvr2r( inputMc->lfeRouting.lfePanMtx[0], inputMc->panGains[LFE_CHANNEL], IVAS_MAX_OUTPUT_CHANNELS ); + mvr2r( inputMc->lfeRouting.lfePanMtx[0], inputMc->panGains[LFE_CHANNEL], RENDERER_MAX_OUTPUT_CHANNELS ); } return IVAS_ERR_OK; @@ -2211,7 +2211,7 @@ static lfe_routing defaultLfeRouting( for ( i = 0; i < RENDERER_MAX_INPUT_LFE_CHANNELS; ++i ) { - set_zero( routing.lfePanMtx[i], IVAS_MAX_OUTPUT_CHANNELS ); + set_zero( routing.lfePanMtx[i], RENDERER_MAX_OUTPUT_CHANNELS ); } routing.pan_lfe = false; @@ -3667,7 +3667,7 @@ ivas_error IVAS_REND_SetInputLfeMtx( /* copy LFE panning matrix */ for ( i = 0; i < RENDERER_MAX_INPUT_LFE_CHANNELS; i++ ) { - mvr2r( ( *lfePanMtx )[i], pInputMc->lfeRouting.lfePanMtx[i], IVAS_MAX_OUTPUT_CHANNELS ); + mvr2r( ( *lfePanMtx )[i], pInputMc->lfeRouting.lfePanMtx[i], RENDERER_MAX_OUTPUT_CHANNELS ); } if ( ( error = updateMcPanGains( pInputMc, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) @@ -7701,8 +7701,8 @@ void IVAS_REND_Close( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_openCldfb( - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS], - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_OUTPUT_CHANNELS], + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS], + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_OUTPUT_CHANNELS], const int16_t num_in_chs, const int16_t num_out_chs, const int32_t output_Fs ) @@ -7717,7 +7717,7 @@ ivas_error IVAS_REND_openCldfb( return error; } } - for ( ; n < IVAS_MAX_INPUT_CHANNELS; n++ ) + for ( ; n < RENDERER_MAX_INPUT_CHANNELS; n++ ) { cldfbAna[n] = NULL; } @@ -7729,7 +7729,7 @@ ivas_error IVAS_REND_openCldfb( return error; } } - for ( ; n < IVAS_MAX_OUTPUT_CHANNELS; n++ ) + for ( ; n < RENDERER_MAX_OUTPUT_CHANNELS; n++ ) { cldfbSyn[n] = NULL; } @@ -7745,12 +7745,12 @@ ivas_error IVAS_REND_openCldfb( *-------------------------------------------------------------------*/ void IVAS_REND_closeCldfb( - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS], - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_OUTPUT_CHANNELS] ) + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS], + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_OUTPUT_CHANNELS] ) { int16_t n; - for ( n = 0; n < IVAS_MAX_INPUT_CHANNELS; n++ ) + for ( n = 0; n < RENDERER_MAX_INPUT_CHANNELS; n++ ) { if ( cldfbAna[n] != NULL ) { @@ -7759,7 +7759,7 @@ void IVAS_REND_closeCldfb( } } - for ( n = 0; n < IVAS_MAX_OUTPUT_CHANNELS; n++ ) + for ( n = 0; n < RENDERER_MAX_OUTPUT_CHANNELS; n++ ) { if ( cldfbSyn[n] != NULL ) { diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index f71a1a5384af99db36a33a7ac77f696011c1fb36..194bca0165ca3f22a16af67ac4a7b9c795d8d91b 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -41,6 +41,8 @@ * Renderer constants *---------------------------------------------------------------------*/ +#define RENDERER_MAX_OUTPUT_CHANNELS IVAS_MAX_LS_CHANNELS +#define RENDERER_MAX_INPUT_CHANNELS IVAS_MAX_LS_CHANNELS #define RENDERER_MAX_ISM_INPUTS IVAS_MAX_NUM_OBJECTS #define RENDERER_MAX_MC_INPUTS 1 #define RENDERER_MAX_SBA_INPUTS 1 @@ -55,7 +57,7 @@ * Renderer structures *---------------------------------------------------------------------*/ -typedef float IVAS_REND_LfePanMtx[RENDERER_MAX_INPUT_LFE_CHANNELS][IVAS_MAX_OUTPUT_CHANNELS]; +typedef float IVAS_REND_LfePanMtx[RENDERER_MAX_INPUT_LFE_CHANNELS][RENDERER_MAX_OUTPUT_CHANNELS]; typedef struct { @@ -68,6 +70,7 @@ typedef struct int16_t isar_frame_size_ms; int16_t lc3plus_highres; } IVAS_REND_BitstreamBufferConfig; + typedef struct { IVAS_REND_BitstreamBufferConfig config; @@ -386,16 +389,16 @@ void IVAS_REND_Close( /* Split binaural rendering functions */ ivas_error IVAS_REND_openCldfb( - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS], - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_OUTPUT_CHANNELS], + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS], + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_OUTPUT_CHANNELS], const int16_t num_in_chs, const int16_t num_out_chs, const int32_t output_Fs ); void IVAS_REND_closeCldfb( - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS], - IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_OUTPUT_CHANNELS] + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS], + IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_OUTPUT_CHANNELS] ); void IVAS_REND_cldfbAnalysis_ts_wrapper( diff --git a/lib_util/ls_custom_file_reader.c b/lib_util/ls_custom_file_reader.c index 48c87a88eae79e998a5dc7774c9962932d7f5f5f..1629a6d59ed108d6fc40295ba8adbe8b41797523 100644 --- a/lib_util/ls_custom_file_reader.c +++ b/lib_util/ls_custom_file_reader.c @@ -121,11 +121,11 @@ static LS_CUSTOM_FILEREADER_ERROR CustomLoudspeakerLayout_validate( { int16_t i, j; int16_t dup_count; - int16_t dup[IVAS_MAX_OUTPUT_CHANNELS]; - float azi_tmp[IVAS_MAX_OUTPUT_CHANNELS]; - float ele_tmp[IVAS_MAX_OUTPUT_CHANNELS]; + int16_t dup[IVAS_MAX_LS_CHANNELS]; + float azi_tmp[IVAS_MAX_LS_CHANNELS]; + float ele_tmp[IVAS_MAX_LS_CHANNELS]; - for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) + for ( i = 0; i < IVAS_MAX_LS_CHANNELS; i++ ) { dup[i] = 0; azi_tmp[i] = 0.0f; @@ -143,7 +143,7 @@ static LS_CUSTOM_FILEREADER_ERROR CustomLoudspeakerLayout_validate( return LS_CUSTOM_FILEREADER_LFE_NUM_SPK_EXCEEDED_ERROR; } - if ( ( *num_azi + num_lfe ) > IVAS_MAX_OUTPUT_CHANNELS ) + if ( ( *num_azi + num_lfe ) > IVAS_MAX_LS_CHANNELS ) { return LS_CUSTOM_FILEREADER_OUTPUT_NCHAN_EXCEEDED_ERROR; } @@ -182,7 +182,7 @@ static LS_CUSTOM_FILEREADER_ERROR CustomLoudspeakerLayout_validate( ( *num_azi ) -= dup_count; - for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) + for ( i = 0; i < IVAS_MAX_LS_CHANNELS; i++ ) { azi[i] = azi_tmp[i]; ele[i] = ele_tmp[i]; @@ -240,7 +240,7 @@ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( { LS_CUSTOM_FILEREADER_ERROR error; - char line[200]; /* > (10 chars * IVAS_MAX_OUTPUT_CHANNELS) i.e. "-999, " */ + char line[200]; /* > (10 chars * IVAS_MAX_LS_CHANNELS) i.e. "-999, " */ const char *tok; int16_t i, num_azi, num_ele, num_lfe; @@ -250,7 +250,7 @@ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( num_ele = 0; num_lfe = 0; - for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) + for ( i = 0; i < IVAS_MAX_LS_CHANNELS; i++ ) { hLsCustomData->lfe_idx[i] = -1; hLsCustomData->azimuth[i] = 0.0f; @@ -282,7 +282,7 @@ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( continue; } - if ( num_azi >= IVAS_MAX_OUTPUT_CHANNELS ) + if ( num_azi >= IVAS_MAX_LS_CHANNELS ) { return LS_CUSTOM_FILEREADER_AZI_NUM_SPK_EXCEEDED_ERROR; } @@ -311,7 +311,7 @@ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( continue; } - if ( num_ele >= IVAS_MAX_OUTPUT_CHANNELS ) + if ( num_ele >= IVAS_MAX_LS_CHANNELS ) { return LS_CUSTOM_FILEREADER_ELE_NUM_SPK_EXCEEDED_ERROR; } @@ -337,14 +337,14 @@ LS_CUSTOM_FILEREADER_ERROR CustomLsFileReading( continue; } - if ( num_lfe > IVAS_MAX_OUTPUT_CHANNELS ) + if ( num_lfe > IVAS_MAX_LS_CHANNELS ) { return LS_CUSTOM_FILEREADER_LFE_NUM_SPK_EXCEEDED_ERROR; } else { hLsCustomData->lfe_idx[num_lfe] = (int16_t) atoi( tok ); - if ( hLsCustomData->lfe_idx[num_lfe] < 0 || hLsCustomData->lfe_idx[num_lfe] > ( IVAS_MAX_OUTPUT_CHANNELS - 1 ) ) + if ( hLsCustomData->lfe_idx[num_lfe] < 0 || hLsCustomData->lfe_idx[num_lfe] > ( IVAS_MAX_LS_CHANNELS - 1 ) ) { return LS_CUSTOM_FILEREADER_LFE_INDEX_ERROR; }