From 12c996b4ad146844151640455545973367dcba47 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 20 Sep 2023 10:32:57 +0200 Subject: [PATCH 1/5] do not skip reconfiguration when switching between first and higher-order DirAC decoding --- lib_dec/ivas_sba_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index a04fd758ef..8e69324ea2 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -307,7 +307,7 @@ ivas_error ivas_sba_dec_reconfigure( return error; } #endif -#ifndef NONBE_FIX_736_FOA_BR_SWITCH +#if 1 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 ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) ) #else 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 ) ) ) -- GitLab From ad4fcda0d3ff5223574de7c8f7ecf93c1780b3db Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 20 Sep 2023 11:08:21 +0200 Subject: [PATCH 2/5] only set hConfig->enc_param_start_band when switching between FO- and HO-DirAC and do not reconfigure DirAC --- lib_dec/ivas_sba_dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 8e69324ea2..907700d197 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -307,7 +307,7 @@ ivas_error ivas_sba_dec_reconfigure( return error; } #endif -#if 1 +#ifndef NONBE_FIX_736_FOA_BR_SWITCH 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 ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) ) #else 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 ) ) ) @@ -360,6 +360,8 @@ ivas_error ivas_sba_dec_reconfigure( 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 ); + + st_ivas->hDirAC->hConfig->enc_param_start_band = st_ivas->hSpar->enc_param_start_band; } #endif if ( st_ivas->renderer_type == RENDERER_DISABLE ) -- GitLab From 692a9e3ccd82364c54f981f773c973b9dbcb351f Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 20 Sep 2023 11:52:45 +0200 Subject: [PATCH 3/5] fix case when hDirAC == NULL --- lib_dec/ivas_sba_dec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index d5c062f846..6b0d5d2f27 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -351,10 +351,12 @@ 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 ), + 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 ); - - st_ivas->hDirAC->hConfig->enc_param_start_band = st_ivas->hSpar->enc_param_start_band; + if ( st_ivas->hDirAC ) + { + st_ivas->hDirAC->hConfig->enc_param_start_band = st_ivas->hSpar->enc_param_start_band; + } } #endif @@ -657,7 +659,7 @@ ivas_error ivas_sba_dec_digest_tc( float *decorr_signal[BINAURAL_CHANNELS]; float *p_tc[2 * BINAURAL_CHANNELS]; - default_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + default_frame = ( int16_t )( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); nSamplesLeftForTD = nSamplesForRendering; for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) -- GitLab From efd7f2c595da73434c905dad010f2d0e2088548e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 20 Sep 2023 12:03:27 +0200 Subject: [PATCH 4/5] fix formatting --- lib_dec/ivas_sba_dec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 6b0d5d2f27..b973722ccc 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -351,12 +351,12 @@ 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 ), + 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 ); if ( st_ivas->hDirAC ) { st_ivas->hDirAC->hConfig->enc_param_start_band = st_ivas->hSpar->enc_param_start_band; - } + } } #endif @@ -659,7 +659,7 @@ ivas_error ivas_sba_dec_digest_tc( float *decorr_signal[BINAURAL_CHANNELS]; float *p_tc[2 * BINAURAL_CHANNELS]; - default_frame = ( int16_t )( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + default_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); nSamplesLeftForTD = nSamplesForRendering; for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) -- GitLab From dc2163c4f2f566418b4fee2cd1ada039f43449c3 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 27 Sep 2023 08:43:30 +0200 Subject: [PATCH 5/5] wrap changes into new define NONBE_FIX_775_OSBA_BR_SWITCHING_CRASH --- lib_com/options.h | 1 + lib_dec/ivas_sba_dec.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 2f0a623c46..ef136cb6be 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -220,6 +220,7 @@ #define NONBE_FIX_798_OSBA_MC_DEC_CRASH #define NONBE_FIX_806_OMASA_ONE_SEP_TRANSPORT_MIX /* Nokia: issue 806: fix one separated object mode transport mix of the separated object */ #define NONBE_FIX_809_EXTERNAL_TARGET_INTERPOLATION /* FhG: issue 809: unify external target interpolation inter and intra frame behaviour */ +#define NONBE_FIX_775_OSBA_BR_SWITCHING_CRASH /* FhG: issue 775: fix crash in OSBA with bitrate switching and output order lower than input order */ #define JBM_FOR_OSBA /* FhG: implement OSBA format in the JBM path */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 2a39804a12..899fbb78ef 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -479,10 +479,12 @@ ivas_error ivas_sba_dec_reconfigure( 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 ); +#ifdef NONBE_FIX_775_OSBA_BR_SWITCHING_CRASH if ( st_ivas->hDirAC ) { st_ivas->hDirAC->hConfig->enc_param_start_band = st_ivas->hSpar->enc_param_start_band; } +#endif } #endif -- GitLab