From 88a803d01e4b20941b0b2acdc445bf416a56a968 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 18 Oct 2022 08:50:12 +0200 Subject: [PATCH 1/6] empty lines --- lib_com/ivas_stat_com.h | 4 +++- lib_dec/ivas_spar_decoder.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 4b2c342f4f..026191559b 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -124,6 +124,7 @@ typedef struct /*----------------------------------------------------------------------------------* * PARAMETRIC ISM encoder/decoder (common) structure *----------------------------------------------------------------------------------*/ + typedef struct ivas_param_ism_data_structure { int16_t nbands; @@ -480,6 +481,7 @@ typedef struct ivas_qdirection_band_data_struct uint16_t elevation_index[MAX_PARAM_SPATIAL_SUBFRAMES]; float q_azimuth[MAX_PARAM_SPATIAL_SUBFRAMES]; float q_elevation[MAX_PARAM_SPATIAL_SUBFRAMES]; + } IVAS_QDIRECTION_BAND_DATA; typedef struct ivas_qdirection_band_coherence_data_struct @@ -532,6 +534,7 @@ typedef struct ivas_masa_qmetadata_frame_struct int16_t ec_flag; float dir_comp_ratio; uint8_t is_masa_ivas_format; + } IVAS_QMETADATA, *IVAS_QMETADATA_HANDLE; @@ -739,7 +742,6 @@ typedef struct ivas_fb_mixer_state_structure float cldfb_cross_fade[CLDFB_NO_COL_MAX]; int16_t cldfb_cross_fade_start; int16_t cldfb_cross_fade_end; - int16_t cldfb_latency; int16_t first_frame[IVAS_SPAR_MAX_CH]; diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index c7a3fcff20..3021f1947c 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -469,7 +469,6 @@ void ivas_spar_get_cldfb_gains( } hSpar->hFbMixer->cldfb_cross_fade_start = cf_cldfb_start; hSpar->hFbMixer->cldfb_cross_fade_end = cf_cldfb_end; - hSpar->hFbMixer->cldfb_latency = decfb_delay; if ( num_cf_slots > 3 || pt_len > 10 * CLDFB_NO_CHANNELS_MAX || stride > CLDFB_NO_CHANNELS_MAX || split_band == IVAS_MAX_NUM_BANDS ) { -- GitLab From 6f22b333440c04ce004a8a32c5de97f0c8124350 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 18 Oct 2022 08:51:19 +0200 Subject: [PATCH 2/6] empty lines --- lib_dec/ivas_stat_dec.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 9f36670a7d..aeb5d4118b 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -123,7 +123,6 @@ typedef struct stereo_dft_dec_data_struct const float *win_8k; /* DFT window residual */ - /*Bands*/ int16_t band_res[STEREO_DFT_DEC_DFT_NB]; int16_t band_limits[STEREO_DFT_BAND_MAX + 1]; @@ -216,14 +215,10 @@ typedef struct stereo_dft_dec_data_struct float smooth_buf[SBA_DIRAC_STEREO_NUM_BANDS][SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[NB_DIV][SBA_DIRAC_STEREO_NUM_BANDS]; - } STEREO_DFT_DEC_DATA, *STEREO_DFT_DEC_DATA_HANDLE; -/*----------------------------------------------------------------------------------* - * DFT Stereo mono output structure - *----------------------------------------------------------------------------------*/ - +/* DFT Stereo mono output structure */ typedef struct stereo_dft_dmx_out_data_structure { float targetGain; /* TCA gain norm applied on target (or right) channel in current frame */ @@ -430,6 +425,7 @@ typedef struct dirac_dec_stack_mem float *reference_power; float *onset_filter; + } DIRAC_DEC_STACK_MEM, *DIRAC_DEC_STACK_MEM_HANDLE; typedef struct param_ism_rendering @@ -659,7 +655,6 @@ typedef struct ivas_dirac_dec_data_structure int16_t spar_to_dirac_write_idx; int16_t dirac_md_buffer_length; - int16_t numSimultaneousDirections; /* 1 or 2 */ DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; @@ -715,6 +710,7 @@ typedef struct ivas_dirac_dec_data_structure PARAM_ISM_RENDERING_HANDLE hParamIsmRendering; IVAS_FB_MIXER_HANDLE hFbMdft; int16_t dirac_to_spar_md_bands[DIRAC_MAX_NBANDS]; + } DIRAC_DEC_DATA, *DIRAC_DEC_HANDLE; @@ -995,6 +991,7 @@ typedef struct EFAP_VERTEX int16_t idx; /* integer, that corresponds to the first index for the LS in the 1D output */ int16_t isNaN; /* used to indicate if the vertex is a virtual speaker */ EFAP_VTX_DMX_TYPE dmxType; /* virtual speaker downmix type */ + } EFAP_VERTEX; typedef struct EFAP_VERTEX_DATA @@ -1044,6 +1041,7 @@ typedef struct EFAP } EFAP, *EFAP_HANDLE; + /*----------------------------------------------------------------------------------* * VBAP structures *----------------------------------------------------------------------------------*/ @@ -1113,6 +1111,7 @@ typedef struct renderer_struct } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; + /*----------------------------------------------------------------------------------* * Loudspeaker Configuration Conversion structure *----------------------------------------------------------------------------------*/ @@ -1132,6 +1131,7 @@ typedef struct ivas_LS_setupconversion_matrix { int16_t index; float value; + } LS_CONVERSION_MATRIX; typedef struct ivas_LS_setupconversion_mapping @@ -1139,6 +1139,7 @@ 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 @@ -1435,7 +1436,6 @@ typedef struct TDREND_LIST_Item_s } TDREND_LIST_Item_t; - typedef struct { int16_t modelROM; /* Flag that indicates that the model resides in ROM (controls init/dealloc). */ @@ -1516,6 +1516,7 @@ typedef struct float *W_dyn; float *azimBsShape_dyn; float *elevBsShape_dyn; + } ModelParamsITD_t; typedef struct @@ -1713,6 +1714,7 @@ typedef struct ivas_roomAcoustics_t float pAcoustic_dsr[CLDFB_NO_CHANNELS_MAX]; /* - The room's Diffuse to Source Ratio per center frequency */ float acousticPreDelay; /* Time elapsed between input signal and late reverberation start, float, range [0.001..10] */ float inputPreDelay; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10] */ + } ivas_roomAcoustics_t; typedef struct ivas_render_config_t @@ -1721,6 +1723,7 @@ typedef struct ivas_render_config_t ivas_renderTypeOverride renderer_type_override; #endif ivas_roomAcoustics_t roomAcoustics; + } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; @@ -1832,7 +1835,7 @@ typedef struct ivas_orient_trk_state_t } ivas_orient_trk_state_t; -/* Crend structures */ +/* Main Crend structure */ typedef struct ivas_crend_state_t { float *freq_buffer_re[MAX_INTERN_CHANNELS]; @@ -1853,7 +1856,7 @@ typedef struct ivas_crend_state_t /*----------------------------------------------------------------------------------* - * LFE decoder structures + * LFE decoder structure *----------------------------------------------------------------------------------*/ typedef struct ivas_lfe_dec_data_structure -- GitLab From 2e2d3d44ce419b87c9749c4ba0f218143576ef4c Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 24 Oct 2022 20:41:00 +0200 Subject: [PATCH 3/6] formatting, comments --- lib_com/cnst.h | 4 +-- lib_com/ivas_prot.h | 10 +++---- lib_com/ivas_sba_config.c | 12 ++++---- lib_com/ivas_tools.c | 10 +++---- lib_com/prot.h | 53 ++++++++++++++-------------------- lib_com/stat_com.h | 2 +- lib_dec/core_dec_switch.c | 3 +- lib_dec/dec_prm.c | 17 +++++------ lib_dec/dec_tcx.c | 11 +++---- lib_dec/er_dec_tcx.c | 14 ++++----- lib_dec/init_dec.c | 5 ++-- lib_dec/tonalMDCTconcealment.c | 7 ++--- lib_enc/ivas_dirac_enc.c | 2 +- lib_enc/ivas_spar_md_enc.c | 6 ++-- 14 files changed, 68 insertions(+), 88 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 40a4710579..e62ef001dc 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -810,11 +810,11 @@ typedef enum #define FORMANT_SHARPENING_G1_16k 0.8f /* Formant sharpening numerator weighting at 16kHz */ #define FORMANT_SHARPENING_G2_16k 0.92f /* Formant sharpening denominator weighting at 16kHz */ -#define FSCALE_DENOM 512 +#define FSCALE_DENOM 512 #define ACELP_FIXED_CDK_NB 41 #define ACELP_FIXED_CDK_BITS( n ) PulseConfTable[n].bits -#define L_FIR 31 +#define L_FIR 31 enum TRACKPOS { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index ff23fb7ebf..df12064a13 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3080,7 +3080,7 @@ int16_t ivas_sba_get_order_transport( const int16_t nchan_transport /* i : Number of transport channels */ ); -/*!r: number of Ambisonic channels */ +/*! r: number of Ambisonic channels */ int16_t ivas_sba_get_nchan( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int16_t sba_planar /* i : SBA planar flag */ @@ -3092,10 +3092,10 @@ int16_t ivas_sba_get_nchan_metadata( ); #ifdef SBA_HOA_HBR_IMPROV -/*! r: get the flag to code SPAR HOA MD for all band */ +/*! r: flag indicating to code SPAR HOA MD for all bands */ int16_t ivas_sba_get_spar_hoa_md_flag( - const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ + const int16_t sba_order, /* i : Ambisonic (SBA) order */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); #endif @@ -4827,7 +4827,7 @@ void lls_interp_n( const int16_t N, /* i : length of the input vector */ float *a, /* o : calculated slope */ float *b, /* o : calculated offset */ - int16_t upd /* i : use 1 to update x[] with the interpolated output */ + const int16_t upd /* i : use 1 to update x[] with the interpolated output */ ); void computeReferencePower_enc( diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index d7e47960b0..cf22cf38ff 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -234,7 +234,7 @@ int16_t ivas_sba_get_order_transport( * Get number of Ambisonic channels *-------------------------------------------------------------------*/ -/*!r: number of Ambisonic channels */ +/*! r: number of Ambisonic channels */ int16_t ivas_sba_get_nchan( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int16_t sba_planar /* i : SBA planar flag */ @@ -285,16 +285,17 @@ int16_t ivas_sba_get_nchan_metadata( /*-------------------------------------------------------------------* * ivas_sba_get_spar_hoa_md_flag() * - * et the flag to code SPAR HOA MD for all band + * Get the flag to code SPAR HOA MD for all band *-------------------------------------------------------------------*/ -/*! r: get the flag to code SPAR HOA MD for all band */ +/*! r: flag indicating to code SPAR HOA MD for all bands */ int16_t ivas_sba_get_spar_hoa_md_flag( - const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int32_t ivas_total_brate /* i : IVAS total bitrate */ + const int16_t sba_order, /* i : Ambisonic (SBA) order */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ ) { int16_t spar_hoa_md_flag = 0; + if ( sba_order > 1 && ivas_total_brate >= IVAS_256k ) { spar_hoa_md_flag = 1; @@ -303,6 +304,7 @@ int16_t ivas_sba_get_spar_hoa_md_flag( { spar_hoa_md_flag = 0; } + return spar_hoa_md_flag; } #endif diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index 9594bf5900..3c941ccc77 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -954,11 +954,11 @@ void v_multc_acc( void lls_interp_n( - float x[], /* i/o: input/output vector */ - const int16_t N, /* i : length of the input vector */ - float *a, /* o : calculated slope */ - float *b, /* o : calculated offset */ - int16_t upd /* i : use 1 to update x[] with the interpolated output */ + float x[], /* i/o: input/output vector */ + const int16_t N, /* i : length of the input vector */ + float *a, /* o : calculated slope */ + float *b, /* o : calculated offset */ + const int16_t upd /* i : use 1 to update x[] with the interpolated output */ ) { int16_t i; diff --git a/lib_com/prot.h b/lib_com/prot.h index 5bc1e39753..6df1f543b7 100755 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -5143,10 +5143,9 @@ void decod_amr_wb( ); ivas_error init_decoder( - Decoder_State *st, /* o : Decoder static variables structure */ - const int16_t idchan /* i : channel ID */ - , - const MC_MODE mc_mode /* i : MC mode */ + Decoder_State *st, /* o : Decoder static variables structure */ + const int16_t idchan, /* i : channel ID */ + const MC_MODE mc_mode /* i : MC mode */ ); void destroy_decoder( @@ -6772,18 +6771,17 @@ void enc_acelp_tcx_main( ); void getTCXMode( - Decoder_State *st, /* i/o: decoder memory state */ - Decoder_State *st0 /* i : bitstream */ - , - const int16_t MCT_flag + Decoder_State *st, /* i/o: decoder memory state */ + Decoder_State *st0, /* i : bitstream */ + const int16_t MCT_flag /* i : MCT tool active(1) or deactive(0) */ ); void getTCXWindowing( - const int16_t core, /* i : current frame mode */ - const int16_t last_core, /* i : last frame mode */ - const int16_t element_mode, - TCX_CONFIG_HANDLE hTcxCfg, /* i/o: TCX configuration handle */ - Decoder_State *st0 /* i : bitstream */ + const int16_t core, /* i : current frame mode */ + const int16_t last_core, /* i : last frame mode */ + const int16_t element_mode, /* i : element mode */ + TCX_CONFIG_HANDLE hTcxCfg, /* i/o: TCX configuration handle */ + Decoder_State *st0 /* i : bitstream */ ); void getLPCparam( @@ -7888,10 +7886,8 @@ void decoder_tcx_post( float *synth, float *synthFB, float *A, - const int16_t bfi - , - const int16_t isMCT -); + const int16_t bfi, + const int16_t isMCT ); void coder_acelp( Encoder_State *st, /* i/o: coder memory state */ @@ -8127,14 +8123,12 @@ void con_acelp( ); void con_tcx( - Decoder_State *st, /* i/o: coder memory state */ - float synth[], /* i/o: synth[] */ - const float coh, /* i : coherence of stereo signal */ - int16_t *noise_seed, /* i/o: noise seed for stereo */ - const int16_t only_left /* i : TD-PLC only in left channel */ - , - const float *A_cng -); + Decoder_State *st, /* i/o: coder memory state */ + float synth[], /* i/o: synth[] */ + const float coh, /* i : coherence of stereo signal */ + int16_t *noise_seed, /* i/o: noise seed for stereo */ + const int16_t only_left, /* i : TD-PLC only in left channel */ + const float A_cng[] ); /*! r: codebook index */ int16_t tcxlpc_get_cdk( @@ -9228,8 +9222,7 @@ void mode_switch_decoder_LPD( const int32_t total_brate, /* i : total bitrate */ const int32_t last_total_brate, /* i : last frame total bitrate */ const int16_t frame_size_index, /* i : index determining the frame size*/ - const int16_t is_mct /* i : MCT mode flag */ - , + const int16_t is_mct, /* i : MCT mode flag */ const int16_t last_element_mode /* i : last element mode */ ); @@ -9510,10 +9503,8 @@ void TonalMDCTConceal_SaveFreqSignal( const float *mdctSpectrum, const uint16_t numSamples, const uint16_t nNewSamplesCore, - const float *scaleFactors - , - const int16_t infoIGFStartLine -); + const float *scaleFactors, + const int16_t infoIGFStartLine ); void TonalMDCTConceal_UpdateState( TonalMDCTConcealPtr hTonalMDCTConc, diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h index 7f82c9272f..4cf9c05f1e 100644 --- a/lib_com/stat_com.h +++ b/lib_com/stat_com.h @@ -395,7 +395,7 @@ typedef struct int16_t frame_type_previous; - float A_cng[17]; + float A_cng[M + 1]; float exc_cng[L_FRAME16k]; int32_t CngBitrate; diff --git a/lib_dec/core_dec_switch.c b/lib_dec/core_dec_switch.c index cc1619cba0..5b8a34f42c 100644 --- a/lib_dec/core_dec_switch.c +++ b/lib_dec/core_dec_switch.c @@ -56,8 +56,7 @@ void mode_switch_decoder_LPD( const int32_t total_brate, /* i : total bitrate */ const int32_t last_total_brate, /* i : last frame total bitrate */ const int16_t frame_size_index, /* i : index determining the frame size*/ - const int16_t is_mct /* i : MCT mode flag */ - , + const int16_t is_mct, /* i : MCT mode flag */ const int16_t last_element_mode /* i : last element mode */ ) { diff --git a/lib_dec/dec_prm.c b/lib_dec/dec_prm.c index d458d62aa4..f2d574c035 100644 --- a/lib_dec/dec_prm.c +++ b/lib_dec/dec_prm.c @@ -53,10 +53,9 @@ *--------------------------------------------------------------------*/ void getTCXMode( - Decoder_State *st, /* i/o: decoder memory state */ - Decoder_State *st0 /* i : bitstream */ - , - const int16_t MCT_flag + Decoder_State *st, /* i/o: decoder memory state */ + Decoder_State *st0, /* i : bitstream */ + const int16_t MCT_flag /* i : MCT tool active(1) or deactive(0) */ ) { uint16_t ind; @@ -206,11 +205,11 @@ void getTCXMode( *--------------------------------------------------------------------*/ void getTCXWindowing( - const int16_t core, /* i : current core */ - const int16_t last_core, /* i : last frame core */ - const int16_t element_mode, - TCX_CONFIG_HANDLE hTcxCfg, /* i/o: TCX configuration handle */ - Decoder_State *st0 /* i : bitstream */ + const int16_t core, /* i : current core */ + const int16_t last_core, /* i : last frame core */ + const int16_t element_mode, /* i : element mode */ + TCX_CONFIG_HANDLE hTcxCfg, /* i/o: TCX configuration handle */ + Decoder_State *st0 /* i : bitstream */ ) { int16_t overlap_code; diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index d625139a47..4f29033e04 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -124,10 +124,8 @@ void decoder_tcx_post( float *synth, float *synthFB, float *A, - const int16_t bfi - , - const int16_t isMCT -) + const int16_t bfi, + const int16_t isMCT ) { int16_t i; float level_syn, gainCNG = 0.0f, step; @@ -1212,7 +1210,6 @@ void decoder_tcx_noisefilling( if ( st->hTonalMDCTConc != NULL ) { if ( !bfi && st->element_mode != IVAS_CPE_MDCT ) - { TonalMDCTConceal_SaveFreqSignal( st->hTonalMDCTConc, x, L_frameTCX, L_frame, gainlpc2, infoIGFStartLine ); } @@ -1912,8 +1909,8 @@ void decoder_tcx_IGF_stereo( const int16_t L_frame, /* i : frame length */ const int16_t left_rect, /* i : left part is rectangular */ const int16_t k, /* i : Subframe index */ - const int16_t bfi, /* i : bad frame indicator */ - const int16_t is_mct /* i : flag to signal MCT or SMDCT */ + const int16_t bfi, /* i : bad frame indicator */ + const int16_t is_mct /* i : flag to signal MCT or SMDCT */ ) { int16_t coreMsMask[N_MAX]; diff --git a/lib_dec/er_dec_tcx.c b/lib_dec/er_dec_tcx.c index bf561c2abd..4b507df683 100644 --- a/lib_dec/er_dec_tcx.c +++ b/lib_dec/er_dec_tcx.c @@ -54,14 +54,12 @@ *-----------------------------------------------------------------*/ void con_tcx( - Decoder_State *st, /* i/o: coder memory state */ - float synth[], /* i/o: synth[] */ - const float coh, /* i : coherence of stereo signal */ - int16_t *noise_seed, /* i/o: noise seed for stereo */ - const int16_t only_left /* i : TD-PLC only in left channel */ - , - const float *A_cng -) + Decoder_State *st, /* i/o: coder memory state */ + float synth[], /* i/o: synth[] */ + const float coh, /* i : coherence of stereo signal */ + int16_t *noise_seed, /* i/o: noise seed for stereo */ + const int16_t only_left, /* i : TD-PLC only in left channel */ + const float A_cng[] ) { int16_t i, n, L_frame, L_subfr, fLowPassFilter, T0; int16_t offset = 0; diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 2598cf29b6..4f022e2811 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -52,9 +52,8 @@ *----------------------------------------------------------------------*/ ivas_error init_decoder( - Decoder_State *st, /* o : Decoder static variables structure */ - const int16_t idchan /* i : channel ID */ - , + Decoder_State *st, /* o : Decoder static variables structure */ + const int16_t idchan, /* i : channel ID */ const MC_MODE mc_mode /* i : MC mode */ ) { diff --git a/lib_dec/tonalMDCTconcealment.c b/lib_dec/tonalMDCTconcealment.c index 0078ca8bb4..a16638da51 100644 --- a/lib_dec/tonalMDCTconcealment.c +++ b/lib_dec/tonalMDCTconcealment.c @@ -122,10 +122,8 @@ void TonalMDCTConceal_SaveFreqSignal( const float *mdctSpectrum, const uint16_t nNewSamples, const uint16_t nNewSamplesCore, - const float *scaleFactors - , - const int16_t infoIGFStartLine -) + const float *scaleFactors, + const int16_t infoIGFStartLine ) { float *temp; int16_t nOldSamples; @@ -1180,4 +1178,3 @@ void TonalMdctConceal_whiten_noise_shape( wmops_sub_end(); } - diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 063ec02d8f..04f4becd22 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -515,7 +515,7 @@ void computeReferencePower_enc( const int16_t num_freq_bands /* i : Number of frequency bands */ #ifdef SBA_HOA_HBR_IMPROV , - const SBA_MODE sba_mode + const SBA_MODE sba_mode /* i : SBA mode */ #endif ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 2624389cc4..263d32292a 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -845,10 +845,8 @@ ivas_error ivas_spar_md_enc_process( { for ( i = 0; i < FOA_CHANNELS - 1; i++ ) { - /* Use the prediction coeffs computed based on DirAC MD - to generate mixer matrix */ - pred_coeffs_re[i][b] = - pred_coeffs_re_local[i][b]; + /* Use the prediction coeffs computed based on DirAC MD to generate mixer matrix */ + pred_coeffs_re[i][b] = pred_coeffs_re_local[i][b]; hMdEnc->spar_md.band_coeffs[b].pred_quant_re[i] = 0; hMdEnc->spar_md.band_coeffs_idx[b].pred_index_re[i] = 0; } -- GitLab From a914510139b8f0b4dda2be3ef5687175e4ad5514 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Oct 2022 08:58:53 +0200 Subject: [PATCH 4/6] formatting, comments --- lib_com/ivas_filters.c | 14 ++++---- lib_com/ivas_prot.h | 74 ++++++++++++++++++++-------------------- lib_enc/ivas_dirac_enc.c | 39 ++++++++++----------- 3 files changed, 64 insertions(+), 63 deletions(-) diff --git a/lib_com/ivas_filters.c b/lib_com/ivas_filters.c index 96148e5ca3..898ba7fe89 100644 --- a/lib_com/ivas_filters.c +++ b/lib_com/ivas_filters.c @@ -42,7 +42,7 @@ /*------------------------------------------------------------------------------------------* - * Static functions declaration + * Local functions declaration *------------------------------------------------------------------------------------------*/ static void ivas_iir_2_filter( ivas_filters_process_state_t *filter_state, float *pIn_Out, const int16_t length, const int16_t stage ); @@ -55,9 +55,9 @@ static void ivas_iir_2_filter( ivas_filters_process_state_t *filter_state, float *-----------------------------------------------------------------------------------------*/ void ivas_filters_init( - ivas_filters_process_state_t *filter_state, - const float *filt_coeff, - const int16_t order ) + ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ + const float *filt_coeff, /* i : filter coefficients */ + const int16_t order ) /* i : filter order */ { int16_t i; filter_state->order = order; @@ -107,9 +107,9 @@ void ivas_filters_init( *-----------------------------------------------------------------------------------------*/ void ivas_filter_process( - ivas_filters_process_state_t *filter_state, - float *pIn_Out, - const int16_t length ) + ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ + float *pIn_Out, /* i/o: signal subject to filtering */ + const int16_t length ) /* i : filter order */ { switch ( filter_state->order ) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index df12064a13..6ee0b402ad 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3165,14 +3165,14 @@ void ivas_dirac_enc_close( ); void ivas_dirac_enc( - DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ - IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ - int16_t *nb_bits_metadata, /* o : number of metadata bits written */ - const int16_t Opt_DTX_ON, /* i : flag signaling DTX on */ - float data_f[][L_FRAME48k], /* i/o: input: ACN/SN3D, output: omni, stereo DMX or FOA */ - const int16_t input_frame, /* i : input frame length */ - const int16_t sba_planar /* i : SBA planar flag */ + DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ + int16_t *nb_bits_metadata, /* o : number of metadata bits written */ + const int16_t Opt_DTX_ON, /* i : flag signaling DTX on */ + float data_f[][L_FRAME48k], /* i : SBA channels */ + const int16_t input_frame, /* i : input frame length */ + const int16_t sba_planar /* i : SBA planar flag */ ); ivas_error ivas_dirac_config( @@ -3988,7 +3988,7 @@ ivas_error ivas_spar_md_dec_open( const int16_t num_channels /* i : number of internal channels */ #ifdef SBA_HOA_HBR_IMPROV , - const int16_t sba_order /* i : flag to send HOA MD for all bands */ + const int16_t sba_order /* i : SBA order */ #endif ); @@ -4806,28 +4806,28 @@ void ivas_mcmasa_param_est_enc( MCMASA_ENC_HANDLE hMcMasa, /* i/o: Encoder McMASA handle */ MASA_ENCODER_HANDLE hMasa, /* i/o: Encoder MASA handle */ float data_f[][L_FRAME48k], /* i : Input frame of audio */ - float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated elevation */ - float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated azimuth */ - float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated direct-to-total ratio */ - float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated spread coherence */ - float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated surround coherence */ + float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated elevation */ + float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated azimuth */ + float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated direct-to-total ratio*/ + float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated spread coherence */ + float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated surround coherence */ const int16_t input_frame, /* i : Input frame size */ const int16_t nchan_inp /* i : Number of input channels */ ); void v_multc_acc( - const float x[], /* i : Input vector */ - const float c, /* i : Constant */ - float y[], /* o : Output vector that contains y + c*x */ - const int16_t N /* i : Vector length */ + const float x[], /* i : Input vector */ + const float c, /* i : Constant */ + float y[], /* o : Output vector that contains y + c*x */ + const int16_t N /* i : Vector length */ ); void lls_interp_n( - float x[], /* i/o: input/output vector */ - const int16_t N, /* i : length of the input vector */ - float *a, /* o : calculated slope */ - float *b, /* o : calculated offset */ - const int16_t upd /* i : use 1 to update x[] with the interpolated output */ + float x[], /* i/o: input/output vector */ + const int16_t N, /* i : length of the input vector */ + float *a, /* o : calculated slope */ + float *b, /* o : calculated offset */ + const int16_t upd /* i : use 1 to update x[] with the interpolated output*/ ); void computeReferencePower_enc( @@ -4839,13 +4839,13 @@ void computeReferencePower_enc( const int16_t num_freq_bands /* i : Number of frequency bands */ #ifdef SBA_HOA_HBR_IMPROV , - const SBA_MODE sba_mode /* i : SBA mode */ + const SBA_MODE sba_mode /* i : SBA mode */ #endif ); ivas_error ivas_mono_dmx_renderer_open( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); void ivas_mono_downmix_render_passive( @@ -4926,15 +4926,15 @@ void ivas_lfe_lpf_select_filt_coeff( ); void ivas_filters_init( - ivas_filters_process_state_t *filter_state, - const float *filt_coeff, - const int16_t order + ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ + const float *filt_coeff, /* i : filter coefficients */ + const int16_t order /* i : filter order */ ); void ivas_filter_process( - ivas_filters_process_state_t *filter_state, - float *pIn_Out, - const int16_t length + ivas_filters_process_state_t *filter_state, /* i/o: filter state handle */ + float *pIn_Out, /* i : signal subject to filtering */ + const int16_t length /* i : filter order */ ); @@ -5004,7 +5004,7 @@ void TDREND_HRFILT_SetFiltSet( #endif ivas_error TDREND_REND_RenderSourceHRFilt( - TDREND_SRC_t *Src_p, /* i/o: The source to be rendered */ + TDREND_SRC_t *Src_p, /* i/o: The source to be rendered */ #ifdef TDREND_HRTF_TABLE_METHODS BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ #endif @@ -5051,7 +5051,7 @@ ivas_error TDREND_SRC_Alloc( ); void TDREND_SRC_Dealloc( - TDREND_SRC_t *Src_p /* i/o: Source to deallocate */ + TDREND_SRC_t *Src_p /* i/o: Source to deallocate */ ); void TDREND_SRC_Init( @@ -5149,7 +5149,7 @@ void TDREND_SFX_SpatBin_SetParams( void TDREND_SFX_SpatBin_Execute_Main( SFX_SpatBin_t *SfxSpatBin_p, /* i/o: Spatial parameters handle */ const float *InBuffer_p, /* i : Input buffer */ - const int16_t subframe_length, /* i : subframe length */ + const int16_t subframe_length, /* i : subframe length */ float *LeftOutBuffer_p, /* o : Rendered left channel */ float *RightOutBuffer_p, /* o : Rendered right channel */ int16_t *NoOfUsedInputSamples_p, /* o : Number of input samples actually used */ @@ -5191,9 +5191,9 @@ void ivas_fb_mixer_pcm_ingest( ); void ivas_dirac_enc_spar_delay_synchro( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ - const int16_t input_frame, /* i : input frame length */ - float data_f[][L_FRAME48k] /* i/o: input: ACN/SN3D, output: omni, stereo DMX or FOA*/ + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + const int16_t input_frame, /* i : input frame length */ + float data_f[][L_FRAME48k] /* i/o: SBA channels (ACN / SN3D) */ ); void ivas_fb_mixer_update_prior_input( diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 04f4becd22..de4f7867dc 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -301,14 +301,14 @@ void ivas_dirac_enc_close( *------------------------------------------------------------------------*/ void ivas_dirac_enc( - DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ - IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ - int16_t *nb_bits_metadata, /* o : number of metadata bits written */ - const int16_t Opt_DTX_ON, /* i : flag signaling DTX on */ - float data_f[][L_FRAME48k], /* i/o: input: ACN/SN3D, output: omni, stereo DMX or FOA*/ - const int16_t input_frame, /* i : input frame length */ - const int16_t sba_planar /* i : SBA planar flag */ + DIRAC_ENC_HANDLE hDirAC, /* i/o: encoder DirAC handle */ + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ + int16_t *nb_bits_metadata, /* o : number of metadata bits written */ + const int16_t Opt_DTX_ON, /* i : flag signaling DTX on */ + float data_f[][L_FRAME48k], /* i : SBA channels */ + const int16_t input_frame, /* i : input frame length */ + const int16_t sba_planar /* i : SBA planar flag */ ) { int16_t i; @@ -444,35 +444,35 @@ void ivas_dirac_enc( /*------------------------------------------------------------------------- - * computeReferencePower_enc() - * + * ivas_dirac_enc_spar_delay_synchro() * + * Delay input channels to be synchronized between DirAC and SPAR *-------------------------------------------------------------------------*/ void ivas_dirac_enc_spar_delay_synchro( - Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ - const int16_t input_frame, /* i : input frame length */ - float data_f[][L_FRAME48k] /* i/o: input: ACN/SN3D, output: omni, stereo DMX or FOA*/ + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + const int16_t input_frame, /* i : input frame length */ + float data_f[][L_FRAME48k] /* i/o: SBA channels (ACN / SN3D) */ ) { int16_t ch_idx; float tmp_buffer[L_FRAME48k]; - #ifdef CORECODER_BITRATE_SWITCHING + Encoder_State *sts[MCT_MAX_BLOCKS]; + int16_t sce_id, cpe_id, i_chan; + /* check last sba_mode */ if ( ivas_sba_mode_select( st_ivas->hEncoderConfig->last_ivas_total_brate ) == SBA_MODE_SPAR ) { - Encoder_State *sts[MCT_MAX_BLOCKS]; - int16_t i_chan = 0; - /* initializations */ - for ( int16_t sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + i_chan = 0; + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { sts[sce_id] = st_ivas->hSCE[sce_id]->hCoreCoder[0]; i_chan++; } - for ( int16_t cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { for ( int16_t ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -481,6 +481,7 @@ void ivas_dirac_enc_spar_delay_synchro( } } + /* populate old synchro buffers */ for ( ch_idx = 0; ch_idx < i_chan; ch_idx++ ) { mvr2r( sts[ch_idx]->input, st_ivas->hDirAC->sba_synchro_buffer[ch_idx], st_ivas->hDirAC->num_samples_synchro_delay ); -- GitLab From c622638d01e6c35da329b4f5226b28c73e9a3f8b Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Oct 2022 14:41:27 +0200 Subject: [PATCH 5/6] apply .clang-format --- lib_com/prot.h | 3 ++- lib_dec/er_dec_tcx.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_com/prot.h b/lib_com/prot.h index 6df1f543b7..7687e96fb2 100755 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -8128,7 +8128,8 @@ void con_tcx( const float coh, /* i : coherence of stereo signal */ int16_t *noise_seed, /* i/o: noise seed for stereo */ const int16_t only_left, /* i : TD-PLC only in left channel */ - const float A_cng[] ); + const float A_cng[] /* i : CNG LP filter coefficients */ +); /*! r: codebook index */ int16_t tcxlpc_get_cdk( diff --git a/lib_dec/er_dec_tcx.c b/lib_dec/er_dec_tcx.c index 4b507df683..6710e2a6ff 100644 --- a/lib_dec/er_dec_tcx.c +++ b/lib_dec/er_dec_tcx.c @@ -59,7 +59,8 @@ void con_tcx( const float coh, /* i : coherence of stereo signal */ int16_t *noise_seed, /* i/o: noise seed for stereo */ const int16_t only_left, /* i : TD-PLC only in left channel */ - const float A_cng[] ) + const float A_cng[] /* i : CNG LP filter coefficients */ +) { int16_t i, n, L_frame, L_subfr, fLowPassFilter, T0; int16_t offset = 0; -- GitLab From 2008d776d9fcae15c053657c5be9c47751ca5278 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Oct 2022 17:44:23 +0200 Subject: [PATCH 6/6] fix 'i/o' buffer label --- lib_com/ivas_prot.h | 2 +- lib_enc/ivas_dirac_enc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 6ee0b402ad..85f1b25c43 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3170,7 +3170,7 @@ void ivas_dirac_enc( BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ int16_t *nb_bits_metadata, /* o : number of metadata bits written */ const int16_t Opt_DTX_ON, /* i : flag signaling DTX on */ - float data_f[][L_FRAME48k], /* i : SBA channels */ + float data_f[][L_FRAME48k], /* i/o: SBA channels */ const int16_t input_frame, /* i : input frame length */ const int16_t sba_planar /* i : SBA planar flag */ ); diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index de4f7867dc..6d281256d9 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -306,7 +306,7 @@ void ivas_dirac_enc( BSTR_ENC_HANDLE hMetaData, /* i/o: Metadata bitstream handle */ int16_t *nb_bits_metadata, /* o : number of metadata bits written */ const int16_t Opt_DTX_ON, /* i : flag signaling DTX on */ - float data_f[][L_FRAME48k], /* i : SBA channels */ + float data_f[][L_FRAME48k], /* i/o: SBA channels */ const int16_t input_frame, /* i : input frame length */ const int16_t sba_planar /* i : SBA planar flag */ ) -- GitLab