From cf42e101851305e8f872a636e6e4bb8fb3d8800f Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 1 Jul 2024 11:23:45 +0530 Subject: [PATCH 1/2] Integration of common fixed point functions in encoder [x] Following functions have been integrated: ivas_get_horidac_flag ivas_dirac_config_bands ivas_dirac_config ivas_dirac_sba_config ivas_get_dirac_sba_mx_md_bits --- lib_com/ivas_cov_smooth.c | 75 +++++++++ lib_com/ivas_dirac_com.c | 48 +++--- lib_dec/ivas_dirac_dec.c | 2 +- lib_dec/ivas_init_dec.c | 14 +- lib_dec/ivas_sba_dec.c | 18 ++- lib_dec/ivas_spar_md_dec.c | 2 +- lib_enc/ivas_dirac_enc.c | 161 +++++++++++++++++++ lib_enc/ivas_spar_encoder.c | 299 ++++++++++++++++++++++++++++++++++++ 8 files changed, 581 insertions(+), 38 deletions(-) diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c index 2f9a462e8..6a762cb95 100644 --- a/lib_com/ivas_cov_smooth.c +++ b/lib_com/ivas_cov_smooth.c @@ -274,6 +274,7 @@ static void ivas_set_up_cov_smoothing( * Allocate and initialize SPAR Covar. smoothing handle *------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED ivas_error ivas_spar_covar_smooth_enc_open( ivas_cov_smooth_state_t **hCovState_out, /* i/o: SPAR Covar. smoothing handle */ const ivas_cov_smooth_cfg_t *cov_smooth_cfg, /* i : SPAR config. handle */ @@ -332,7 +333,48 @@ ivas_error ivas_spar_covar_smooth_enc_open( return IVAS_ERR_OK; } +#else +ivas_error ivas_spar_covar_smooth_enc_open( + ivas_cov_smooth_state_t **hCovState_out, /* i/o: SPAR Covar. smoothing handle */ + const ivas_cov_smooth_cfg_t *cov_smooth_cfg, /* i : SPAR config. handle */ + ivas_filterbank_t *pFb, /* i/o: FB handle */ + const int16_t nchan_inp, /* i : number of input channels */ + const COV_SMOOTHING_TYPE smooth_mode, /* i : Smooth covariance for SPAR or MC */ + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +) +{ + ivas_cov_smooth_state_t *hCovState; + int16_t i, j; + + if ( ( hCovState = (ivas_cov_smooth_state_t *) malloc( sizeof( ivas_cov_smooth_state_t ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); + } + + if ( ( hCovState->pSmoothing_factor = (float *) malloc( sizeof( float ) * cov_smooth_cfg->max_bands ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); + } + for ( i = 0; i < nchan_inp; i++ ) + { + for ( j = 0; j < nchan_inp; j++ ) + { + if ( ( hCovState->pPrior_cov_real[i][j] = (float *) malloc( sizeof( float ) * cov_smooth_cfg->max_bands ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); + } + set_zero( hCovState->pPrior_cov_real[i][j], cov_smooth_cfg->max_bands ); + } + } + + ivas_set_up_cov_smoothing( hCovState, pFb, cov_smooth_cfg->max_update_rate, cov_smooth_cfg->min_pool_size, smooth_mode, ivas_total_brate ); + + *hCovState_out = hCovState; + + return IVAS_ERR_OK; +} +#endif /*------------------------------------------------------------------------- * ivas_spar_covar_smooth_enc_close() @@ -340,6 +382,7 @@ ivas_error ivas_spar_covar_smooth_enc_open( * Deallocate SPAR Covar. smoothing handle *------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED void ivas_spar_covar_smooth_enc_close( ivas_cov_smooth_state_t **hCovState_out, /* i/o: SPAR Covar. smoothing handle */ const int16_t nchan_inp /* i : number of input channels */ @@ -379,6 +422,38 @@ void ivas_spar_covar_smooth_enc_close( return; } +#else +void ivas_spar_covar_smooth_enc_close( + ivas_cov_smooth_state_t **hCovState_out, /* i/o: SPAR Covar. smoothing handle */ + const int16_t nchan_inp /* i : number of input channels */ +) +{ + ivas_cov_smooth_state_t *hCovState; + int16_t i, j; + + hCovState = *hCovState_out; + + if ( hCovState != NULL ) + { + free( hCovState->pSmoothing_factor ); + hCovState->pSmoothing_factor = NULL; + + for ( i = 0; i < nchan_inp; i++ ) + { + for ( j = 0; j < nchan_inp; j++ ) + { + free( hCovState->pPrior_cov_real[i][j] ); + hCovState->pPrior_cov_real[i][j] = NULL; + } + } + + free( hCovState ); + hCovState_out = NULL; + } + + return; +} +#endif #ifdef IVAS_FLOAT_FIXED diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index b87592d22..3b70fd7df 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -61,38 +61,38 @@ static UWord16 deindex_sph_idx_general_fx( const Word16 idx_sph, const Word16 no *------------------------------------------------------------------------*/ /*! r: HO-DirAC flag */ -int16_t ivas_get_hodirac_flag( - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t sba_order /* i : Ambisonic (SBA) order */ +#ifdef IVAS_FLOAT_FIXED +Word16 ivas_get_hodirac_flag_fx( + const Word32 ivas_total_brate, /* i : IVAS total bitrate */ + const Word16 sba_order /* i : Ambisonic (SBA) order */ ) { - if ( sba_order > 1 && ivas_total_brate > IVAS_256k ) + IF( GT_16( sba_order, 1 ) && GT_32( ivas_total_brate, IVAS_256k ) ) { return 1; } - else + ELSE { return 0; } } +#endif -#ifdef IVAS_FLOAT_FIXED -Word16 ivas_get_hodirac_flag_fx( - const Word32 ivas_total_brate, /* i : IVAS total bitrate */ - const Word16 sba_order /* i : Ambisonic (SBA) order */ +int16_t ivas_get_hodirac_flag( + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t sba_order /* i : Ambisonic (SBA) order */ ) { - IF( GT_16( sba_order, 1 ) && GT_32( ivas_total_brate, IVAS_256k ) ) + if ( sba_order > 1 && ivas_total_brate > IVAS_256k ) { return 1; } - ELSE + else { return 0; } } -#endif /*------------------------------------------------------------------------- * ivas_dirac_sba_config() * @@ -169,7 +169,7 @@ ivas_error ivas_dirac_config_fx( spar_dirac_split_band = s_min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); - IF( ivas_get_hodirac_flag( ivas_total_brate, sba_order ) ) // add call after merge of 100861_dirac_dec + IF( ivas_get_hodirac_flag_fx( ivas_total_brate, sba_order ) ) // add call after merge of 100861_dirac_dec { spar_dirac_split_band = 0; } @@ -204,7 +204,7 @@ ivas_error ivas_dirac_config_fx( hConfig->enc_param_start_band = spar_dirac_split_band; } - IF( ivas_get_hodirac_flag( ivas_total_brate, sba_order ) ) + IF( ivas_get_hodirac_flag_fx( ivas_total_brate, sba_order ) ) { hConfig->dec_param_estim = FALSE; hConfig->enc_param_start_band = 0; @@ -217,17 +217,16 @@ ivas_error ivas_dirac_config_fx( IF( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) { // 100861_dirac_dec - ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft ); + ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft ); } ELSE { - ivas_dirac_config_bands( band_grouping, hConfig->nbands, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft ); + ivas_dirac_config_bands_fx( band_grouping, hConfig->nbands, (Word16) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft ); } return error; } -#endif - +#else ivas_error ivas_dirac_config( void *st_ivas, /* i/o: IVAS encoder/decoder state structure */ const int16_t enc_dec /* i : encoder or decoder flag */ @@ -354,6 +353,7 @@ ivas_error ivas_dirac_config( return error; } +#endif /*------------------------------------------------------------------------- @@ -362,6 +362,7 @@ ivas_error ivas_dirac_config( * DirAC Configuration freq. band function; used also in MASA decoder *------------------------------------------------------------------------*/ +#ifndef IVAS_FLOAT_FIXED void ivas_dirac_config_bands( int16_t *band_grouping, /* o : band grouping */ const int16_t nbands, /* i : number of bands */ @@ -458,8 +459,7 @@ void ivas_dirac_config_bands( return; } - -#ifdef IVAS_FLOAT_FIXED +#else void ivas_dirac_config_bands_fx( Word16 *band_grouping, /* o : band grouping */ const Word16 nbands, /* i : number of bands */ @@ -673,8 +673,7 @@ void ivas_get_dirac_sba_max_md_bits_fx( return; } -#endif - +#else void ivas_get_dirac_sba_max_md_bits( const int32_t sba_total_brate, int16_t *bits_frame_nominal, @@ -743,6 +742,7 @@ void ivas_get_dirac_sba_max_md_bits( return; } +#endif /*------------------------------------------------------------------------- * ivas_dirac_sba_config() @@ -832,8 +832,7 @@ ivas_error ivas_dirac_sba_config_fx( return error; } -#endif - +#else ivas_error ivas_dirac_sba_config( IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ int16_t *element_mode, /* i/o: element mode of the core coder */ @@ -908,6 +907,7 @@ ivas_error ivas_dirac_sba_config( return error; } +#endif #ifdef IVAS_FLOAT_FIXED diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index c5c65c8d1..f94faadc5 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -107,7 +107,7 @@ static ivas_error ivas_dirac_dec_config_internal_fx( * DirAC main configuration *-----------------------------------------------------------------*/ - IF( NE_32( ( error = ivas_dirac_config( (void *) st_ivas, DEC ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_dirac_config_fx( (void *) st_ivas, DEC ) ), IVAS_ERR_OK ) ) { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 294a97bf5..f223ffd6c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2054,7 +2054,7 @@ ivas_error ivas_init_decoder_fx( } } - Word16 hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); + Word16 hodirac_flag = ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ); IF( hodirac_flag ) { IF( NE_32( ( error = ivas_dirac_sba_config_fx( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, IVAS_MAX_NUM_BANDS, st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) @@ -2089,7 +2089,7 @@ ivas_error ivas_init_decoder_fx( st_ivas->hSpar->enc_param_start_band = s_min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); move16(); - IF( ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ) + IF( ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ) ) { st_ivas->hSpar->enc_param_start_band = 0; move16(); @@ -2245,17 +2245,17 @@ ivas_error ivas_init_decoder_fx( } } - Word16 hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); + Word16 hodirac_flag = ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ); IF( hodirac_flag ) { - IF( NE_32( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, IVAS_MAX_NUM_BANDS, st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_dirac_sba_config_fx( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, IVAS_MAX_NUM_BANDS, st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) { return error; } } ELSE { - IF( NE_32( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_dirac_sba_config_fx( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) { return error; } @@ -2280,7 +2280,7 @@ ivas_error ivas_init_decoder_fx( Word16 band_grouping[IVAS_MAX_NUM_BANDS + 1]; st_ivas->hSpar->enc_param_start_band = s_min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); - IF( ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ) + IF( ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ) ) { st_ivas->hSpar->enc_param_start_band = 0; move16(); @@ -2289,7 +2289,7 @@ ivas_error ivas_init_decoder_fx( move16(); } - ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), + ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 2d985870b..c060d0774 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -432,11 +432,19 @@ ivas_error ivas_sba_dec_reconfigure( ivas_mono_dmx_renderer_close( &st_ivas->hMonoDmxRenderer ); } +#ifdef IVAS_FLOAT_FIXED + if ( ( error = ivas_dirac_sba_config_fx( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), + st_ivas->ivas_format ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ) != IVAS_ERR_OK ) { return error; } +#endif if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) ) ) { @@ -462,7 +470,7 @@ ivas_error ivas_sba_dec_reconfigure( int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1]; st_ivas->hSpar->enc_param_start_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND ); - if ( ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ) + if ( ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ) ) { st_ivas->hSpar->enc_param_start_band = 0; @@ -470,8 +478,8 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } - ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); + ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ), + st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); if ( st_ivas->hDirAC ) { @@ -1084,7 +1092,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( ivas_mono_dmx_renderer_close( &st_ivas->hMonoDmxRenderer ); } - if ( NE_32( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), + if ( NE_32( ( error = ivas_dirac_sba_config_fx( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) { @@ -1122,7 +1130,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( move16(); } - ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( L_add( st_ivas->hDecoderConfig->output_Fs, 400 ) / CLDFB_BANDWIDTH ), + ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( L_add( st_ivas->hDecoderConfig->output_Fs, 400 ) / CLDFB_BANDWIDTH ), st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); if ( st_ivas->hDirAC ) diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 0bc16f201..4d5d54195 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -4914,7 +4914,7 @@ void ivas_spar_to_dirac_fx( enc_param_start_band = st_ivas->hSpar->enc_param_start_band / bw; active_w_vlbr = ( st_ivas->hDecoderConfig->ivas_total_brate < IVAS_24k4 ) ? 1 : 0; - if ( hDirAC != NULL && ivas_get_hodirac_flag( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ) == 0 ) + if ( hDirAC != NULL && ivas_get_hodirac_flag_fx( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ) == 0 ) { band_grouping = hDirAC->band_grouping; num_slots_in_subfr = st_ivas->hDirAC->hConfig->dec_param_estim ? CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES : 1; diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 6f58a2501..bd7b63a4c 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -57,6 +57,7 @@ static void computeIntensityVector_enc( DIRAC_ENC_HANDLE hDirAC, float Cldfb_Rea * Initialize DirAC handle *------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED ivas_error ivas_dirac_enc_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ) @@ -90,10 +91,17 @@ ivas_error ivas_dirac_enc_open( st_ivas->hDirAC = hDirAC; +#ifdef IVAS_FLOAT_FIXED + IF( ( error = ivas_dirac_config_fx( (void *) st_ivas, ENC ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_dirac_config( (void *) st_ivas, ENC ) ) != IVAS_ERR_OK ) { return error; } +#endif /* set FB config. */ hDirAC->hFbMixer = NULL; @@ -166,6 +174,117 @@ ivas_error ivas_dirac_enc_open( return error; } +#else +ivas_error ivas_dirac_enc_open( + Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ +) +{ + int16_t i, j; + DIRAC_ENC_HANDLE hDirAC; + int32_t dirac_slot_ns; + ivas_error error; + + error = IVAS_ERR_OK; + + if ( ( hDirAC = (DIRAC_ENC_HANDLE) malloc( sizeof( DIRAC_ENC_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } + + if ( ( hDirAC->hConfig = (DIRAC_CONFIG_DATA_HANDLE) malloc( sizeof( DIRAC_CONFIG_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC Config\n" ) ); + } + hDirAC->firstrun_sector_params = 1; + set_zero( hDirAC->sec_I_vec_smth_x[0], NUM_ANA_SECTORS * IVAS_MAX_NUM_BANDS ); + set_zero( hDirAC->sec_I_vec_smth_y[0], NUM_ANA_SECTORS * IVAS_MAX_NUM_BANDS ); + set_zero( hDirAC->sec_I_vec_smth_z[0], NUM_ANA_SECTORS * IVAS_MAX_NUM_BANDS ); + set_zero( hDirAC->azi_prev, NUM_ANA_SECTORS * IVAS_MAX_NUM_BANDS ); + set_zero( hDirAC->ele_prev, NUM_ANA_SECTORS * IVAS_MAX_NUM_BANDS ); + set_zero( hDirAC->energy_smth[0], NUM_ANA_SECTORS * IVAS_MAX_NUM_BANDS ); + /*-----------------------------------------------------------------* + * DirAC main configuration + *-----------------------------------------------------------------*/ + + st_ivas->hDirAC = hDirAC; + + if ( ( error = ivas_dirac_config( (void *) st_ivas, ENC ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* set FB config. */ + hDirAC->hFbMixer = NULL; + + for ( i = 0; i < DIRAC_MAX_NBANDS + 1; i++ ) + { + /* adapt band grouping to from CLDFB to MDFT bands */ + hDirAC->band_grouping[i] *= CLDFB_TO_MDFT_FAC; + } + dirac_slot_ns = DIRAC_SLOT_ENC_NS; + + /* initialize delay for SPAR/DirAC delay synchronization */ + + /* intensity 3-dim */ + for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) + { + if ( ( hDirAC->direction_vector_m[i] = (float **) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } + + for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) + { + if ( ( hDirAC->direction_vector_m[i][j] = (float *) malloc( DIRAC_MAX_NBANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } + set_f( hDirAC->direction_vector_m[i][j], 0.0f, DIRAC_MAX_NBANDS ); + } + } + + hDirAC->no_col_avg_diff = (int16_t) ( DIRAC_NO_COL_AVG_DIFF_NS / dirac_slot_ns ); + for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) + { + if ( ( hDirAC->buffer_intensity_real[i] = (float **) malloc( hDirAC->no_col_avg_diff * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } + for ( j = 0; j < hDirAC->no_col_avg_diff; j++ ) + { + if ( ( hDirAC->buffer_intensity_real[i][j] = (float *) malloc( DIRAC_MAX_NBANDS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } + set_f( hDirAC->buffer_intensity_real[i][j], 0.0f, DIRAC_MAX_NBANDS ); + } + } + + if ( ( hDirAC->buffer_energy = (float *) malloc( DIRAC_MAX_NBANDS * hDirAC->no_col_avg_diff * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } + set_f( hDirAC->buffer_energy, 0.0f, DIRAC_MAX_NBANDS * hDirAC->no_col_avg_diff ); + + if ( st_ivas->hQMetaData->useLowerRes ) + { + hDirAC->block_grouping[0] = 0; + hDirAC->block_grouping[1] = MAX_PARAM_SPATIAL_SUBFRAMES; + } + else + { + mvs2s( DirAC_block_grouping_5ms_MDFT, hDirAC->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); + } + + hDirAC->index_buffer_intensity = 0; + hDirAC->mono_frame_count = 0; + + st_ivas->hDirAC = hDirAC; + st_ivas->hSpar->enc_param_start_band = st_ivas->hDirAC->hConfig->enc_param_start_band; + + return error; +} +#endif /*------------------------------------------------------------------------- @@ -174,6 +293,7 @@ ivas_error ivas_dirac_enc_open( * Reconfigure DirAC handle *------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED ivas_error ivas_dirac_enc_reconfigure( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ) @@ -189,10 +309,17 @@ ivas_error ivas_dirac_enc_reconfigure( * DirAC main configuration *-----------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED + IF( ( error = ivas_dirac_config_fx( (void *) st_ivas, ENC ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_dirac_config( (void *) st_ivas, ENC ) ) != IVAS_ERR_OK ) { return error; } +#endif if ( st_ivas->hQMetaData->useLowerRes ) { @@ -206,6 +333,40 @@ ivas_error ivas_dirac_enc_reconfigure( return error; } +#else +ivas_error ivas_dirac_enc_reconfigure( + Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ +) +{ + DIRAC_ENC_HANDLE hDirAC; + ivas_error error; + + error = IVAS_ERR_OK; + + hDirAC = st_ivas->hDirAC; + + /*-----------------------------------------------------------------* + * DirAC main configuration + *-----------------------------------------------------------------*/ + + if ( ( error = ivas_dirac_config( (void *) st_ivas, ENC ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( st_ivas->hQMetaData->useLowerRes ) + { + hDirAC->block_grouping[0] = 0; + hDirAC->block_grouping[1] = MAX_PARAM_SPATIAL_SUBFRAMES; + } + else + { + mvs2s( DirAC_block_grouping_5ms_MDFT, hDirAC->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); + } + + return error; +} +#endif /*------------------------------------------------------------------------- diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 0352d0fc9..75c174481 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -771,6 +771,7 @@ static ivas_error ivas_spar_cov_md_process( * Process call for SPAR encoder *-----------------------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED static ivas_error ivas_spar_enc_process( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ @@ -922,7 +923,11 @@ static ivas_error ivas_spar_enc_process( * DirAC encoding *-----------------------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED + hodirac_flag = ivas_get_hodirac_flag_fx( ivas_total_brate, st_ivas->sba_analysis_order ); +#else hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); +#endif if ( ( error = ivas_dirac_enc( st_ivas->hDirAC, hQMetaData, hMetaData, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, dtx_vad, hEncoderConfig->ivas_format, hodirac_flag ) ) != IVAS_ERR_OK ) { @@ -1100,3 +1105,297 @@ static ivas_error ivas_spar_enc_process( return error; } +#else +static ivas_error ivas_spar_enc_process( + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i : configuration structure */ + BSTR_ENC_HANDLE hMetaData, /* i/o: MetaData handle */ + const int16_t front_vad_flag, /* i : front-VAD decision */ + float *data_f[] /* i/o: input/transport audio channels */ +) +{ + float pcm_tmp[DIRAC_MAX_ANA_CHANS][L_FRAME48k * 2]; + float *p_pcm_tmp[DIRAC_MAX_ANA_CHANS]; +#ifdef IVAS_FLOAT_FIXED + Word32 pcm_tmp_fx[DIRAC_MAX_ANA_CHANS][L_FRAME48k * 2]; + Word32 *p_pcm_tmp_fx[DIRAC_MAX_ANA_CHANS]; + // Word16 q_pcm_tmp_fx[DIRAC_MAX_ANA_CHANS][L_FRAME48k * 2]; + // Word16 *q_p_pcm_tmp_fx[DIRAC_MAX_ANA_CHANS]; + Word16 q_pcm_fx[DIRAC_MAX_ANA_CHANS]; +#endif + int16_t i, j, input_frame, dtx_vad; + int16_t transient_det[2]; + int16_t hodirac_flag; + int32_t ivas_total_brate, input_Fs; + int16_t nchan_inp, sba_order, nchan_transport; + int16_t in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; + ivas_error error; + const int16_t *order; + SPAR_ENC_HANDLE hSpar = st_ivas->hSpar; + IVAS_QMETADATA_HANDLE hQMetaData = st_ivas->hQMetaData; + int16_t ts, l_ts, num_del_samples, b, i_ts; + + float *ppIn_FR_real[IVAS_SPAR_MAX_CH], *ppIn_FR_imag[IVAS_SPAR_MAX_CH]; + float wyzx_del_buf[FOA_CHANNELS][IVAS_FB_1MS_48K_SAMP]; + int16_t dyn_active_w_flag; + int16_t nchan_fb_in; + + push_wmops( "ivas_spar_enc_process" ); + + /*-----------------------------------------------------------------------------------------* + * Initialization + *-----------------------------------------------------------------------------------------*/ + + error = IVAS_ERR_OK; + + input_Fs = hEncoderConfig->input_Fs; + ivas_total_brate = hEncoderConfig->ivas_total_brate; + num_del_samples = hSpar->hFbMixer->fb_cfg->fb_latency; + + input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); + sba_order = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER ); + nchan_inp = ivas_sba_get_nchan_metadata( sba_order, hEncoderConfig->ivas_total_brate ); + assert( nchan_inp <= hEncoderConfig->nchan_inp ); + + nchan_fb_in = hSpar->hFbMixer->fb_cfg->nchan_fb_in; + nchan_transport = st_ivas->nchan_transport; + + for ( i = FOA_CHANNELS + 1; i < nchan_fb_in; i++ ) + { + mvr2r( data_f[HOA_keep_ind[i]], data_f[i], input_frame ); + } + + /*-----------------------------------------------------------------------------------------* + * Transient detector + *-----------------------------------------------------------------------------------------*/ + ivas_transient_det_process( hSpar->hTranDet, data_f[0], input_frame, transient_det ); +#ifdef DUMPS_ENABLED + float a[2]; + a[0] = transient_det[0]; + a[1] = transient_det[1]; + dbgwrite_txt( a, 2, "fixed.txt", NULL ); +#endif + if ( ivas_total_brate < IVAS_24k4 ) + { + transient_det[1] = 0; + } + + /* store previous input samples for W in local buffer */ + assert( num_del_samples <= IVAS_FB_1MS_48K_SAMP ); + if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) + { + /* fill delay (1 ms) buffer for all Transport channels */ + for ( i = 0; i < FOA_CHANNELS; i++ ) + { + int16_t idx = hSpar->hFbMixer->fb_cfg->remix_order[i]; + mvr2r( &hSpar->hFbMixer->ppFilterbank_prior_input[idx][hSpar->hFbMixer->fb_cfg->prior_input_length - num_del_samples], wyzx_del_buf[idx], num_del_samples ); + } + } + + /*-----------------------------------------------------------------------------------------* + * FB mixer ingest + *-----------------------------------------------------------------------------------------*/ + + for ( i = 0; i < nchan_fb_in; i++ ) + { + p_pcm_tmp[i] = pcm_tmp[i]; + } + + /* run Filter Bank overlapping MDFT analysis first, then we can use the temporary buffer for Parameter MDFT analysis*/ + ivas_fb_mixer_pcm_ingest( hSpar->hFbMixer, data_f, p_pcm_tmp, input_frame, hSpar->hMdEnc->HOA_md_ind ); + + /* prepare Parameter MDFT analysis */ + for ( i = 0; i < nchan_fb_in; i++ ) + { + ppIn_FR_real[i] = p_pcm_tmp[i]; + ppIn_FR_imag[i] = p_pcm_tmp[i] + input_frame; + p_pcm_tmp[i] = data_f[i]; + } + + l_ts = input_frame / MAX_PARAM_SPATIAL_SUBFRAMES; + + for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) + { + ivas_fb_mixer_get_windowed_fr( hSpar->hFbMixer, p_pcm_tmp, ppIn_FR_real, ppIn_FR_imag, l_ts, l_ts, nchan_fb_in ); + + ivas_fb_mixer_update_prior_input( hSpar->hFbMixer, p_pcm_tmp, l_ts, nchan_fb_in ); + + for ( i = 0; i < nchan_fb_in; i++ ) + { + p_pcm_tmp[i] += l_ts; + ppIn_FR_real[i] += l_ts; + ppIn_FR_imag[i] += l_ts; + } + } + + /* turn pointers back to the local buffer, needed for the following processing */ + for ( i = 0; i < nchan_fb_in; i++ ) + { + ppIn_FR_real[i] = pcm_tmp[i]; + ppIn_FR_imag[i] = pcm_tmp[i] + input_frame; + p_pcm_tmp[i] = pcm_tmp[i]; + } + + dtx_vad = ( hEncoderConfig->Opt_DTX_ON == 1 ) ? front_vad_flag : 1; + + /*-----------------------------------------------------------------------------------------* + * DirAC encoding + *-----------------------------------------------------------------------------------------*/ + + hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); + + if ( ( error = ivas_dirac_enc( st_ivas->hDirAC, hQMetaData, hMetaData, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, dtx_vad, hEncoderConfig->ivas_format, hodirac_flag ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Set Energy Ratio to 0.0 if the mono flag has been set */ + if ( hQMetaData->dirac_mono_flag ) + { + for ( b = hQMetaData->q_direction->cfg.start_band; b < hQMetaData->q_direction->cfg.nbands; b++ ) + { + for ( i_ts = 0; i_ts < ( ( dtx_vad == 1 ) ? hQMetaData->q_direction[0].cfg.nblocks : 1 ); i_ts++ ) + { + hQMetaData->q_direction[0].band_data[b].energy_ratio[i_ts] = 0.0f; + } + } + } + + /*-----------------------------------------------------------------------------------------* + * Covariance and MD processing + *-----------------------------------------------------------------------------------------*/ + + if ( ( error = ivas_spar_cov_md_process( hEncoderConfig, st_ivas->hSpar, st_ivas->hQMetaData, hMetaData, nchan_inp, sba_order, ppIn_FR_real, ppIn_FR_imag, transient_det, dtx_vad, nchan_transport, &dyn_active_w_flag ) ) != IVAS_ERR_OK ) + { + return error; + } + + /*-----------------------------------------------------------------------------------------* + * FB mixer + *-----------------------------------------------------------------------------------------*/ + + ivas_fb_mixer_get_in_out_mapping( hSpar->hFbMixer->fb_cfg, in_out_mixer_map ); + +#ifdef DEBUG_SPAR_DIRAC_WRITE_OUT_PRED_PARS + { + static FILE *fid = 0; + int16_t band = 9; + if ( !fid ) + { + fid = fopen( "pred_coeffs_enc.txt", "wt" ); + } + fprintf( fid, "%.6f\n", hSpar->hMdEnc->mixer_mat[1][0][band] ); + } +#endif + + ivas_fb_mixer_process( hSpar->hFbMixer, hSpar->hMdEnc->mixer_mat, p_pcm_tmp, input_frame, in_out_mixer_map ); + + if ( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) + { + + /*cross fade between new active W channels and old passive W channel*/ + if ( dyn_active_w_flag == 1 ) + { + if ( hSpar->hMdEnc->spar_md.prior_dyn_active_w_flag != dyn_active_w_flag ) + { + float new_w[L_FRAME48k]; + + /* delayed W */ + mvr2r( wyzx_del_buf[0], p_pcm_tmp[0], num_del_samples ); + mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples ); + + mvr2r( wyzx_del_buf[hSpar->hMdEnc->spar_md.res_ind], new_w, num_del_samples ); + mvr2r( data_f[hSpar->hMdEnc->spar_md.res_ind], &new_w[num_del_samples], input_frame - num_del_samples ); + + if ( hSpar->hMdEnc->spar_md.prior_dyn_active_w_flag == 0 && dyn_active_w_flag == 1 ) + { + ivas_fb_mixer_cross_fading( hSpar->hFbMixer, p_pcm_tmp, p_pcm_tmp[0], new_w, 0, input_frame, 0 ); + } + else if ( hSpar->hMdEnc->spar_md.prior_dyn_active_w_flag == 1 && dyn_active_w_flag == 0 ) + { + ivas_fb_mixer_cross_fading( hSpar->hFbMixer, p_pcm_tmp, new_w, p_pcm_tmp[0], 0, input_frame, 0 ); + } + } + else + { + mvr2r( wyzx_del_buf[hSpar->hMdEnc->spar_md.res_ind], p_pcm_tmp[0], num_del_samples ); + mvr2r( data_f[hSpar->hMdEnc->spar_md.res_ind], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples ); + } + } + else + { + /* delayed W */ + mvr2r( wyzx_del_buf[0], p_pcm_tmp[0], num_del_samples ); + mvr2r( data_f[0], p_pcm_tmp[0] + num_del_samples, input_frame - num_del_samples ); + } + + for ( i = 1; i < hSpar->hFbMixer->fb_cfg->num_out_chans; i++ ) + { + int16_t idx = hSpar->hFbMixer->fb_cfg->remix_order[i]; + + /* delayed, reorderd and accumulated with (negative) prediction from W */ + v_add( wyzx_del_buf[idx], p_pcm_tmp[i], p_pcm_tmp[i], num_del_samples ); + v_add( data_f[idx], p_pcm_tmp[i] + num_del_samples, p_pcm_tmp[i] + num_del_samples, input_frame - num_del_samples ); + } + } + + /*-----------------------------------------------------------------------------------------* + * PCA encoder + *-----------------------------------------------------------------------------------------*/ + + if ( hSpar->hPCA != NULL ) + { + ivas_pca_enc( hEncoderConfig, hSpar->hPCA, hMetaData, p_pcm_tmp, input_frame, FOA_CHANNELS ); + } + else + { + if ( ivas_total_brate == PCA_BRATE && sba_order == SBA_FOA_ORDER ) + { + /* write PCA bypass bit */ + push_next_indice( hMetaData, PCA_MODE_INACTIVE, 1 ); + } + } + + + /*-----------------------------------------------------------------------------------------* + * AGC + *-----------------------------------------------------------------------------------------*/ + + if ( dtx_vad == 1 ) + { + if ( hSpar->AGC_Enable != 0 ) + { + ivas_agc_enc_process( hSpar->hAgcEnc, hMetaData, p_pcm_tmp, p_pcm_tmp, hSpar->hFbMixer->fb_cfg->num_out_chans, hEncoderConfig ); + } + } + + + /*-----------------------------------------------------------------------------------------* + * Re-order the dmx back to ACN/SN3D format + *-----------------------------------------------------------------------------------------*/ + + order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; + + for ( j = 0; j < nchan_transport; j++ ) + { + if ( st_ivas->nchan_transport < 3 ) + { + mvr2r( p_pcm_tmp[j], data_f[j], input_frame ); + } + else + { + mvr2r( p_pcm_tmp[j], data_f[order[j]], input_frame ); + } + } + for ( ; j < IVAS_SPAR_MAX_DMX_CHS; j++ ) + { + set_f( data_f[order[j]], 0.0f, input_frame ); + } + + hSpar->hMdEnc->spar_md.prior_dyn_active_w_flag = dyn_active_w_flag; + + pop_wmops(); + + return error; +} +#endif -- GitLab From af01ef9a8beab6020ec36cc011132e6f3a2bf7b8 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 1 Jul 2024 11:28:11 +0530 Subject: [PATCH 2/2] Clang formatting --- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_sba_dec.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f223ffd6c..5dafca0bc 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2290,7 +2290,7 @@ ivas_error ivas_init_decoder_fx( } ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, INV_CLDFB_BANDWIDTH_Q31 ) ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); + st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); } FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index c060d0774..3d9020f7c 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -1093,7 +1093,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( } if ( NE_32( ( error = ivas_dirac_sba_config_fx( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), - st_ivas->ivas_format ) ), + st_ivas->ivas_format ) ), IVAS_ERR_OK ) ) { return error; @@ -1131,7 +1131,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( } ivas_dirac_config_bands_fx( band_grouping, IVAS_MAX_NUM_BANDS, (Word16) ( L_add( st_ivas->hDecoderConfig->output_Fs, 400 ) / CLDFB_BANDWIDTH ), - st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); + st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 ); if ( st_ivas->hDirAC ) { -- GitLab