From 02ec59ebe8353da6689f2460553dbb60d3dd4d45 Mon Sep 17 00:00:00 2001 From: Rivukanta Bhattacharya <100792@ittiam.com> Date: Thu, 1 Jun 2023 20:20:20 +0530 Subject: [PATCH 1/6] SBA VLBR 20ms Optimization --- lib_com/ivas_prot.h | 4 ++ lib_com/options.h | 4 ++ lib_dec/ivas_dec.c | 8 +++ lib_dec/ivas_jbm_dec.c | 8 +++ lib_dec/ivas_masa_dec.c | 4 ++ lib_dec/ivas_sba_dec.c | 4 ++ lib_dec/ivas_sba_rendering_internal.c | 9 +++ lib_dec/ivas_spar_decoder.c | 7 +++ lib_dec/ivas_spar_md_dec.c | 83 +++++++++++++++++++++++++-- lib_rend/ivas_sba_rendering.c | 37 ++++++++++-- 10 files changed, 160 insertions(+), 8 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f455c552a5..ff4c59af56 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4395,6 +4395,10 @@ void ivas_sba_mix_matrix_determiner( const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ +#ifdef VLBR_20MS_MD + , + const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */ +#endif ); /* AGC */ diff --git a/lib_com/options.h b/lib_com/options.h index 8a491e2499..ccbaa53ff0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -209,6 +209,8 @@ #define FIX_468_16KHZ_PUPMIX /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */ #define FIX_499_DFT_STEREO_PLC /* Eri: Fix for issue 499: Wrong past memory addressed for computing energy of DFT stereo residual ECU frame */ #define FIX_489_COV_SMOOTHING /* Dlb: Fix covariance smoothing for ParamUpmix */ +#define FIX_501_TABLE_IDX_INIT /* Dlb: Fix for the issue 501 */ + #define FIX_485_STATIC_BUFFERS /* FhG: move static buffers in DirAC parameter estimator to the DirAC struct */ #define FIX_I503_ASAN_ERROR_IND_LIST /* VA: fix issue #503: address sanitizer error with IND_LIST_DYN */ #define FIX_473_JITTER_NONDIEGETIC_PANNING /* FhG,Orange: add missing non-diegetic panning to JITTER */ @@ -232,6 +234,8 @@ #define FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER /* ..\apps\renderer.c(240): .... (todo: implementation)",*/ #define REMOVE_OBS_CODE /* FhG: Remove unnecessary assignement after LFE cleanup (Issue #451)*/ +#define VLBR_20MS_MD /* Dlb: SBA VLBR 20ms Optimization*/ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 82f03fdb3b..edec0deeb0 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -69,6 +69,9 @@ ivas_error ivas_dec( #ifdef JBM_TSM_ON_TCS float *p_output[MAX_OUTPUT_CHANNELS]; #endif +#ifdef VLBR_20MS_MD + int16_t num_md_sub_frames; +#endif error = IVAS_ERR_OK; @@ -458,7 +461,12 @@ ivas_error ivas_dec( #endif { +#ifdef VLBR_20MS_MD + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames ); +#else ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame ); +#endif } #ifdef JBM_TSM_ON_TCS #ifndef SBA_MODE_CLEAN_UP diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 04ae490414..3248c2d60a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -78,6 +78,9 @@ ivas_error ivas_jbm_dec_tc( AUDIO_CONFIG output_config; ivas_error error; float *p_output[MAX_TRANSPORT_CHANNELS]; +#ifdef VLBR_20MS_MD + int16_t num_md_sub_frames; +#endif error = IVAS_ERR_OK; @@ -311,7 +314,12 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) #endif { +#ifdef VLBR_20MS_MD + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames ); +#else ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame ); +#endif } #ifndef SBA_MODE_CLEAN_UP else if ( st_ivas->sba_mode == SBA_MODE_SPAR ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 8d6cebe036..34bf8c576d 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1414,7 +1414,11 @@ void ivas_spar_param_to_masa_param_mapping( else { #ifdef JBM_TSM_ON_TCS +#ifdef VLBR_20MS_MD + mixer_mat_index = ( ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) == 1 ) ? 0 : ( sf - SPAR_META_DELAY_SUBFRAMES ); +#else mixer_mat_index = sf - SPAR_META_DELAY_SUBFRAMES; +#endif #else mixer_mat_index = subframe - SPAR_META_DELAY_SUBFRAMES; #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 478749ddc0..d7ef992b36 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -176,7 +176,11 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } +#ifdef VLBR_20MS_MD + if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate >= IVAS_24k4 && ivas_total_brate < IVAS_24k4 ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) +#else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) +#endif { ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index dd4af01ccf..1e4c9eb9e6 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -653,6 +653,10 @@ void ivas_sba_mix_matrix_determiner( const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ +#ifdef VLBR_20MS_MD + , + const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */ +#endif ) { int16_t i, ch; @@ -696,8 +700,13 @@ void ivas_sba_mix_matrix_determiner( /* Mixing matrix determiner */ num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; +#ifdef VLBR_20MS_MD + ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, bfi, + num_md_sub_frames ); +#else ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, bfi, MAX_PARAM_SPATIAL_SUBFRAMES ); +#endif return; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 0d028b2359..06e50255fa 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -123,7 +123,14 @@ ivas_error ivas_spar_dec_open( return error; } hSpar->hMdDec->td_decorr_flag = 1; +#ifdef FIX_501_TABLE_IDX_INIT + if ( hSpar->hTdDecorr && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) + { + hSpar->hTdDecorr->ducking_flag = ivas_spar_br_table_consts[hSpar->hMdDec->table_idx].td_ducking; + } +#else hSpar->hMdDec->table_idx = -1; +#endif /* set FB config. */ active_w_mixing = -1; diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index cf03e7b9d8..8ceda9fb18 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -83,9 +83,11 @@ static ivas_error ivas_spar_set_dec_config( ivas_spar_md_dec_state_t *hMdDec, co static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decoder_State *st, const int16_t bw, const int16_t num_bands, int16_t *num_dmx_per_band, int16_t *num_dec_per_band ); static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 ); - +#ifdef FIX_501_TABLE_IDX_INIT +static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode, const int32_t last_active_brate ); +#else static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode ); - +#endif /*------------------------------------------------------------------------- * ivas_spar_md_dec_matrix_open() @@ -254,6 +256,12 @@ int16_t ivas_get_spar_dec_md_num_subframes( num_subframes = 1; } } +#ifdef VLBR_20MS_MD + if ( ivas_total_brate < IVAS_24k4 ) + { + num_subframes = 1; + } +#endif return ( num_subframes ); } @@ -289,11 +297,29 @@ ivas_error ivas_spar_md_dec_open( return error; } +#ifdef FIX_501_TABLE_IDX_INIT + if ( hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) + { + if ( sid_format == SID_SBA_2TC ) + { + hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + } + else + { + hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_24k4, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + } + } + else + { + hMdDec->table_idx = ivas_get_spar_table_idx( hDecoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + } +#else hMdDec->table_idx = 0; /* just to initialize state variables*/ if ( ( hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) && ( sid_format == SID_SBA_2TC ) ) { hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL ); } +#endif if ( ( error = ivas_spar_md_dec_init( hMdDec, hDecoderConfig, num_channels, sba_order ) ) != IVAS_ERR_OK ) { return error; @@ -671,7 +697,12 @@ void ivas_spar_md_dec_process( ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate, - ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode ); + ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode +#ifdef FIX_501_TABLE_IDX_INIT + , + st_ivas->last_active_ivas_total_brate +#endif + ); #if 0 { @@ -1707,7 +1738,12 @@ static void ivas_spar_dec_parse_md_bs( int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, - const int16_t sba_inactive_mode ) + const int16_t sba_inactive_mode +#ifdef FIX_501_TABLE_IDX_INIT + , + const int32_t last_active_brate +#endif +) { int16_t i, j, k, num_bands; int16_t ii, jj, ndec, ndm, b, idx; @@ -1718,6 +1754,9 @@ static void ivas_spar_dec_parse_md_bs( int16_t planarCP; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; +#ifdef FIX_501_TABLE_IDX_INIT + int16_t bw_final, bw_fact; +#endif *dtx_vad = 1; *bands_bw = 1; @@ -1790,13 +1829,33 @@ static void ivas_spar_dec_parse_md_bs( ivas_parse_parameter_bitstream_dtx( &hMdDec->spar_md, st0, *bands_bw, *nB, hMdDec->spar_md_cfg.num_dmx_chans_per_band, hMdDec->spar_md_cfg.num_decorr_per_band ); + +#ifdef FIX_501_TABLE_IDX_INIT + if ( last_active_brate >= IVAS_24k4 ) + { + bw_final = 1; + } + else + { + bw_final = 2; + } + bw_fact = *bands_bw / bw_final; +#endif for ( i = *nB - 1; i >= 0; i-- ) { +#ifdef FIX_501_TABLE_IDX_INIT + ndec = hMdDec->spar_md_cfg.num_decorr_per_band[bw_fact * i]; + + for ( b = bw_fact - 1; b >= 0; b-- ) + { + idx = i * bw_fact + b; +#else ndec = hMdDec->spar_md_cfg.num_decorr_per_band[( *bands_bw ) * i]; for ( b = *bands_bw - 1; b >= 0; b-- ) { idx = i * *bands_bw + b; +#endif for ( j = 0; j < FOA_CHANNELS - 1; j++ ) { hMdDec->spar_md.band_coeffs[idx].pred_re[j] = hMdDec->spar_md.band_coeffs[i].pred_re[j]; @@ -1809,8 +1868,13 @@ static void ivas_spar_dec_parse_md_bs( } } +#ifdef FIX_501_TABLE_IDX_INIT + *bands_bw = bw_final; + *nB = num_bands / bw_final; +#else *nB = num_bands; *bands_bw = 1; +#endif return; } @@ -3081,6 +3145,12 @@ void ivas_spar_to_dirac( } } } +#ifdef VLBR_20MS_MD + int16_t num_md_sub_frames; + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, st_ivas->hDecoderConfig->ivas_total_brate ); + ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, num_md_sub_frames, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, + end_band, num_bands_out / bw, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL, st_ivas->hQMetaData->useLowerRes, active_w_vlbr ); +#else int16_t num_subframes; num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; if ( st_ivas->hQMetaData->useLowerRes ) @@ -3089,12 +3159,17 @@ void ivas_spar_to_dirac( } ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, num_subframes, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, end_band, num_bands_out / bw, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL, st_ivas->hQMetaData->useLowerRes, active_w_vlbr ); +#endif if ( st_ivas->hQMetaData->useLowerRes && dtx_vad ) { for ( band = SPAR_DIRAC_SPLIT_START_BAND; band < IVAS_MAX_NUM_BANDS; band++ ) { +#ifdef VLBR_20MS_MD + for ( block = 1; block < num_md_sub_frames; block++ ) +#else for ( block = 1; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) +#endif { for ( int16_t i = 0; i < FOA_CHANNELS - 1; i++ ) /* pred coefficient index (index 0, 1, 2 predicts Y, Z, X respectively) */ { diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index 059cd847e1..3e36f173ef 100644 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -69,6 +69,11 @@ void ivas_sba_prototype_renderer( #ifdef JBM_TSM_ON_TCS int16_t slot_idx_start, md_idx; #endif +#ifdef VLBR_20MS_MD + int16_t sf_idx_flag, num_md_sub_frames; + sf_idx_flag = 0; + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); +#endif push_wmops( "ivas_sba_prototype_renderer" ); @@ -168,16 +173,40 @@ void ivas_sba_prototype_renderer( mvr2r( hSpar->hMdDec->mixer_mat_prev[3][0][0], hSpar->hMdDec->mixer_mat_prev[2][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); mvr2r( hSpar->hMdDec->mixer_mat_prev[4][0][0], hSpar->hMdDec->mixer_mat_prev[3][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) +#ifdef VLBR_20MS_MD + if ( num_md_sub_frames == 1 ) { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + if ( !sf_idx_flag ) { - for ( b = 0; b < num_spar_bands; b++ ) + for ( out_ch = 0; out_ch < numch_out; out_ch++ ) { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; + for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + { + for ( b = 0; b < num_spar_bands; b++ ) + { + hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b]; + } + } } } + sf_idx_flag = 1; } + else + { +#endif + for ( out_ch = 0; out_ch < numch_out; out_ch++ ) + { + for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + { + for ( b = 0; b < num_spar_bands; b++ ) + { + hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; + } + } + } +#ifdef VLBR_20MS_MD + } +#endif } #endif } -- GitLab From 3954aac564378774877c3a45cd748bfdcec3299d Mon Sep 17 00:00:00 2001 From: Rivukanta Bhattacharya <100792@ittiam.com> Date: Fri, 2 Jun 2023 19:04:28 +0530 Subject: [PATCH 2/6] Minor modification --- lib_dec/ivas_sba_dec.c | 2 +- lib_dec/ivas_spar_md_dec.c | 4 ++++ lib_rend/ivas_sba_rendering.c | 38 ++++++++--------------------------- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index d7ef992b36..6bce1610b7 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -177,7 +177,7 @@ ivas_error ivas_sba_dec_reconfigure( } #ifdef VLBR_20MS_MD - if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate >= IVAS_24k4 && ivas_total_brate < IVAS_24k4 ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) + if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) #else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) #endif diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 8ceda9fb18..c01323d126 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -3183,7 +3183,11 @@ void ivas_spar_to_dirac( } } /* expand DirAC TC 20ms MD for residual channels to all subframes*/ +#ifdef VLBR_20MS_MD + for ( block = 0; block < num_md_sub_frames; block++ ) +#else for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) +#endif { for ( band = SPAR_DIRAC_SPLIT_START_BAND; band < IVAS_MAX_NUM_BANDS; band++ ) { diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index 3e36f173ef..c2e33ed74f 100644 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -70,8 +70,7 @@ void ivas_sba_prototype_renderer( int16_t slot_idx_start, md_idx; #endif #ifdef VLBR_20MS_MD - int16_t sf_idx_flag, num_md_sub_frames; - sf_idx_flag = 0; + int16_t num_md_sub_frames; num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); #endif @@ -166,6 +165,9 @@ void ivas_sba_prototype_renderer( { /* we have crossed an unadapted parameter sf border, update previous mixing matrices */ int16_t md_sf = md_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME; +#ifdef VLBR_20MS_MD + md_sf = ( num_md_sub_frames == MAX_PARAM_SPATIAL_SUBFRAMES ) ? md_sf : 0; +#endif hSpar->i_subframe++; hSpar->i_subframe = min( hSpar->i_subframe, MAX_PARAM_SPATIAL_SUBFRAMES ); mvr2r( hSpar->hMdDec->mixer_mat_prev[1][0][0], hSpar->hMdDec->mixer_mat_prev[0][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); @@ -173,40 +175,16 @@ void ivas_sba_prototype_renderer( mvr2r( hSpar->hMdDec->mixer_mat_prev[3][0][0], hSpar->hMdDec->mixer_mat_prev[2][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); mvr2r( hSpar->hMdDec->mixer_mat_prev[4][0][0], hSpar->hMdDec->mixer_mat_prev[3][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); -#ifdef VLBR_20MS_MD - if ( num_md_sub_frames == 1 ) - { - if ( !sf_idx_flag ) - { - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) - { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( b = 0; b < num_spar_bands; b++ ) - { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b]; - } - } - } - } - sf_idx_flag = 1; - } - else + for ( out_ch = 0; out_ch < numch_out; out_ch++ ) { -#endif - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) + for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + for ( b = 0; b < num_spar_bands; b++ ) { - for ( b = 0; b < num_spar_bands; b++ ) - { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; - } + hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; } } -#ifdef VLBR_20MS_MD } -#endif } #endif } -- GitLab From ad4a1668dae54ca014630c8d45f852f720f86d89 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 13:29:54 +0530 Subject: [PATCH 3/6] Resolving the BR switching test cases failures. --- lib_com/ivas_prot.h | 11 ++++ lib_dec/ivas_sba_dec.c | 124 ++++++++++++++++++++++++++++++++++++- lib_dec/ivas_spar_md_dec.c | 28 ++++++--- 3 files changed, 151 insertions(+), 12 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 8d91fda692..bf918404ae 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4530,7 +4530,18 @@ void ivas_get_spar_md_from_dirac( int16_t ivas_get_spar_dec_md_num_subframes( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int32_t ivas_total_brate ); +#ifdef VLBR_20MS_MD + +ivas_error ivas_spar_md_dec_matrix_open( + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels, /* i : number of internal channels */ + const int16_t num_md_sub_frames ); +void ivas_spar_md_dec_matrix_close( + ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels ); /* i : number of internal channels */ + +#endif ivas_error ivas_spar_md_dec_open( ivas_spar_md_dec_state_t **hMdDec_out, /* i/o: SPAR MD decoder handle */ const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 79bde81a90..1a3a7517d6 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -110,7 +110,10 @@ ivas_error ivas_sba_dec_reconfigure( int16_t sba_dirac_stereo_flag_old; int32_t ivas_total_brate; int32_t last_ivas_total_brate; - +#ifdef VLBR_20MS_MD + int16_t num_channels, num_md_sub_frames; + int16_t i,j,k; +#endif RENDERER_TYPE old_renderer_type; DECODER_CONFIG_HANDLE hDecoderConfig; @@ -170,7 +173,7 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } -#ifdef VLBR_20MS_MD +#ifndef VLBR_20MS_MD if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) #else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) @@ -184,7 +187,65 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } +#ifdef VLBR_20MS_MD + else if ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) + { + + num_channels = st_ivas->hSpar->hMdDec->spar_md_cfg.num_umx_chs; + + ivas_spar_md_dec_matrix_close( st_ivas->hSpar->hMdDec, num_channels ); + + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, ivas_total_brate ); + if ( ( error = ivas_spar_md_dec_matrix_open( st_ivas->hSpar->hMdDec, num_channels, + num_md_sub_frames ) ) != IVAS_ERR_OK ) + { + return error; + } + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; + } + } + } + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; + } + } + } + } +#endif ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format ); } else @@ -194,7 +255,66 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } +#ifndef VLBR_20MS_MD + if ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) + { + + num_channels = st_ivas->hSpar->hMdDec->spar_md_cfg.num_umx_chs; + ivas_spar_md_dec_matrix_close( st_ivas->hSpar->hMdDec, num_channels ); + + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, ivas_total_brate ); + if ( ( error = ivas_spar_md_dec_matrix_open( st_ivas->hSpar->hMdDec, num_channels, + num_md_sub_frames ) ) != IVAS_ERR_OK ) + { + return error; + } + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; + } + } + } + + } +#endif hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index ab2fd9a7c4..9e381f6900 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -96,11 +96,15 @@ static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder * * Allocate and initialize SPAR MD decoder matrices *------------------------------------------------------------------------*/ - -static ivas_error ivas_spar_md_dec_matrix_open( - ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ - const int16_t num_channels, /* i : number of internal channels */ - const int16_t num_md_sub_frames ) +#ifdef VLBR_20MS_MD +ivas_error ivas_spar_md_dec_matrix_open +#else +static ivas_error ivas_spar_md_dec_matrix_open +#endif + ( + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels, /* i : number of internal channels */ + const int16_t num_md_sub_frames ) { int16_t i, j; @@ -337,11 +341,15 @@ ivas_error ivas_spar_md_dec_open( * * Deallocate SPAR MD decoder matrices *------------------------------------------------------------------------*/ - -static void ivas_spar_md_dec_matrix_close( - ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ - const int16_t num_channels /* i : number of internal channels */ -) +#ifdef VLBR_20MS_MD +void ivas_spar_md_dec_matrix_close +#else +static void ivas_spar_md_dec_matrix_close +#endif + ( + ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels /* i : number of internal channels */ + ) { int16_t i, j; -- GitLab From 2ffc67a7414f5e9e7c4aae77fe332b7636e4661d Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 14:10:21 +0530 Subject: [PATCH 4/6] Minor clean up changes --- lib_dec/ivas_sba_dec.c | 63 ------------------------------------------ 1 file changed, 63 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 3c7323008d..5394b8b9d8 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -173,11 +173,7 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } -#ifndef VLBR_20MS_MD - if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) -#else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) -#endif { ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); @@ -255,65 +251,6 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } -#ifndef VLBR_20MS_MD - if ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) - { - - num_channels = st_ivas->hSpar->hMdDec->spar_md_cfg.num_umx_chs; - - ivas_spar_md_dec_matrix_close( st_ivas->hSpar->hMdDec, num_channels ); - - num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, ivas_total_brate ); - if ( ( error = ivas_spar_md_dec_matrix_open( st_ivas->hSpar->hMdDec, num_channels, - num_md_sub_frames ) ) != IVAS_ERR_OK ) - { - return error; - } - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; - } - } - } - } -#endif hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); -- GitLab From b1786afa8993d43fc570a9f1ede8e58f13407036 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 15:01:50 +0530 Subject: [PATCH 5/6] Few more minor clean-up done --- lib_dec/ivas_sba_dec.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 5394b8b9d8..d4d55504cc 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -110,6 +110,7 @@ ivas_error ivas_sba_dec_reconfigure( int16_t sba_dirac_stereo_flag_old; int32_t ivas_total_brate; int32_t last_ivas_total_brate; + #ifdef VLBR_20MS_MD int16_t num_channels, num_md_sub_frames; int16_t i, j, k; @@ -204,38 +205,8 @@ ivas_error ivas_sba_dec_reconfigure( for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) { st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; } } @@ -251,6 +222,7 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } + hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); -- GitLab From 743072535e49363b36758ba473fb6ce216e94d5d Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 15 Jun 2023 18:44:24 +0530 Subject: [PATCH 6/6] Address review comments --- lib_dec/ivas_sba_dec.c | 14 -------------- lib_dec/ivas_spar_md_dec.c | 27 ++++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index d4d55504cc..1a0e6b7166 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -113,7 +113,6 @@ ivas_error ivas_sba_dec_reconfigure( #ifdef VLBR_20MS_MD int16_t num_channels, num_md_sub_frames; - int16_t i, j, k; #endif RENDERER_TYPE old_renderer_type; @@ -198,19 +197,6 @@ ivas_error ivas_sba_dec_reconfigure( { return error; } - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; - st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; - st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; - st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; - } - } - } } #endif ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format ); diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 9e381f6900..a3d3f8f66c 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -107,7 +107,9 @@ static ivas_error ivas_spar_md_dec_matrix_open const int16_t num_md_sub_frames ) { int16_t i, j; - +#ifdef VLBR_20MS_MD + int16_t k; +#endif if ( ( hMdDec->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * num_md_sub_frames * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); @@ -244,7 +246,22 @@ static ivas_error ivas_spar_md_dec_matrix_open } } } +#ifdef VLBR_20MS_MD + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0.0f; + hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0.0f; + hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0.0f; + hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0.0f; + } + } + } +#endif return IVAS_ERR_OK; } @@ -492,7 +509,11 @@ ivas_error ivas_spar_md_dec_init( const int16_t sba_order /* i : SBA order */ ) { +#ifdef VLBR_20MS_MD + int16_t i, j; +#else int16_t i, j, k; +#endif int16_t nchan_transport; float pFC[IVAS_MAX_NUM_BANDS], PR_minmax[2]; @@ -534,7 +555,7 @@ ivas_error ivas_spar_md_dec_init( set_s( hMdDec->base_band_age, 0, IVAS_MAX_NUM_BANDS ); hMdDec->spar_plc_num_lost_frames = 0; hMdDec->spar_plc_enable_fadeout_flag = 1; - +#ifndef VLBR_20MS_MD for ( i = 0; i < num_channels; i++ ) { for ( j = 0; j < num_channels; j++ ) @@ -578,7 +599,7 @@ ivas_error ivas_spar_md_dec_init( } } } - +#endif hMdDec->dtx_md_smoothing_cntr = 1; ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS ); -- GitLab