From 289b54934d71763fba20784c5da76974a4cc2754 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 13 Jul 2023 18:08:44 +1000 Subject: [PATCH] revert commit e6b45e18 as it failed selection tests --- lib_com/ivas_prot.h | 20 +------ lib_com/options.h | 3 +- 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 | 18 ------ lib_dec/ivas_sba_rendering_internal.c | 9 --- lib_dec/ivas_spar_md_dec.c | 80 ++++++--------------------- lib_rend/ivas_sba_rendering.c | 7 --- 9 files changed, 21 insertions(+), 136 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b8449126e7..9bc253776d 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4227,10 +4227,6 @@ 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 */ @@ -4529,19 +4525,9 @@ void ivas_get_spar_md_from_dirac( /*! r: number of MD subframes */ 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 + const int32_t ivas_total_brate /* i : IVAS total bitrate */ +); + 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_com/options.h b/lib_com/options.h index 0d74abfa7d..a66408dd60 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -143,7 +143,8 @@ /* only BE switches wrt operation points tested in selection */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define VLBR_20MS_MD /* Dlb: SBA VLBR 20ms Optimization*/ + + #define FIX_563_PARAMMC_LIMITER /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set */ #define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ #define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index cb50503079..439a90fb2c 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -67,9 +67,6 @@ ivas_error ivas_dec( float pan_left, pan_right; ivas_error error; float *p_output[MAX_OUTPUT_CHANNELS]; -#ifdef VLBR_20MS_MD - int16_t num_md_sub_frames; -#endif error = IVAS_ERR_OK; @@ -383,12 +380,7 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { -#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 } else if ( st_ivas->renderer_type != RENDERER_DISABLE ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8e96be31ee..ff28af051a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -82,9 +82,6 @@ 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; @@ -285,12 +282,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { -#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 } else { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 03c26d51c3..0576fe8121 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1169,11 +1169,7 @@ void ivas_spar_param_to_masa_param_mapping( } else { -#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 for ( band = 0; band < SPAR_DIRAC_SPLIT_START_BAND; band++ ) { for ( i = 0; i < FOA_CHANNELS; i++ ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index f7a55b6fe0..22258a9365 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -111,9 +111,6 @@ ivas_error ivas_sba_dec_reconfigure( int32_t ivas_total_brate; int32_t last_ivas_total_brate; -#ifdef VLBR_20MS_MD - int16_t num_channels, num_md_sub_frames; -#endif RENDERER_TYPE old_renderer_type; DECODER_CONFIG_HANDLE hDecoderConfig; @@ -183,22 +180,7 @@ 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; - } - } -#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 diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 643c7b5a6c..6f3dd13b7a 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -578,10 +578,6 @@ 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; @@ -625,13 +621,8 @@ 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_md_dec.c b/lib_dec/ivas_spar_md_dec.c index bc75fcba88..e83aa7e617 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -92,21 +92,15 @@ static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder * * Allocate and initialize SPAR MD decoder matrices *------------------------------------------------------------------------*/ -#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 /* i : number of MD subframes */ - ) + +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 /* i : number of MD subframes */ +) { 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" ); @@ -243,22 +237,7 @@ 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; } @@ -285,12 +264,7 @@ 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 ); } @@ -358,15 +332,11 @@ ivas_error ivas_spar_md_dec_open( * * Deallocate SPAR MD decoder matrices *------------------------------------------------------------------------*/ -#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 */ - ) + +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 */ +) { int16_t i, j; @@ -509,11 +479,7 @@ 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]; @@ -555,7 +521,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++ ) @@ -599,7 +565,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 ); @@ -3125,12 +3091,7 @@ 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 + num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; if ( st_ivas->hQMetaData->useLowerRes ) { @@ -3139,17 +3100,12 @@ 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 ( i = 0; i < FOA_CHANNELS - 1; i++ ) /* pred coefficient index (index 0, 1, 2 predicts Y, Z, X respectively) */ { @@ -3163,11 +3119,7 @@ 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 5af6a46efd..0974677922 100644 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -67,10 +67,6 @@ void ivas_sba_prototype_renderer( int16_t out_ch, in_ch; int16_t firstInCh, inChEnd, firstOutCh, outChEnd; int16_t slot_idx_start, md_idx; -#ifdef VLBR_20MS_MD - 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 push_wmops( "ivas_sba_prototype_renderer" ); @@ -152,9 +148,6 @@ 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 ); -- GitLab