From 3e524c664bd0f222ad912ed95f0e380c88298e23 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 25 Aug 2025 12:50:34 +0200 Subject: [PATCH 1/4] port MR --- lib_com/ivas_prot_fx.h | 282 ++++++++++++++++----------------- lib_com/options.h | 1 + lib_dec/ivas_dirac_dec_fx.c | 166 +++++++++++++++++-- lib_dec/ivas_spar_decoder_fx.c | 14 ++ 4 files changed, 307 insertions(+), 156 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index f32acd9ad..d385e7def 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2175,7 +2175,8 @@ ivas_error only_reduce_bits_direction_fx( Word16 reduce_bits, const Word16 coding_subbands, const Word16 no_subframes, - Word16 *ind_order ); + Word16 *ind_order +); void ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( const Word32 az, /* i : azimuth Q22 */ @@ -2264,89 +2265,94 @@ void TDREND_SPATIAL_VecMapToNewCoordSystem_fx( ); void ivas_mct_side_bits_fx( - MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ - CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ - const Word16 nCPE, /* i : number of CPEs */ - Decoder_State *st0, /* i : decoder handle for Bstr */ - const Word16 bfi, /* i : BFI flag */ - UWord16 *bitstream, /* o : bitstream indices */ - const Word32 ivas_total_brate, /* i : IVAS total bitrate */ - const Word16 nb_bits_metadata /* i : number of metadata bits */ + MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ + CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS], /* i/o: CPE decoder structure */ + const Word16 nCPE, /* i : number of CPEs */ + Decoder_State *st0, /* i : decoder handle for Bstr */ + const Word16 bfi, /* i : BFI flag */ + UWord16 *bitstream, /* o : bitstream indices */ + const Word32 ivas_total_brate, /* i : IVAS total bitrate */ + const Word16 nb_bits_metadata /* i : number of metadata bits */ ); Flag conv_fx_32( - const Word16 x[], /* i : i vector Q_new*/ - const Word16 h[], /* i : impulse response (or second i vector) Q(15)*/ - Word32 y[], /* o : output vetor (result of convolution) 12 bits*/ - const Word16 L /* i : vector size */ + const Word16 x[], /* i : i vector Q_new*/ + const Word16 h[], /* i : impulse response (or second i vector) Q(15)*/ + Word32 y[], /* o : output vetor (result of convolution) 12 bits*/ + const Word16 L /* i : vector size */ ); void stereo_dtf_cng_fx( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - const Word32 ivas_total_brate, /* i : IVAS total bitrate */ - Word32 DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX], /* i/o: DFT buffers */ - const Word16 output_frame, /* i : output frame size */ - Word16 q_dft /* i : Q factor of the DFT data */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + const Word32 ivas_total_brate, /* i : IVAS total bitrate */ + Word32 DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX], /* i/o: DFT buffers */ + const Word16 output_frame, /* i : output frame size */ + Word16 q_dft /* i : Q factor of the DFT data */ ); - void ivas_spar_update_md_hist_fx( - ivas_spar_md_dec_state_t *hMdDec /* i/o: SPAR MD decoder handle */ + ivas_spar_md_dec_state_t *hMdDec /* i/o: SPAR MD decoder handle */ ); void ivas_spar_smooth_md_dtx_fx( - ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ - const Word16 num_bands_out, /* i : number of output bands */ - const Word16 num_md_sub_frames /* i : number of metadata subframes */ + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const Word16 num_bands_out, /* i : number of output bands */ + const Word16 num_md_sub_frames /* i : number of metadata subframes */ ); void ivas_spar_setup_md_smoothing_fx( - ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ - const Word16 num_bands_out, /* i : number of output bands */ - const Word16 num_md_sub_frames /* i : number of metadata subframes */ + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const Word16 num_bands_out, /* i : number of output bands */ + const Word16 num_md_sub_frames /* i : number of metadata subframes */ ); ivas_error ivas_mct_dec_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *output_fx[], /* o : output synthesis signal */ - const Word16 output_frame, /* i : output frame length per channel */ - const Word16 nb_bits_metadata /* i : number of metadata bits */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Word32 *output_fx[], /* o : output synthesis signal */ + const Word16 output_frame, /* i : output frame length per channel */ + const Word16 nb_bits_metadata /* i : number of metadata bits */ ); void ivas_dirac_dec_render_sf_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *output_fx[], /* i/o: synthesized core-coder transport channels/DirAC output */ - const Word16 nchan_transport, /* i : number of transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Word32 *output_fx[], /* i/o: synthesized core-coder transport channels/DirAC output */ + const Word16 nchan_transport, /* i : number of transport channels */ +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], + Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] +#else Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], - Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] ); + Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] +#endif +); void ivas_dirac_dec_render_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const Word16 nchan_transport, /* i : number of transport channels */ - const UWord16 nSamplesAsked, /* i : number of CLDFB slots requested */ - UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ - UWord16 *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ - Word32 *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const Word16 nchan_transport, /* i : number of transport channels */ + const UWord16 nSamplesAsked, /* i : number of CLDFB slots requested */ + UWord16 *nSamplesRendered, /* o : number of CLDFB slots rendered */ + UWord16 *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + Word32 *output_f[] /* o : rendered time signal */ ); void ivas_dirac_dec_read_BS_fx( - const Word32 ivas_total_brate, /* i : IVAS total bitrate */ - Decoder_State *st, /* i/o: decoder Core state structure */ - DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial rendering data handle */ - IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q metadata */ - Word16 *nb_bits, /* o : number of bits read */ - const Word16 last_bit_pos, /* i : last read bitstream position */ - const Word16 hodirac_flag, /* i : flag to indicate HO-DirAC mode */ + const Word32 ivas_total_brate, /* i : IVAS total bitrate */ + Decoder_State *st, /* i/o: decoder Core state structure */ + DIRAC_DEC_HANDLE hDirAC, /* i/o: decoder DirAC handle */ + SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial rendering data handle */ + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q metadata */ + Word16 *nb_bits, /* o : number of bits read */ + const Word16 last_bit_pos, /* i : last read bitstream position */ + const Word16 hodirac_flag, /* i : flag to indicate HO-DirAC mode */ #ifdef NONBE_FIX_1052_SBA_EXT - const Word16 nchan_transport, /* i : number of transport channels */ + const Word16 nchan_transport, /* i : number of transport channels */ #endif - Word16 *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ + Word16 *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); ivas_error ivas_dirac_dec_config_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const DIRAC_CONFIG_FLAG flag_configopen /* i/ : Flag determining if we open or reconfigure the DirAC decoder */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const DIRAC_CONFIG_FLAG flag_configopen /* i/ : Flag determining if we open or reconfigure the DirAC decoder */ ); void ivas_dirac_dec_output_synthesis_cov_close_fx( @@ -2355,121 +2361,122 @@ void ivas_dirac_dec_output_synthesis_cov_close_fx( ); ivas_error ivas_init_decoder_front_fx( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); ivas_error ivas_init_decoder_fx( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); void destroy_core_dec_fx( - DEC_CORE_HANDLE hCoreCoder /* i/o: core decoder structure */ + DEC_CORE_HANDLE hCoreCoder /* i/o: core decoder structure */ ); void ivas_destroy_dec_fx( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); ivas_error ivas_ism_dec_config_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const ISM_MODE last_ism_mode, /* i/o: last ISM mode */ - UWord16 *nSamplesRendered, /* o : number of samples flushed when the renderer granularity changes */ - Word16 *data /* o : output synthesis signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const ISM_MODE last_ism_mode, /* i/o: last ISM mode */ + UWord16 *nSamplesRendered, /* o : number of samples flushed when the renderer granularity changes */ + Word16 *data /* o : output synthesis signal */ ); ivas_error ivas_ism_metadata_dec_create_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const Word16 n_ISms, /* i : number of separately coded objects */ - Word32 element_brate_tmp[] /* o : element bitrate per object */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const Word16 n_ISms, /* i : number of separately coded objects */ + Word32 element_brate_tmp[] /* o : element bitrate per object */ ); void ivas_ism_reset_metadata_handle_dec_fx( - ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ + ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ); ivas_error ivas_sba_dec_reconfigure_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - UWord16 *nSamplesFlushed, /* o : number of samples flushed */ - Word16 *data /* o : output synthesis signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + UWord16 *nSamplesFlushed, /* o : number of samples flushed */ + Word16 *data /* o : output synthesis signal */ ); ivas_error ivas_spar_md_dec_matrix_open_fx( - ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ - const Word16 num_channels, /* i : number of internal channels */ - const Word16 num_md_sub_frames /* i : number of MD subframes */ + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const Word16 num_channels, /* i : number of internal channels */ + const Word16 num_md_sub_frames /* i : number of MD subframes */ ); void ivas_spar_md_dec_matrix_close_fx( - ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ - const Word16 num_channels /* i : number of internal channels */ + ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ + const Word16 num_channels /* i : number of internal channels */ ); ivas_error ivas_spar_dec_open_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ ); void ivas_param_mc_dec_read_BS_fx( - const Word32 ivas_total_brate, /* i : IVAS total bitrate */ - Decoder_State *st, /* i/o: decoder state structure */ - PARAM_MC_DEC_HANDLE hParamMC, /* i/o: decoder ParamMC handle */ - Word16 *nb_bits /* o : number of bits written */ + const Word32 ivas_total_brate, /* i : IVAS total bitrate */ + Decoder_State *st, /* i/o: decoder state structure */ + PARAM_MC_DEC_HANDLE hParamMC, /* i/o: decoder ParamMC handle */ + Word16 *nb_bits /* o : number of bits written */ ); ivas_error ivas_omasa_data_open_fx( - Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ); void ivas_omasa_data_close_fx( - MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ + MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ ); ivas_error ivas_mc_dec_config_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const Word16 idx, /* i : LS config. index */ - UWord16 *nSamplesRendered, /* o : samples flushed from last frame (JBM) */ - Word16 *data /* o : output synthesis signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const Word16 idx, /* i : LS config. index */ + UWord16 *nSamplesRendered, /* o : samples flushed from last frame (JBM) */ + Word16 *data /* o : output synthesis signal */ ); void ivas_lfe_window_init_fx( - LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle */ - const Word32 sampling_rate, /* i : sampling rate */ - const Word16 frame_len /* i : frame length in samples */ + LFE_WINDOW_HANDLE hLFEWindow, /* i/o: LFE window handle */ + const Word32 sampling_rate, /* i : sampling rate */ + const Word16 frame_len /* i : frame length in samples */ ); Word16 param_mc_get_num_cldfb_syntheses_fx( - Decoder_Struct *st_ivas /* i : Parametric MC handle */ + Decoder_Struct *st_ivas /* i : Parametric MC handle */ ); void InitPsychLPC_fx( - const Word32 sr_core, /* i : sampling rate of core-coder */ - const Word16 L_frame, /* i : frame length */ - const TCX_CONFIG_HANDLE hTcxCfg /* i : TCX configuration handle */ + const Word32 sr_core, /* i : sampling rate of core-coder */ + const Word16 L_frame, /* i : frame length */ + const TCX_CONFIG_HANDLE hTcxCfg /* i : TCX configuration handle */ ); ivas_error PsychoacousticParameters_Init_fx( - const Word32 sr_core, /* i : sampling rate of core-coder */ - const Word16 nBins, /* i : Number of bins (spectral lines) */ - const Word8 nBands, /* i : Number of spectrum subbands */ - const Word16 isTCX20, /* i : Flag indicating if the subband division is for TCX20 or TCX10 */ - const Word16 isWarped, /* i : Flag indicating if the scale is linear or warped */ - PsychoacousticParameters *pPsychParams ); + const Word32 sr_core, /* i : sampling rate of core-coder */ + const Word16 nBins, /* i : Number of bins (spectral lines) */ + const Word8 nBands, /* i : Number of spectrum subbands */ + const Word16 isTCX20, /* i : Flag indicating if the subband division is for TCX20 or TCX10 */ + const Word16 isWarped, /* i : Flag indicating if the scale is linear or warped */ + PsychoacousticParameters *pPsychParams +); ivas_error ivas_FB_mixer_open_fx( - IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ - const Word32 sampling_rate, /* i : sampling rate */ - IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ - const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ + IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ + const Word32 sampling_rate, /* i : sampling rate */ + IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ + const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ ); void ivas_FB_mixer_close_fx( - IVAS_FB_MIXER_HANDLE *hFbMixer_in, /* i/o: FB mixer handle */ - const Word32 sampling_rate, /* i : sampling rate in Hz */ - const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ + IVAS_FB_MIXER_HANDLE *hFbMixer_in, /* i/o: FB mixer handle */ + const Word32 sampling_rate, /* i : sampling rate in Hz */ + const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ ); void ivas_fb_mixer_get_in_out_mapping_fx( - const IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ - Word16 in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i/o: mixing mapping */ + const IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ + Word16 in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i/o: mixing mapping */ ); void ivas_fb_mixer_cross_fading_fx( @@ -2479,7 +2486,8 @@ void ivas_fb_mixer_cross_fading_fx( Word32 *pMdft_out_new_fx, const Word16 ch, const Word16 frame_len, - const Word16 cf_offset ); + const Word16 cf_offset +); // ivas_omasa_dec.c ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( @@ -2511,13 +2519,15 @@ Word16 ivas_sba_spar_sid_bitlen_fx( void ivas_sba_get_spar_hoa_ch_ind_fx( const Word16 num_md_chs, /* i : number of MD channels */ const Word32 ivas_total_brate, /* i : IVAS total bitrate */ - Word16 HOA_md_ind[IVAS_SPAR_MAX_CH] ); + Word16 HOA_md_ind[IVAS_SPAR_MAX_CH] +); void ivas_sba_get_spar_hoa_md_flag_fx( const Word16 sba_order, /* i : Ambisonic (SBA) order */ const Word32 ivas_total_brate, /* i : IVAS total bitrate */ Word16 *spar_hoa_md_flag, - Word16 *spar_hoa_dirac2spar_md_flag ); + Word16 *spar_hoa_dirac2spar_md_flag +); void ivas_omasa_dirac_rend_jbm_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -2654,28 +2664,15 @@ Word16 getNumChanAnalysis_fx( Encoder_Struct *st_ivas /* i : IVAS encoder structure */ ); + /*----------------------------------------------------------------------------------* * Limiter prototypes *----------------------------------------------------------------------------------*/ - -ivas_error ivas_limiter_open( - IVAS_LIMITER_HANDLE *hLimiter_out, /* o : limiter struct handle */ - const int16_t num_channels, /* i : number of I/O channels */ - const int32_t sampling_rate /* i : sampling rate for processing */ -); - void ivas_limiter_close( IVAS_LIMITER_HANDLE *phLimiter /* i/o: pointer to limiter handle, can be NULL */ ); -void ivas_limiter_dec( - IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */ - float *output[MAX_OUTPUT_CHANNELS], /* i/o: input/output buffer */ - const int16_t num_channels, /* i : number of channels to be processed */ - const int16_t output_frame, /* i : number of samples per channel in the buffer */ - const int16_t BER_detect /* i : BER detect flag */ -); void ivas_limiter_dec_fx( IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */ Word32 *output[MAX_OUTPUT_CHANNELS], /* i/o: input/output buffer */ @@ -2684,13 +2681,7 @@ void ivas_limiter_dec_fx( const Word16 BER_detect, /* i : BER detect flag */ Word16 q_factor /* i : Q factor of the output samples */ ); -void limiter_process( - IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */ - const int16_t output_frame, /* i : number of samples to be processed per channel in the I/O buffer */ - const float threshold, /* i : signal amplitude above which limiting starts to be applied */ - const int16_t BER_detect, /* i : BER detect flag */ - int16_t *strong_saturation_cnt /* i/o: counter of strong saturations (can be NULL) */ -); + void limiter_process_fx( IVAS_LIMITER_HANDLE hLimiter, /* i/o: limiter struct handle */ const Word16 output_frame, /* i : number of samples to be processed per channel in the I/O buffer */ @@ -2739,13 +2730,15 @@ void ivas_lfe_lpf_enc_apply_fx( // ivas_arith.c void ivas_ari_done_encoding_14bits_fx( BSTR_ENC_HANDLE hBstr, - Tastat *s ); + Tastat *s +); void ivas_ari_encode_14bits_ext_fx( BSTR_ENC_HANDLE hBstr, Tastat *s, Word32 symbol, - const UWord16 *cum_freq ); + const UWord16 *cum_freq +); void ms_inv_mask_processing_fx( STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: MDCT encoder structure */ @@ -2856,6 +2849,7 @@ void ivas_spar_bitrate_dist_fx( const Word16 sba_order, /* i : Ambisonic (SBA) order */ const Word16 bwidth /* i : audio bandwidth */ ); + ivas_error ivas_corecoder_enc_reconfig_fx( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ const Word16 nSCE_old, /* i : number of SCEs in previous frame */ @@ -2872,6 +2866,7 @@ void ivas_sba_zero_vert_comp_fx( const Word16 sba_planar, /* i : SBA planar flag */ const Word16 input_frame /* i : frame length */ ); + void tdm_configure_dec_fx( const Word16 ivas_format, /* i : IVAS format */ const Word16 ism_mode, /* i : ISM mode in combined format */ @@ -2894,6 +2889,7 @@ Word16 mdct_classifier_ivas_fx( const Word32 brate /* i : current brate, IVAS: nominal bitrate, EVS: st->total_brate */ ); + /*----------------------------------------------------------------------------------* * Range Coder prototypes *----------------------------------------------------------------------------------*/ @@ -6413,41 +6409,43 @@ void tdm_bit_alloc( const Word16 tdm_inst_ratio_idx /* i : instantaneous correlation ratio index */ ); - /*! r: value of the indice */ uint16_t get_indice_st( Decoder_State *st, /* i/o: decoder state structure */ - const Word32 element_brate, /* i : element bitrate */ - const Word16 pos, /* i : absolute position in the bitstream */ - const Word16 nb_bits /* i : number of bits to quantize the indice */ + const Word32 element_brate, /* i : element bitrate */ + const Word16 pos, /* i : absolute position in the bitstream */ + const Word16 nb_bits /* i : number of bits to quantize the indice */ ); + /*----------------------------------------------------------------------------------* * MDCT Stereo prototypes *----------------------------------------------------------------------------------*/ void stereo_mdct_core_enc_fx( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ - Word16 new_samples[CPE_CHANNELS][L_INP], /* i : new samples Q0*/ - Word16 old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP Qx*/ - Word16 pitch_buf_fx[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe Q6*/ + Word16 new_samples[CPE_CHANNELS][L_INP], /* i : new samples Q0*/ + Word16 old_wsp[CPE_CHANNELS][L_WSP], /* i : 12.8kHz weighted speech (for LTP Qx*/ + Word16 pitch_buf_fx[CPE_CHANNELS][NB_SUBFR16k] /* o : floating pitch for each subframe Q6*/ ); Word16 write_stereo_to_bitstream_fx ( STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: Stereo MDCT encoder structure */ Encoder_State **sts, /* i/o: Encoder state structure */ - Word16 ms_mask[NB_DIV][MAX_SFB], /* i : bandwise MS mask Q0*/ - const Word16 mct_on, /* i : flag mct block (1) or stereo (0) Q0*/ + Word16 ms_mask[NB_DIV][MAX_SFB], /* i : bandwise MS mask Q0*/ + const Word16 mct_on, /* i : flag mct block (1) or stereo (0) Q0*/ BSTR_ENC_HANDLE hBstr /* i/o: bitstream handle */ ); + /*----------------------------------------------------------------------------------* * Stereo CNG prototypes *----------------------------------------------------------------------------------*/ + void stereo_cng_dec_update( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - const Word32 ivas_total_brate /* i : IVAS total bitrate Q0*/ + const Word32 ivas_total_brate /* i : IVAS total bitrate Q0*/ ); diff --git a/lib_com/options.h b/lib_com/options.h index a9501c3a9..c1aec91ad 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,6 +168,7 @@ #define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ +#define FIX_1319_STACK_SBA_DECODER /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 39bcf9039..465bf1802 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2146,6 +2146,8 @@ void ivas_dirac_dec_set_md_map_fx( return; } + + /*------------------------------------------------------------------------- * ivas_dirac_dec_render_fx() * @@ -2222,23 +2224,105 @@ void ivas_dirac_dec_render_fx( } } - IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ){ - IF( EQ_16( st_ivas->hDirAC->hConfig->dec_param_estim, 1 ) ){ + /* clang-format off */ + IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) ) + { + IF( EQ_16( st_ivas->hDirAC->hConfig->dec_param_estim, 1 ) ) + { temp = add( hSpatParamRendCom->dirac_read_idx, DEFAULT_JBM_CLDFB_TIMESLOTS ); - hSpatParamRendCom->dirac_read_idx = sub( temp, i_mult( idiv1616( temp, hSpatParamRendCom->dirac_md_buffer_length ), hSpatParamRendCom->dirac_md_buffer_length ) ); // Q0 + hSpatParamRendCom->dirac_read_idx = sub( temp, i_mult( idiv1616( temp, hSpatParamRendCom->dirac_md_buffer_length ), hSpatParamRendCom->dirac_md_buffer_length ) ); // Q0 + } + ELSE + { + temp = add( hSpatParamRendCom->dirac_read_idx, DEFAULT_JBM_SUBFRAMES_5MS ); + hSpatParamRendCom->dirac_read_idx = sub( temp, i_mult( idiv1616( temp, hSpatParamRendCom->dirac_md_buffer_length ), hSpatParamRendCom->dirac_md_buffer_length ) ); // Q0 + } + } + + *nSamplesAvailableNext = i_mult( sub( hSpatParamRendCom->num_slots, hSpatParamRendCom->slots_rendered ), slot_size ); // Q0 + move16(); + + return; } -ELSE +/* clang-format on */ + + +#ifdef FIX_1319_STACK_SBA_DECODER +/*------------------------------------------------------------------------- + * Local functions to perform binaural rendering with optimized stack + *------------------------------------------------------------------------*/ + +static void binRenderer_split_fx( + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend, /* i/o: ISAR split binaural rendering handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ + const Word16 numTimeSlots, /* i : number of time slots to render */ + Word32 Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + Word32 ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + const Word16 slot_idx_start, + const Word16 num_freq_bands, + const Word16 nchan_out, + Word16 *input_q ) { - temp = add( hSpatParamRendCom->dirac_read_idx, DEFAULT_JBM_SUBFRAMES_5MS ); - hSpatParamRendCom->dirac_read_idx = sub( temp, i_mult( idiv1616( temp, hSpatParamRendCom->dirac_md_buffer_length ), hSpatParamRendCom->dirac_md_buffer_length ) ); // Q0 -} + Word16 pos_idx, slot_idx, ch; + Word32 Cldfb_RealBuffer_Binaural_loc[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + Word32 Cldfb_ImagBuffer_Binaural_loc[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + + /* Perform binaural rendering */ + ivas_binRenderer_fx( hBinRenderer, &hSplitBinRend->splitrend.multiBinPoseData, hCombinedOrientationData, numTimeSlots, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + NULL, +#endif + Cldfb_RealBuffer_Binaural_loc, Cldfb_ImagBuffer_Binaural_loc, RealBuffer, ImagBuffer, input_q ); + + FOR( slot_idx = 0; slot_idx < numTimeSlots; slot_idx++ ) + { + FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + Copy32( Cldfb_RealBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_RealBuffer_Binaural[0][ch][slot_idx], num_freq_bands ); + Copy32( Cldfb_ImagBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_ImagBuffer_Binaural[0][ch][slot_idx], num_freq_bands ); + } + } + + FOR( pos_idx = 0; pos_idx < hBinRenderer->numPoses; pos_idx++ ) + { + FOR( slot_idx = 0; slot_idx < numTimeSlots; slot_idx++ ) + { + FOR( ch = 0; ch < nchan_out; ch++ ) + { + Copy32( Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands ); + Copy32( Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands ); + } + } + } + + return; } -*nSamplesAvailableNext = i_mult( sub( hSpatParamRendCom->num_slots, hSpatParamRendCom->slots_rendered ), slot_size ); // Q0 -move16(); -return; +static void binRenderer_fx( + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ + const Word16 numTimeSlots, /* i : number of time slots to render */ + Word32 Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + Word32 ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + Word16 *input_q ) +{ + /* Perform binaural rendering */ + ivas_binRenderer_fx( hBinRenderer, NULL, hCombinedOrientationData, numTimeSlots, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + NULL, +#endif + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, input_q ); + + return; } +#endif + /*------------------------------------------------------------------------- * ivas_dirac_dec_render_sf_fx() @@ -2247,11 +2331,16 @@ return; *------------------------------------------------------------------------*/ void ivas_dirac_dec_render_sf_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - Word32 *output_buf_fx[], /* i/o: synthesized core-coder transport channels/DirAC output Q(6-1)*/ - const Word16 nchan_transport, /* i : number of transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Word32 *output_buf_fx[], /* i/o: synthesized core-coder transport channels/DirAC output Q(6-1)*/ + const Word16 nchan_transport, /* i : number of transport channels */ +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX], + Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX] +#else Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX], /*Q6*/ Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] /*Q6*/ +#endif ) { Word16 i, ch, idx_in, idx_lfe; @@ -2263,10 +2352,17 @@ void ivas_dirac_dec_render_sf_fx( Word16 slot_idx_start, slot_idx_start_cldfb_synth, md_idx; /*CLDFB: last output channels reserved to LFT for CICPx*/ +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + Word32 Cldfb_RealBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + Word32 Cldfb_ImagBuffer_Binaural_fx[1][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#else Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif Word16 index = 0, num_freq_bands = 0; move16(); move16(); @@ -2283,8 +2379,10 @@ void ivas_dirac_dec_render_sf_fx( Word16 surCohRatio_q_fx = 0, temp_q = 0; move16(); move16(); +#ifndef FIX_1319_STACK_SBA_DECODER Word32 Cldfb_RealBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Temp_fx[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#endif Word16 cldfb_buf_q; Word16 offset = 0, buff_len = 0; move16(); @@ -2779,11 +2877,19 @@ void ivas_dirac_dec_render_sf_fx( { q_temp_cldfb = Q11; move16(); +#ifdef FIX_1319_STACK_SBA_DECODER + cldfbAnalysis_ts_fx_fixed_q( &( st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][hSpatParamRendCom->num_freq_bands * index_slot] ), + Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ + Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], /* note: it is a tmp. buffer at this point */ + hSpatParamRendCom->num_freq_bands, + st_ivas->cldfbAnaDec[ch], &q_temp_cldfb ); +#else cldfbAnalysis_ts_fx_fixed_q( &st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][offset], Cldfb_RealBuffer_Temp_fx[ch][slot_idx], Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch], &q_temp_cldfb ); +#endif } q_cldfb = q_temp_cldfb; move16(); @@ -2792,7 +2898,11 @@ void ivas_dirac_dec_render_sf_fx( test(); IF( ( NE_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && NE_16( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) ) ) { +#ifdef FIX_1319_STACK_SBA_DECODER + ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); +#else ivas_omasa_preProcessStereoTransportsForMovedObjects_fx( st_ivas, Cldfb_RealBuffer_Temp_fx, Cldfb_ImagBuffer_Temp_fx, &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); +#endif } } @@ -2825,8 +2935,13 @@ void ivas_dirac_dec_render_sf_fx( { FOR( ch = 0; ch < nchan_transport; ch++ ) { +#ifdef FIX_1319_STACK_SBA_DECODER + Copy32( Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); + Copy32( Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); +#else Copy32( Cldfb_RealBuffer_Temp_fx[ch][slot_idx], Cldfb_RealBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); Copy32( Cldfb_ImagBuffer_Temp_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[ch][0], hSpatParamRendCom->num_freq_bands ); +#endif } } ELSE @@ -3874,7 +3989,19 @@ void ivas_dirac_dec_render_sf_fx( Word16 input_q; input_q = Q6; move16(); - +#ifdef FIX_1319_STACK_SBA_DECODER + test(); + IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + binRenderer_split_fx( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], + Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, slot_idx_start, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out, &input_q ); + } + ELSE + { + binRenderer_fx( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], + Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); + } +#else IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { IF( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) @@ -3899,6 +4026,7 @@ void ivas_dirac_dec_render_sf_fx( hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); +#endif Word16 pos_idx; IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) @@ -3921,8 +4049,13 @@ void ivas_dirac_dec_render_sf_fx( { /* open CLDFB buffer up to CLDFB_NO_CHANNELS_MAX bands for 48kHz */ Word32 *synth_fx = &output_buf_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands]; +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; + Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; +#else Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ ) { RealBuffer_fx[i] = Cldfb_RealBuffer_Binaural_fx[0][ch][i]; @@ -3968,8 +4101,13 @@ void ivas_dirac_dec_render_sf_fx( } ELSE { +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 *RealBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; + Word32 *ImagBuffer_fx[CLDFB_SLOTS_PER_SUBFRAME]; +#else Word32 *RealBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; Word32 *ImagBuffer_fx[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif Word16 outchannels; idx_in = 0; diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index 8832730ba..5a5b8c9df 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -1703,15 +1703,25 @@ void ivas_spar_dec_upmixer_sf_fx( ) { Word16 cldfb_band, num_cldfb_bands, numch_in, numch_out; +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 *cldfb_in_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; + Word32 *cldfb_in_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]; +#else Word32 *cldfb_in_ts_re_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; Word32 *cldfb_in_ts_im_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_COL_MAX]; +#endif Word16 i, b, ts, out_ch, in_ch; Word16 num_spar_bands, spar_band, nchan_transport; Word16 num_in_ingest, split_band; Word16 slot_size, slot_idx_start; Word16 md_idx; +#ifdef FIX_1319_STACK_SBA_DECODER + Word32 *p_tc_fx[HOA3_CHANNELS]; + Word32 Pcm_tmp_fx[HOA3_CHANNELS][2 /* Re, Im*/ * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; +#else Word32 *p_tc_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; Word32 Pcm_tmp_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; +#endif Word16 numch_out_dirac; Word32 mixer_mat_fx[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; Word16 b_skip_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; @@ -1805,7 +1815,11 @@ void ivas_spar_dec_upmixer_sf_fx( IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) ) { /* at this point, output channels are used as intermediate procesing buffers */ +#ifdef FIX_1319_STACK_SBA_DECODER + FOR( in_ch = 0; in_ch < HOA3_CHANNELS; in_ch++ ) +#else FOR( in_ch = 0; in_ch < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; in_ch++ ) +#endif { FOR( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { -- GitLab From e5185f1c686cc7632446170e41be1d5a43b7e669 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 27 Aug 2025 19:54:48 +0200 Subject: [PATCH 2/4] fix --- lib_dec/ivas_spar_decoder_fx.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index 843bf9a57..7c3d42524 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -808,6 +808,7 @@ void ivas_spar_get_cldfb_gains_fx( tgt_fx[sample] = L_shl( Mpy_32_32( tgt_fx[sample], L_add( T_fx[sample][0], L_add( T_fx[sample][1], T_fx[sample][2] ) ) ), 10 ); /*Q31*/ move32(); } + /* compute matrices */ FOR( slot_row = 0; slot_row < num_cf_slots; slot_row++ ) { @@ -842,6 +843,7 @@ void ivas_spar_get_cldfb_gains_fx( Word16 output_q = 27; move16(); matrix_inverse_fx( Tt_T_fx, Tt_T_inv_fx, num_cf_slots, &output_q ); + /* compute the optimal coefficients */ FOR( slot_row = 0; slot_row < num_cf_slots; slot_row++ ) { @@ -862,6 +864,8 @@ void ivas_spar_get_cldfb_gains_fx( return; } + + Word16 ivas_is_res_channel( const Word16 ch, /* i : ch index in WYZX ordering Q0*/ const Word16 nchan_transport /* i : number of transport channels (1-4) Q0*/ @@ -1190,8 +1194,6 @@ void ivas_spar_get_parameters_fx( } ELSE { - - FOR( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { FOR( in_ch = 0; in_ch < num_ch_in; in_ch++ ) @@ -1220,6 +1222,7 @@ void ivas_spar_get_parameters_fx( } } } + return; } @@ -1316,8 +1319,10 @@ static void ivas_spar_calc_smooth_facs_fx( Word32 smooth_short_avg_fx[IVAS_MAX_NUM_BANDS]; Word32 L_temp; Word16 exp_tmp, q_tmp; + bin = 0; move16(); + FOR( b = 0; b < nbands_spar; b++ ) { test(); @@ -1640,7 +1645,6 @@ void ivas_spar_dec_digest_tc_fx( IF( hSpar->hTdDecorr ) { - ivas_td_decorr_process_fx( hSpar->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr ); st_ivas->hTcBuffer->q_tc_fx = s_min( st_ivas->hTcBuffer->q_tc_fx, q_format ); move16(); @@ -1719,6 +1723,7 @@ void ivas_spar_dec_upmixer_sf_fx( Word16 q1 = 30; Word16 prod; move16(); + push_wmops( "ivas_spar_dec_upmixer_sf_fx" ); hSpar = st_ivas->hSpar; hDecoderConfig = st_ivas->hDecoderConfig; @@ -1770,7 +1775,6 @@ void ivas_spar_dec_upmixer_sf_fx( } } - /*---------------------------------------------------------------------* * TD Decorr and pcm ingest *---------------------------------------------------------------------*/ @@ -1793,12 +1797,16 @@ void ivas_spar_dec_upmixer_sf_fx( hSpar->hFbMixer->fb_cfg->num_in_chans = num_in_ingest; /*Q0*/ move16(); - /*---------------------------------------------------------------------* * Prepare CLDFB buffers *---------------------------------------------------------------------*/ +#ifdef FIX_1319_STACK_SBA_DECODER + set_zero_fx( &Pcm_tmp_fx[0][0], HOA3_CHANNELS * 2 * L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ); +#else set_zero_fx( &Pcm_tmp_fx[0][0], ( MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS ) * L_FRAME48k ); +#endif + /* set-up pointers */ IF( NE_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_FOA ) ) { @@ -1842,7 +1850,6 @@ void ivas_spar_dec_upmixer_sf_fx( numch_out_dirac = hDecoderConfig->nchan_out; move16(); - /* CLDFB analysis of incoming frame */ FOR( in_ch = 0; in_ch < numch_in; in_ch++ ) { @@ -1908,6 +1915,7 @@ void ivas_spar_dec_upmixer_sf_fx( } } } + /* Note: This version splits the cldfb band loop into 2 loops, removing some inner-loop IF_statements */ Word16 min_cldf_band = s_min( CLDFB_PAR_WEIGHT_START_BAND, num_cldfb_bands ); Word32 out_re_fx[IVAS_SPAR_MAX_CH]; @@ -1949,7 +1957,6 @@ void ivas_spar_dec_upmixer_sf_fx( } } - /* Second loop from min_cldf_band (CLDFB_PAR_WEIGHT_START_BAND) till num_cldfb_bands */ FOR( ; cldfb_band < num_cldfb_bands; cldfb_band++ ) { @@ -1989,6 +1996,7 @@ void ivas_spar_dec_upmixer_sf_fx( move32(); } } + test(); IF( ( EQ_16( ( add( add( slot_idx_start, ts ), 1 ) ), hSpar->num_slots ) ) || ( NE_16( ( shr( md_idx, 2 ) /* md_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME */ ), ( hSpar->render_to_md_map[( ( slot_idx_start + ts ) + 1 )] / JBM_CLDFB_SLOTS_IN_SUBFRAME /*It's value is 4*/ ) ) ) ) { -- GitLab From 92520238953f291dabc0815895bbf58b55eb9f54 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 27 Aug 2025 21:28:13 +0200 Subject: [PATCH 3/4] fix --- lib_dec/ivas_dirac_dec_fx.c | 52 +++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 8ee8f04b5..8bdc2a16a 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2233,14 +2233,14 @@ void ivas_dirac_dec_render_fx( *------------------------------------------------------------------------*/ static void binRenderer_split_fx( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend, /* i/o: ISAR split binaural rendering handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ - const Word16 numTimeSlots, /* i : number of time slots to render */ - Word32 Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ - Word32 Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ - Word32 RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - Word32 ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend, /* i/o: ISAR split binaural rendering handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ + const Word16 numTimeSlots, /* i : number of time slots to render */ + Word32 Cldfb_RealBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 Cldfb_ImagBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ const Word16 slot_idx_start, const Word16 num_freq_bands, const Word16 nchan_out, @@ -2255,14 +2255,14 @@ static void binRenderer_split_fx( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif - Cldfb_RealBuffer_Binaural_loc, Cldfb_ImagBuffer_Binaural_loc, RealBuffer, ImagBuffer, input_q ); + Cldfb_RealBuffer_Binaural_loc, Cldfb_ImagBuffer_Binaural_loc, RealBuffer_fx, ImagBuffer_fx, input_q ); FOR( slot_idx = 0; slot_idx < numTimeSlots; slot_idx++ ) { FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - Copy32( Cldfb_RealBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_RealBuffer_Binaural[0][ch][slot_idx], num_freq_bands ); - Copy32( Cldfb_ImagBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_ImagBuffer_Binaural[0][ch][slot_idx], num_freq_bands ); + Copy32( Cldfb_RealBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_RealBuffer_Binaural_fx[0][ch][slot_idx], num_freq_bands ); + Copy32( Cldfb_ImagBuffer_Binaural_loc[0][ch][slot_idx], Cldfb_ImagBuffer_Binaural_fx[0][ch][slot_idx], num_freq_bands ); } } @@ -2283,13 +2283,13 @@ static void binRenderer_split_fx( static void binRenderer_fx( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ - const Word16 numTimeSlots, /* i : number of time slots to render */ - Word32 Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ - Word32 Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ - Word32 RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - Word32 ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ + const Word16 numTimeSlots, /* i : number of time slots to render */ + Word32 Cldfb_RealBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 Cldfb_ImagBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ Word16 *input_q ) { /* Perform binaural rendering */ @@ -2297,7 +2297,7 @@ static void binRenderer_fx( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, input_q ); + Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, RealBuffer_fx, ImagBuffer_fx, input_q ); return; } @@ -3888,6 +3888,20 @@ void ivas_dirac_dec_render_sf_fx( test(); IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { + IF( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) + { + FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) + { + FOR( ch = 0; ch < st_ivas->hBinRenderer->nInChannels; ch++ ) + { + Copy32( Cldfb_RealBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); + Copy32( Cldfb_ImagBuffer_fx[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer_fx[ch][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); + } + } + st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config; + move16(); + } + binRenderer_split_fx( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, slot_idx_start, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out, &input_q ); } -- GitLab From 216fae66cf1d7d1207a9e06562900c01304bedf3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 27 Aug 2025 22:10:28 +0200 Subject: [PATCH 4/4] fix --- lib_dec/ivas_dirac_dec_fx.c | 46 ++++++++++++++----------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 8bdc2a16a..8d033c851 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2243,19 +2243,21 @@ static void binRenderer_split_fx( Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ const Word16 slot_idx_start, const Word16 num_freq_bands, - const Word16 nchan_out, - Word16 *input_q ) + const Word16 nchan_out ) { - Word16 pos_idx, slot_idx, ch; + Word16 pos_idx, slot_idx, ch, input_q; Word32 Cldfb_RealBuffer_Binaural_loc[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer_Binaural_loc[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + input_q = Q6; + move16(); + /* Perform binaural rendering */ ivas_binRenderer_fx( hBinRenderer, &hSplitBinRend->splitrend.multiBinPoseData, hCombinedOrientationData, numTimeSlots, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif - Cldfb_RealBuffer_Binaural_loc, Cldfb_ImagBuffer_Binaural_loc, RealBuffer_fx, ImagBuffer_fx, input_q ); + Cldfb_RealBuffer_Binaural_loc, Cldfb_ImagBuffer_Binaural_loc, RealBuffer_fx, ImagBuffer_fx, &input_q ); FOR( slot_idx = 0; slot_idx < numTimeSlots; slot_idx++ ) { @@ -2289,15 +2291,20 @@ static void binRenderer_fx( Word32 Cldfb_RealBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ Word32 Cldfb_ImagBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - Word16 *input_q ) + Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ +) { + Word16 input_q; + + input_q = Q6; + move16(); + /* Perform binaural rendering */ ivas_binRenderer_fx( hBinRenderer, NULL, hCombinedOrientationData, numTimeSlots, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif - Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, RealBuffer_fx, ImagBuffer_fx, input_q ); + Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, RealBuffer_fx, ImagBuffer_fx, &input_q ); return; } @@ -3880,10 +3887,7 @@ void ivas_dirac_dec_render_sf_fx( st_ivas->hIsmRendererData->interp_offset_fx = add( st_ivas->hIsmRendererData->interp_offset_fx, i_mult( hSpatParamRendCom->num_freq_bands, st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered] ) ); } - /* Perform binaural rendering */ - Word16 input_q; - input_q = Q6; - move16(); + /* Perform binaural rendering, output in Q6 format */ #ifdef FIX_1319_STACK_SBA_DECODER test(); IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) @@ -3903,12 +3907,12 @@ void ivas_dirac_dec_render_sf_fx( } binRenderer_split_fx( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, slot_idx_start, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out, &input_q ); + Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, slot_idx_start, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out ); } ELSE { binRenderer_fx( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); + Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx ); } #else IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) @@ -3937,22 +3941,6 @@ void ivas_dirac_dec_render_sf_fx( Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); #endif - Word16 pos_idx; - IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - FOR( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) - { - FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) - { - Copy32( Cldfb_RealBuffer_Binaural_fx[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[add( i_mult( pos_idx, BINAURAL_CHANNELS ), ch )][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); // Q6 - Copy32( Cldfb_ImagBuffer_Binaural_fx[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[add( i_mult( pos_idx, BINAURAL_CHANNELS ), ch )][add( slot_idx_start, slot_idx )], hSpatParamRendCom->num_freq_bands ); // Q6 - } - } - } - } - /* Inverse CLDFB*/ FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { -- GitLab