diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 40a4710579dd35f964601e1becd5fa77e89dd6a6..e62ef001dc19266dc6f448dc3bea686ae9ce1658 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_filters.c b/lib_com/ivas_filters.c index 96148e5ca36e307389a66e64956a433adf320950..898ba7fe896ddd2b031f849d583229e060834233 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 6419fbc9058f7dde45bd3d1b4c71c4a572d1e9b5..f54f37414f31679f12010166e273bd9ccd071d4e 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1998,7 +1998,7 @@ void decoder_tcx_noisefilling( const int16_t *prm_sqQ, int16_t nf_seed, const int16_t bfi, /* i : Bad frame indicator */ - const int16_t MCT_flag, + const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const int16_t frame_cnt /* i : frame counter in the super frame */ ); @@ -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 @@ -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/o: 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 */ - 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_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index d7e47960b09673e0b9db4776b84c853d26bbb841..cf22cf38ff3fe3cc2838c8730c51fb7d552e3c81 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_stat_com.h b/lib_com/ivas_stat_com.h index 4b2c342f4f5bed4cbb86767f1db5c73d0a8f0c2a..026191559b76eff0d360e4b8ba50fa047242a3c6 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_com/ivas_tools.c b/lib_com/ivas_tools.c index 9594bf59001ffa406b358d5ddd419e10841a5c03..3c941ccc770657db2f2a7f6cfabb1d74cd1c55d9 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 9ea060effda520e74dd1644e0bcc0edf6b317bfe..2d6527fe59d1d5a1003d5206f07ccaa1b25ec276 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,17 +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 : hMCT handle allocated (1) or not (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( @@ -7882,13 +7881,12 @@ void decoder_tcx( ); void decoder_tcx_post( - Decoder_State *st, /* i/o: decoder memory state */ - float *synth, /* i/o: synthesis */ - float *synthFB, /* i/o: FB synthesis */ - float *A, /* i : A(z) filter coefficients */ - const int16_t bfi, /* i : Bad frame indicator */ - const int16_t MCT_flag /* i : hMCT handle allocated (1) or not (0) */ -); + Decoder_State *st, /* i/o: decoder memory state */ + float *synth, + float *synthFB, + float *A, /* i : A(z) filter coefficients */ + const int16_t bfi, + const int16_t isMCT ); void coder_acelp( Encoder_State *st, /* i/o: coder memory state */ @@ -8124,13 +8122,13 @@ 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[] /* i : CNG LP filter coefficients */ +); /*! r: codebook index */ int16_t tcxlpc_get_cdk( diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h index 7f82c9272faa9815561886b91c1f16630069f90b..4cf9c05f1e0dd0badc6c8b2df217febaf3f26303 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/dec_prm.c b/lib_dec/dec_prm.c index d458d62aa400067d66ad1599c50440ce0d01dfcb..4027b7f95b4b90e703eb4fdb24183d04d6bd3bde 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 : hMCT handle allocated (1) or not (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 4f9b0c3a28e5393bd10196e8ecfa2d4c7626d47e..c74564e1f70f6022720ba92225910a80460e24cb 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -1211,7 +1211,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 ); } diff --git a/lib_dec/er_dec_tcx.c b/lib_dec/er_dec_tcx.c index bf561c2abdbe6a3e805a486b7de1c2d1ba9af46b..6710e2a6ff9c19774e1485ce7ddd417b5ba3dad7 100644 --- a/lib_dec/er_dec_tcx.c +++ b/lib_dec/er_dec_tcx.c @@ -54,13 +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[] /* i : CNG LP filter coefficients */ ) { int16_t i, n, L_frame, L_subfr, fLowPassFilter, T0; diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 2598cf29b6f141ff29d5465c90736a891d28a576..4f022e2811f7f65320fdd24964d493715f1473b4 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/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 7fe27c4cd9132ed28eeb418695525a8b639dc858..748475dc5c9379536682365c7fda3ded85bd7110 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -102,8 +102,8 @@ static void dec_prm_tcx_sidebits( int16_t p_param[NB_DIV], /* o : pointer to parameters for next round of bs reading*/ int16_t nTnsBitsTCX10[NB_DIV], /* o : number of TNS bits per TCX10 subframe */ Decoder_State *st0, /* i/o: core decoder state handle - for bitstream */ - const int16_t MCT_flag, - const int16_t ch /* i : channel */ + const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ + const int16_t ch /* i : channel */ ) { CONTEXT_HM_CONFIG hm_cfg; diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 7a0590e6c1d1f9e9d083647ea7ab0ce8732b52e3..eea34b31dcd9d68fabd84932cd77a4a59a6538d2 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -474,7 +474,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 ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 925fa5dfd7267acdcff3b351763d7a47f21b9f39..765770f0c093228fd15e7888f7e4f600067cc2f1 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 */ @@ -428,6 +423,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 @@ -657,7 +653,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; @@ -713,6 +708,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 diff --git a/lib_dec/tonalMDCTconcealment.c b/lib_dec/tonalMDCTconcealment.c index 0078ca8bb4af9c4b809b6f194d0bff04e1635534..a16638da512bc5d980a5ed19c37d4c917e8d8aaa 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 063ec02d8f29f10222c53f9a468c878267341702..6d281256d922b65396da08f7c498964a205bb7be 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/o: 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 ); @@ -515,7 +516,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 2624389cc42606485bc63fb2ee3de587025cccb5..263d32292af2cf43eb273e542b1ffae753d5747c 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; }