From 6bdeeec04398299649446ebec76d5e6353a2c42b Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Dec 2023 14:46:19 +0100 Subject: [PATCH 1/6] accept FIX_CRASH_LONG_BRIR --- lib_com/ivas_prot.h | 6 ++---- lib_com/ivas_tools.c | 4 ++-- lib_com/options.h | 1 - lib_rend/ivas_crend.c | 32 -------------------------------- 4 files changed, 4 insertions(+), 39 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 72d0ff2683..79f93f24c7 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2920,12 +2920,10 @@ int16_t check_bounds_s( const int16_t high /* i : High limit */ ); -#ifdef FIX_CRASH_LONG_BRIR void set_zero_l( - float *vec, /* o : input vector */ - const uint32_t lvec /* i : length of the vector */ + float *vec, /* o : input vector */ + const uint32_t lvec /* i : length of the vector */ ); -#endif ivas_error stereo_memory_enc( CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index e3bb312224..472a1895f6 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -579,7 +579,7 @@ int16_t check_bounds_s( return value_adj; } -#ifdef FIX_CRASH_LONG_BRIR + /*---------------------------------------------------------------------* * set_zero_l() * @@ -600,7 +600,7 @@ void set_zero_l( return; } -#endif + /****************************************************************************/ /* matrix functions */ diff --git a/lib_com/options.h b/lib_com/options.h index 9f6d5f8925..e6f5fdf200 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_CRASH_LONG_BRIR /* Orange : Fix crash when long BRIR is set */ #define FIX_910_REMOVE_DUPLICATION_TD_REND /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */ #define FIX_940_DEBUGGING_VARIABLE /* Nokia: issue #940: remove debugging variable */ #define FIX_911_REMOVE_CREND_DUPLICATION /* VA: issue 911: resolve duplication of CRend binaural external renderer function */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 5c8755cd62..680981eb4a 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1248,11 +1248,7 @@ ivas_error ivas_rend_openCrend( ) { int16_t i, subframe_length; -#ifdef FIX_CRASH_LONG_BRIR int32_t max_total_ir_len; -#else - int16_t max_total_ir_len; -#endif HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; @@ -1302,21 +1298,13 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_re[i], max_total_ir_len ); -#else - set_zero( hCrend->freq_buffer_re[i], max_total_ir_len ); -#endif if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_im[i], max_total_ir_len ); -#else - set_zero( hCrend->freq_buffer_im[i], max_total_ir_len ); -#endif } for ( i = 0; i < BINAURAL_CHANNELS; i++ ) @@ -1325,11 +1313,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->prev_out_buffer[i], subframe_length ); -#else - set_zero( hCrend->prev_out_buffer[i], subframe_length ); -#endif } max_total_ir_len = hHrtf->num_iterations_diffuse[0] * subframe_length; @@ -1340,21 +1324,13 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); -#else - set_zero( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); -#endif if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); -#else - set_zero( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); -#endif } else { @@ -1369,11 +1345,7 @@ ivas_error ivas_rend_openCrend( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } -#ifdef FIX_CRASH_LONG_BRIR set_zero_l( hCrend->lfe_delay_line, max_total_ir_len ); -#else - set_zero( hCrend->lfe_delay_line, max_total_ir_len ); -#endif } else { @@ -1616,11 +1588,7 @@ static ivas_error ivas_rend_crendConvolver( int16_t i, j, k, m; int16_t subframe_length, idx_in; int16_t lfe_idx_in; -#ifdef FIX_CRASH_LONG_BRIR int32_t offset, offset_in, offset_diffuse; -#else - int16_t offset, offset_in, offset_diffuse; -#endif int16_t nchan_in, nchan_out; const float *pIn; float *pFreq_buf_re, *pFreq_buf_im; -- GitLab From 08c94da001362c02f6e8cad397a6ba3f8735e408 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Dec 2023 14:48:17 +0100 Subject: [PATCH 2/6] accept FIX_910_REMOVE_DUPLICATION_TD_REND --- lib_com/ivas_prot.h | 8 ------ lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 25 ------------------ lib_dec/ivas_objectRenderer_internal.c | 36 -------------------------- lib_dec/ivas_output_config.c | 8 ------ lib_rend/ivas_objectRenderer.c | 8 ------ 6 files changed, 86 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 79f93f24c7..9121e8ea0b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5866,14 +5866,6 @@ ivas_error ivas_td_binaural_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND -ivas_error ivas_td_binaural_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* i/o: SCE channels / Binaural synthesis */ - const int16_t output_frame /* i : output frame length */ -); - -#endif ivas_error ivas_td_binaural_renderer_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output[], /* i/o: SCE channels / Binaural synthesis */ diff --git a/lib_com/options.h b/lib_com/options.h index e6f5fdf200..cadc9674b4 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_910_REMOVE_DUPLICATION_TD_REND /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */ #define FIX_940_DEBUGGING_VARIABLE /* Nokia: issue #940: remove debugging variable */ #define FIX_911_REMOVE_CREND_DUPLICATION /* VA: issue 911: resolve duplication of CRend binaural external renderer function */ #define FIX_938_GCC_12_WARNINGS /* VA: issue #938: remove set_f(.,.,0) call in which length is always 0 to remove GCC 12.0 warning */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 375ba442bf..30fe1142b0 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1364,31 +1364,6 @@ ivas_error ivas_jbm_dec_render( { ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); } -#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = ivas_td_binaural_renderer_sf_splitBinaural( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { -#endif - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - } -#endif - } -#endif } else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 09148ce42a..99c9c17963 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -65,42 +65,6 @@ ivas_error ivas_td_binaural_open( st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); } -#ifndef FIX_910_REMOVE_DUPLICATION_TD_REND -/*---------------------------------------------------------------------* - * ivas_td_binaural_renderer() - * - * Receives the current frames for the object streams, updates metadata - * and renders the current frame. - *---------------------------------------------------------------------*/ - -ivas_error ivas_td_binaural_renderer( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output[], /* i/o: SCE channels / Binaural synthesis */ - const int16_t output_frame /* i : output frame length */ -) -{ - int16_t ism_md_subframe_update; - int16_t nchan_transport; - - nchan_transport = ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ? st_ivas->nchan_ism : st_ivas->nchan_transport; - - if ( st_ivas->hDecoderConfig->Opt_delay_comp ) - { - ism_md_subframe_update = 1; - } - else - { - ism_md_subframe_update = 2; - } - - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - ism_md_subframe_update = 2; - } - - return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, st_ivas->hCombinedOrientationData, ism_md_subframe_update, output, output_frame, MAX_PARAM_SPATIAL_SUBFRAMES ); -} -#endif /*---------------------------------------------------------------------* * ivas_td_binaural_renderer_sf() diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index b9adc3ed57..34bfbb57fa 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -230,17 +230,9 @@ void ivas_renderer_select( #endif { #ifdef DEBUGGING -#ifdef FIX_910_REMOVE_DUPLICATION_TD_REND if ( ( ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && st_ivas->mc_mode == MC_MODE_MCT && st_ivas->hDecoderConfig->force_rend != FORCE_CLDFB_RENDERER ) #else - if ( ( ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) -#endif -#else -#ifdef FIX_910_REMOVE_DUPLICATION_TD_REND if ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && st_ivas->mc_mode == MC_MODE_MCT ) -#else - if ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#endif #endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 3bed6c7a06..88b17b0a77 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -862,11 +862,7 @@ ivas_error ObjRenderIvasFrame_splitBinaural( /* Render */ if ( pos_idx == 0 ) { -#ifdef FIX_910_REMOVE_DUPLICATION_TD_REND if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_tmpProcessing, output_frame ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_tmpProcessing, output_frame ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -877,11 +873,7 @@ ivas_error ObjRenderIvasFrame_splitBinaural( tmpTdRendHandle = st_ivas->hBinRendererTd; st_ivas->hBinRendererTd = st_ivas->hSplitBinRend.splitrend.hTdRendHandles[pos_idx - 1]; -#ifdef FIX_910_REMOVE_DUPLICATION_TD_REND if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_tmpProcessing, output_frame ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_td_binaural_renderer( st_ivas, p_tmpProcessing, output_frame ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From 3d456cec74e1bc65ccc20bff46bf6b67b376658a Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Dec 2023 14:48:59 +0100 Subject: [PATCH 3/6] accept FIX_940_DEBUGGING_VARIABLE --- lib_com/options.h | 1 - lib_dec/ivas_qmetadata_dec.c | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index cadc9674b4..db9db9cab9 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_940_DEBUGGING_VARIABLE /* Nokia: issue #940: remove debugging variable */ #define FIX_911_REMOVE_CREND_DUPLICATION /* VA: issue 911: resolve duplication of CRend binaural external renderer function */ #define FIX_938_GCC_12_WARNINGS /* VA: issue #938: remove set_f(.,.,0) call in which length is always 0 to remove GCC 12.0 warning */ diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 68a0e71f0f..51febb853a 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -4247,20 +4247,13 @@ static void read_stream_dct_coeffs_omasa( int16_t *index, const int16_t first_line ) { -#ifdef FIX_940_DEBUGGING_VARIABLE int16_t sign; -#else - int16_t sign, nbits; -#endif int16_t i, j, i_min; float step; int16_t GR1, GR2; step = STEP_M2T; -#ifndef FIX_940_DEBUGGING_VARIABLE - nbits = 0; -#endif sign = 1; if ( first_line == 0 ) { @@ -4270,9 +4263,6 @@ static void read_stream_dct_coeffs_omasa( { sign = -1; } -#ifndef FIX_940_DEBUGGING_VARIABLE - nbits++; -#endif } set_s( q_idx, 0, len_stream ); @@ -4294,9 +4284,7 @@ static void read_stream_dct_coeffs_omasa( { i_min = ( i_min << 1 ) + bit_stream[( *index )--]; } -#ifndef FIX_940_DEBUGGING_VARIABLE - nbits += j; -#endif + /* read GR orders */ GR1 = bit_stream[( *index )--] + 1; if ( GR1 == 2 ) -- GitLab From d1cf92748338ccca882750f24d8162b0b70089b1 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Dec 2023 14:53:39 +0100 Subject: [PATCH 4/6] accept NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING --- lib_com/ivas_dirac_com.c | 22 +--------------------- lib_com/ivas_prot.h | 14 -------------- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 11 +++-------- lib_dec/ivas_init_dec.c | 10 ---------- lib_dec/ivas_sba_dec.c | 5 ----- lib_enc/ivas_spar_md_enc.c | 9 +-------- 7 files changed, 5 insertions(+), 67 deletions(-) diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index 16ed4c9986..eb0408dceb 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -194,19 +194,11 @@ ivas_error ivas_dirac_config( if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) { -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft, 1 ); -#else - ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hConfig->enc_param_start_band, hFbMdft ); -#endif } else { -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands( band_grouping, hConfig->nbands, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft, 1 ); -#else - ivas_dirac_config_bands( band_grouping, hConfig->nbands, (int16_t) ( Fs * INV_CLDFB_BANDWIDTH + 0.5f ), NULL, 0, 0, hFbMdft ); -#endif } return error; @@ -219,7 +211,6 @@ ivas_error ivas_dirac_config( * DirAC Configuration freq. band function; used also in MASA decoder *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING void ivas_dirac_config_bands( int16_t *band_grouping, /* o : band grouping */ const int16_t nbands, /* i : number of bands */ @@ -229,16 +220,6 @@ void ivas_dirac_config_bands( const int16_t enc_param_start_band, IVAS_FB_MIXER_HANDLE hFbMdft, const int8_t BandGroupLowRes ) -#else -void ivas_dirac_config_bands( - int16_t *band_grouping, /* o : band grouping */ - const int16_t nbands, /* i : number of bands */ - const int16_t max_band, /* i : maximal band index +1 */ - int16_t *dirac_to_spar_md_bands, - const int8_t useLowerBandRes, - const int16_t enc_param_start_band, - IVAS_FB_MIXER_HANDLE hFbMdft ) -#endif { int16_t i; { @@ -289,9 +270,8 @@ void ivas_dirac_config_bands( { int16_t step = DIRAC_LOW_BANDRES_STEP; int16_t reduced_band; -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + if ( BandGroupLowRes ) -#endif { for ( band = enc_param_start_band + 2, reduced_band = enc_param_start_band + 1; band <= DIRAC_MAX_NBANDS; band += step, reduced_band++ ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 9121e8ea0b..2eacf811b0 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3629,7 +3629,6 @@ ivas_error ivas_dirac_config( const int16_t enc_dec /* i : encoder or decoder flag */ ); -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING void ivas_dirac_config_bands( int16_t *band_grouping, /* o : band grouping */ const int16_t nbands, /* i : number of bands */ @@ -3640,19 +3639,6 @@ void ivas_dirac_config_bands( IVAS_FB_MIXER_HANDLE hFbMdft, /* i : MDFT filterbank handle */ const int8_t BandGroupLowRes /* i : flag indicating lower band grouping resolution for DirAC */ ); -#else -void ivas_dirac_config_bands( - int16_t *band_grouping, /* o : band grouping */ - const int16_t nbands, /* i : number of bands */ - const int16_t max_band, /* i : maximal band index +1 */ - int16_t *dirac_to_spar_md_bands, /* o : mapping of DirAC parameter band index to SPAR FB band index */ - const int8_t useLowerBandRes, /* i : flag indicating lower band resolution for DirAC */ - const int16_t enc_param_start_band, /* i : band index of first DirAC parameter band */ - IVAS_FB_MIXER_HANDLE hFbMdft -); -#endif - - void ivas_get_dirac_sba_max_md_bits( const int32_t sba_total_brate, diff --git a/lib_com/options.h b/lib_com/options.h index db9db9cab9..021c28fecc 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ -#define NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING /* Dlb: issue 907: fix for band mapping at VLBR */ #define NONBE_FIX_869_MASA_PREREND_MERGE /* Nokia: issue: #869: MASA pre-rend not updating energy */ #define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ #define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 0d01fca04f..804c1e8522 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1275,11 +1275,9 @@ void ivas_qmetadata_to_dirac( /* SID/zero-frame: 1 direction, 5 bands, nblocks re-generated out of SID decoder*/ start_band = 0; hDirAC->hConfig->nbands = 5; -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, NULL, 0, 0, NULL, 1 ); -#else - ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, NULL, 0, 0, NULL ); -#endif + nbands = 5; } else @@ -1294,11 +1292,8 @@ void ivas_qmetadata_to_dirac( hDirAC->hConfig->nbands = q_direction->cfg.nbands; } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hDirAC->hConfig->enc_param_start_band, hDirAC->hFbMdft, 0 ); -#else - ivas_dirac_config_bands( hDirAC->band_grouping, hDirAC->hConfig->nbands, nbands, dirac_to_spar_md_bands, hQMetaData->useLowerBandRes, hDirAC->hConfig->enc_param_start_band, hDirAC->hFbMdft ); -#endif + nbands = hDirAC->hConfig->nbands; if ( hQMetaData->q_direction[0].cfg.nblocks == 0 ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 1e6ff46fd3..9ec5f1b814 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1385,13 +1385,8 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING 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, 1 ); -#else - 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 ); -#endif } st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); @@ -1545,13 +1540,8 @@ ivas_error ivas_init_decoder( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING 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, 1 ); -#else - 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 ); -#endif } 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 73ced6e6c9..6ddcb37778 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -424,13 +424,8 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands; } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING 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, 1 ); -#else - 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 ); -#endif if ( st_ivas->hDirAC ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 51763fc4b5..2ec4e95d2e 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -491,9 +491,7 @@ ivas_error ivas_spar_md_enc_process( int16_t md_indices_allocated; int16_t max_num_indices_tmp; float Wscale[IVAS_MAX_NUM_BANDS]; -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING float P_quant_re_prior[SPAR_DIRAC_SPLIT_START_BAND][FOA_CHANNELS - 1]; -#endif /*extra 16 bits for arithmetic coder as overshoot check is after a symbol is written*/ md_indices_allocated = hMdEnc->spar_md_cfg.max_bits_per_blk + IVAS_SPAR_ARITH_OVERSHOOT_BITS; @@ -590,7 +588,6 @@ ivas_error ivas_spar_md_enc_process( } } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) { for ( b = 0; b < num_bands * bands_bw; b++ ) @@ -598,7 +595,6 @@ ivas_error ivas_spar_md_enc_process( mvr2r( hMdEnc->spar_md.band_coeffs[b].P_quant_re, P_quant_re_prior[b], FOA_CHANNELS - 1 ); } } -#endif ivas_compute_spar_params( cov_real, dm_fv_re, 0, hMdEnc->mixer_mat, 0, nB, dtx_vad, num_ch, bands_bw, active_w, active_w_vlbr, &hMdEnc->spar_md_cfg, &hMdEnc->spar_md, Wscale, 0, dyn_active_w_flag ); @@ -866,7 +862,6 @@ ivas_error ivas_spar_md_enc_process( #endif /* Reuse mixer matrix values for unsent bands */ -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) { for ( k = num_bands - 1; k >= 0; k-- ) @@ -877,7 +872,6 @@ ivas_error ivas_spar_md_enc_process( } } } -#endif if ( ( hEncoderConfig->ivas_total_brate < IVAS_24k4 ) && ( code_strat > 3 ) ) { @@ -895,10 +889,9 @@ ivas_error ivas_spar_md_enc_process( hMdEnc->mixer_mat[i][j][b + 1] = prior_mixer[i][j][b + 1]; } } -#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING + mvr2r( P_quant_re_prior[b], hMdEnc->spar_md.band_coeffs[b].P_quant_re, FOA_CHANNELS - 1 ); mvr2r( P_quant_re_prior[b + 1], hMdEnc->spar_md.band_coeffs[b + 1].P_quant_re, FOA_CHANNELS - 1 ); -#endif } } #ifdef DEBUG_LBR_SBA -- GitLab From 978461768388092225e2f9c52b377a6ffd537d8a Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Dec 2023 14:55:00 +0100 Subject: [PATCH 5/6] accept NONBE_FIX_869_MASA_PREREND_MERGE --- lib_com/options.h | 1 - lib_rend/ivas_masa_merge.c | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 021c28fecc..82061f0606 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ -#define NONBE_FIX_869_MASA_PREREND_MERGE /* Nokia: issue: #869: MASA pre-rend not updating energy */ #define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ #define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */ diff --git a/lib_rend/ivas_masa_merge.c b/lib_rend/ivas_masa_merge.c index 4568363838..3073ecec61 100644 --- a/lib_rend/ivas_masa_merge.c +++ b/lib_rend/ivas_masa_merge.c @@ -124,19 +124,11 @@ void copy_masa_descriptive_meta( *---------------------------------------------------------------------*/ void diffuse_meta_merge_1x1( -#ifdef NONBE_FIX_869_MASA_PREREND_MERGE MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ MASA_DECODER_EXT_OUT_META_HANDLE inMeta, /* i : Input metadata 1 */ float inEne[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: TF-energy of input 1. energy after merge */ MASA_DECODER_EXT_OUT_META_HANDLE inMetaISM, /* i : Input metadata 2 */ float inEneISM[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : TF-energy of input 2 */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ - MASA_DECODER_EXT_OUT_META_HANDLE inMeta, /* i : Input metadata 1 */ - float inEne[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i : TF-energy of input 1 */ - MASA_DECODER_EXT_OUT_META_HANDLE inMetaISM, /* i : Input metadata 2 */ - float inEneISM[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : TF-energy of input 2 */ -#endif ) { int8_t sf, band; @@ -284,7 +276,6 @@ void full_stream_merge( *---------------------------------------------------------------------*/ void ivas_prerend_merge_masa_metadata( -#ifdef NONBE_FIX_869_MASA_PREREND_MERGE MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ MASA_DECODER_EXT_OUT_META_HANDLE inMeta1, /* i : Input metadata 1 */ IVAS_REND_AudioConfigType inType1, /* i : Type of input 1 */ @@ -292,22 +283,12 @@ void ivas_prerend_merge_masa_metadata( MASA_DECODER_EXT_OUT_META_HANDLE inMeta2, /* i : Input metadata 2 */ IVAS_REND_AudioConfigType inType2, /* i : Type of input 2 */ float inEne2[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : TF-energy of input 2. may be altered */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE outMeta, /* o : Merged metadata output */ - MASA_DECODER_EXT_OUT_META_HANDLE inMeta1, /* i : Input metadata 1 */ - IVAS_REND_AudioConfigType inType1, /* i : Type of input 1 */ - float inEne1[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: TF-energy of input 1. after merge, contains the energy of the merged signal */ - MASA_DECODER_EXT_OUT_META_HANDLE inMeta2, /* i : Input metadata 2 */ - IVAS_REND_AudioConfigType inType2, /* i : Type of input 2 */ - float inEne2[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : TF-energy of input 2 */ -#endif ) { /* mixing ISMs with non-ISM use different merge */ if ( inType1 == IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED && inType2 != IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED && ( inMeta1->descriptiveMeta.numberOfDirections == 0u && inMeta2->descriptiveMeta.numberOfDirections == 0u ) ) { /* meta_1 is ISM and both are 1dir */ -#ifdef NONBE_FIX_869_MASA_PREREND_MERGE int8_t sf; diffuse_meta_merge_1x1( outMeta, inMeta2, inEne2, inMeta1, inEne1 ); /* post-merge energy is now in inEne2 and needs to be copied to inEne1 */ @@ -316,9 +297,6 @@ void ivas_prerend_merge_masa_metadata( { mvr2r( inEne2[sf], inEne1[sf], MASA_FREQUENCY_BANDS ); } -#else - diffuse_meta_merge_1x1( outMeta, inMeta2, inEne2, inMeta1, inEne1 ); -#endif } else if ( inType2 == IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED && inType1 != IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED && ( inMeta1->descriptiveMeta.numberOfDirections == 0u && inMeta2->descriptiveMeta.numberOfDirections == 0u ) ) { -- GitLab From 44001e2043095c0fe7aa19d908bb15330292434e Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 19 Dec 2023 14:55:57 +0100 Subject: [PATCH 6/6] accept NONBE_FIX_931_IGF_STEREO_DEC_NOISE --- lib_com/options.h | 1 - lib_dec/igf_dec.c | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 82061f0606..8b9acd92dd 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ -#define NONBE_FIX_931_IGF_STEREO_DEC_NOISE /* FhG: issue #931: fix noise substitution in the stereo IGF decoder */ #define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/igf_dec.c b/lib_dec/igf_dec.c index 5c727e3949..584a92c847 100755 --- a/lib_dec/igf_dec.c +++ b/lib_dec/igf_dec.c @@ -490,11 +490,7 @@ static void IGF_prepStereo( { if ( hPrivateDataL->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new( src_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); -#else - IGF_replaceTCXNoise_2_new( igf_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); -#endif } sel_specL = src_specL; } @@ -511,11 +507,7 @@ static void IGF_prepStereo( { if ( hPrivateDataR->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new( src_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); -#else - IGF_replaceTCXNoise_2_new( igf_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); -#endif } sel_specR = src_specR; } @@ -582,11 +574,7 @@ static void IGF_prepStereo( { if ( hPrivateDataL->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new( src_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); -#else - IGF_replaceTCXNoise_2_new( igf_specL, TCXNoiseL, strt_cpy, stop, hPrivateDataL->totalNoiseNrg_off, hPrivateDataL->n_noise_bands_off, hInfoL->nfSeed ); -#endif } sel_specL = src_specL; } @@ -603,11 +591,7 @@ static void IGF_prepStereo( { if ( hPrivateDataR->n_noise_bands_off ) { -#ifdef NONBE_FIX_931_IGF_STEREO_DEC_NOISE IGF_replaceTCXNoise_2_new( src_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); -#else - IGF_replaceTCXNoise_2_new( igf_specR, TCXNoiseR, strt_cpy, stop, hPrivateDataR->totalNoiseNrg_off, hPrivateDataR->n_noise_bands_off, hInfoR->nfSeed ); -#endif } sel_specR = src_specR; } -- GitLab