From 7f58041a7ae76b8f26b75f9476220cbb33a07afe Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:16:32 +0200 Subject: [PATCH 01/12] accept FIX_817_DOUBLE_PREC_REND_MD --- lib_com/options.h | 3 --- lib_rend/lib_rend.c | 15 ++------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e5c2517ce8..be3537f97d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,9 +150,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_817_DOUBLE_PREC_REND_MD /* Eri: Issue 817: Avoid double precision in renderer metadata module */ - #define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ #define FIX_854_ARRAY_SIZE_MISMATCH /* VA: issue 854: correct the mismatch between definition and declaration of `ivas_core_dec() */ #define FIX_785_REMOVE_DEAD_CODE /* VA: issue 785: remove dead code */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 903cf504d8..e6d8535ba3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5838,11 +5838,7 @@ static ivas_error renderIsmToBinaural( push_wmops( "renderIsmToBinaural" ); /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ -#ifdef FIX_817_DOUBLE_PREC_REND_MD ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#else - ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, ism_md_subframe_update_ext, @@ -6065,11 +6061,8 @@ static ivas_error renderIsmToBinauralReverb( push_wmops( "renderIsmToBinauralRoom" ); /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ -#ifdef FIX_817_DOUBLE_PREC_REND_MD ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#else - ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#endif + copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, @@ -6247,11 +6240,7 @@ static ivas_error renderIsmToSplitBinaural( pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ -#ifdef FIX_817_DOUBLE_PREC_REND_MD ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#else - ism_md_subframe_update_ext = (int16_t) round( ismInput->ism_metadata_delay_ms / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); -#endif pCombinedOrientationData = *ismInput->base.ctx.pCombinedOrientationData; @@ -8830,7 +8819,7 @@ static ivas_error getSamplesInternal( convertBitsBufferToInternalBitsBuff( *hBits, &bits ); if ( ( error = ivas_renderMultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 2ba8826fe56f6a162c7391cf38e5bc8caccecd9e Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:20:23 +0200 Subject: [PATCH 02/12] accept FIX_854_ARRAY_SIZE_MISMATCH --- lib_com/ivas_prot.h | 76 ++++++++++++++--------------------------- lib_com/options.h | 1 - lib_dec/ivas_core_dec.c | 19 ++++------- lib_enc/ivas_core_enc.c | 35 ++++--------------- 4 files changed, 39 insertions(+), 92 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index fc4cfe9366..2b2dfd8046 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -426,52 +426,31 @@ void ivas_initialize_handles_dec( ); ivas_error ivas_core_enc( - SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ - MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ - const int16_t n_CoreChannels, /* i : number of core channels to be coded */ -#ifdef FIX_854_ARRAY_SIZE_MISMATCH - float old_inp_12k8[][L_INP_12k8], /* i : buffer of old input signal */ - float old_inp_16k[][L_INP], /* i : buffer of old input signal */ - float ener[], /* i : residual energy from Levinson-Durbin */ - float A[][NB_SUBFR16k * ( M + 1 )], /* i : A(z) unquantized for the 4 subframes */ - float Aw[][NB_SUBFR16k * ( M + 1 )], /* i : weighted A(z) unquantized for subframes */ - float epsP[][M + 1], /* i : LP prediction errors */ - float lsp_new[][M], /* i : LSPs at the end of the frame */ - float lsp_mid[][M], /* i : LSPs in the middle of the frame */ - const int16_t vad_hover_flag[], /* i : VAD hanglover flag */ - int16_t attack_flag[], /* i : attack flag (GSC or TC) */ - float realBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer */ - float imagBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer */ - float old_wsp[][L_WSP], /* i : weighted input signal buffer */ - const int16_t loc_harm[], /* i : harmonicity flag */ - const float cor_map_sum[], /* i : speech/music clasif. parameter */ - const int16_t vad_flag_dtx[], /* i : HE-SAD flag with additional DTX HO */ - float enerBuffer[][CLDFB_NO_CHANNELS_MAX], /* i : energy buffer */ - float fft_buff[][2 * L_FFT], /* i : FFT buffer */ -#else - float old_inp_12k8[CPE_CHANNELS][L_INP_12k8], /* i : buffer of old input signal */ - float old_inp_16k[CPE_CHANNELS][L_INP], /* i : buffer of old input signal */ - float ener[CPE_CHANNELS], /* i : residual energy from Levinson-Durbin */ - float A[CPE_CHANNELS][NB_SUBFR16k * ( M + 1 )], /* i : A(z) unquantized for the 4 subframes */ - float Aw[CPE_CHANNELS][NB_SUBFR16k * ( M + 1 )], /* i : weighted A(z) unquantized for subframes */ - float epsP[CPE_CHANNELS][M + 1], /* i : LP prediction errors */ - float lsp_new[CPE_CHANNELS][M], /* i : LSPs at the end of the frame */ - float lsp_mid[CPE_CHANNELS][M], /* i : LSPs in the middle of the frame */ - const int16_t vad_hover_flag[CPE_CHANNELS], /* i : VAD hanglover flag */ - int16_t attack_flag[CPE_CHANNELS], /* i : attack flag (GSC or TC) */ - float realBuffer[CPE_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer */ - float imagBuffer[CPE_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer */ - float old_wsp[CPE_CHANNELS][L_WSP], /* i : weighted input signal buffer */ - const int16_t loc_harm[CPE_CHANNELS], /* i : harmonicity flag */ - const float cor_map_sum[CPE_CHANNELS], /* i : speech/music clasif. parameter */ - const int16_t vad_flag_dtx[CPE_CHANNELS], /* i : HE-SAD flag with additional DTX HO */ - float enerBuffer[CPE_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : energy buffer */ - float fft_buff[CPE_CHANNELS][2 * L_FFT], /* i : FFT buffer */ -#endif - const int16_t tdm_SM_flag, /* i : channel combination scheme flag */ - const int16_t ivas_format, /* i : IVAS format */ - const int16_t flag_16k_smc /* i : flag to indicate if the OL SMC is run at 16 kHz */ + SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ + const int16_t n_CoreChannels, /* i : number of core channels to be coded */ + float old_inp_12k8[][L_INP_12k8], /* i : buffer of old input signal */ + float old_inp_16k[][L_INP], /* i : buffer of old input signal */ + float ener[], /* i : residual energy from Levinson-Durbin */ + float A[][NB_SUBFR16k * ( M + 1 )], /* i : A(z) unquantized for the 4 subframes */ + float Aw[][NB_SUBFR16k * ( M + 1 )], /* i : weighted A(z) unquantized for subframes*/ + float epsP[][M + 1], /* i : LP prediction errors */ + float lsp_new[][M], /* i : LSPs at the end of the frame */ + float lsp_mid[][M], /* i : LSPs in the middle of the frame */ + const int16_t vad_hover_flag[], /* i : VAD hanglover flag */ + int16_t attack_flag[], /* i : attack flag (GSC or TC) */ + float realBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer */ + float imagBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer */ + float old_wsp[][L_WSP], /* i : weighted input signal buffer */ + const int16_t loc_harm[], /* i : harmonicity flag */ + const float cor_map_sum[], /* i : speech/music clasif. parameter */ + const int16_t vad_flag_dtx[], /* i : HE-SAD flag with additional DTX HO */ + float enerBuffer[][CLDFB_NO_CHANNELS_MAX], /* i : energy buffer */ + float fft_buff[][2 * L_FFT], /* i : FFT buffer */ + const int16_t tdm_SM_flag, /* i : channel combination scheme flag */ + const int16_t ivas_format, /* i : IVAS format */ + const int16_t flag_16k_smc /* i : flag to indicate if the OL SMC is run at 16 kHz */ ); ivas_error ivas_core_dec( @@ -480,13 +459,8 @@ ivas_error ivas_core_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ const int16_t n_channels, /* i : number of channels to be decoded */ -#ifdef FIX_854_ARRAY_SIZE_MISMATCH float *output[], /* o : output synthesis signal */ float outputHB[][L_FRAME48k], /* o : output HB synthesis signal */ -#else - float *output[CPE_CHANNELS], /* o : output synthesis signal */ - float outputHB[CPE_CHANNELS][L_FRAME48k], /* o : output HB synthesis signal */ -#endif float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX], /* o : DFT buffers */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ ); diff --git a/lib_com/options.h b/lib_com/options.h index be3537f97d..4b0163f30f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ -#define FIX_854_ARRAY_SIZE_MISMATCH /* VA: issue 854: correct the mismatch between definition and declaration of `ivas_core_dec() */ #define FIX_785_REMOVE_DEAD_CODE /* VA: issue 785: remove dead code */ #define FIX_852_FIX_HANDLE_DEREF /* VA: issue 852: Fix missing handle dereferencing of hIsmMetadaData in ivas_ism_metadata_close() */ #define FIX_520_REMOVE_MEMMOVE_JBM /* VA: issue 520: Remove memmove() from JBM code */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index da01c5de82..c05c003535 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -55,18 +55,13 @@ *-------------------------------------------------------------------*/ ivas_error ivas_core_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - SCE_DEC_HANDLE hSCE, /* i/o: SCE decoder structure */ - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ - const int16_t n_channels, /* i : number of channels to be decoded */ -#ifdef FIX_854_ARRAY_SIZE_MISMATCH - float *output[], /* o : output synthesis signal */ - float hb_synth[][L_FRAME48k], /* o : output HB synthesis signal */ -#else - float *output[L_FRAME48k], /* o : output synthesis signal */ - float hb_synth[CPE_CHANNELS][L_FRAME48k], /* o : output HB synthesis signal */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + SCE_DEC_HANDLE hSCE, /* i/o: SCE decoder structure */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ + const int16_t n_channels, /* i : number of channels to be decoded */ + float *output[], /* o : output synthesis signal */ + float hb_synth[][L_FRAME48k], /* o : output HB synthesis signal */ float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX], /* o : DFT buffers */ const int16_t sba_dirac_stereo_flag /* i : signal stereo output for SBA DirAC */ ) diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index bebd321827..a4be246987 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -55,11 +55,10 @@ extern float snr_[2][320]; *-------------------------------------------------------------------*/ ivas_error ivas_core_enc( - SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ - CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ - MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ - const int16_t n_CoreChannels, /* i : number of core channels to be coded */ -#ifdef FIX_854_ARRAY_SIZE_MISMATCH + SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ + CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ + MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ + const int16_t n_CoreChannels, /* i : number of core channels to be coded */ float old_inp_12k8[][L_INP_12k8], /* i : buffer of old input signal */ float old_inp_16k[][L_INP], /* i : buffer of old input signal */ float ener[], /* i : residual energy from Levinson-Durbin */ @@ -78,29 +77,9 @@ ivas_error ivas_core_enc( const int16_t vad_flag_dtx[], /* i : HE-SAD flag with additional DTX HO */ float enerBuffer[][CLDFB_NO_CHANNELS_MAX], /* i : energy buffer */ float fft_buff[][2 * L_FFT], /* i : FFT buffer */ -#else - float old_inp_12k8[CPE_CHANNELS][L_INP_12k8], /* i : buffer of old input signal */ - float old_inp_16k[CPE_CHANNELS][L_INP], /* i : buffer of old input signal */ - float ener[CPE_CHANNELS], /* i : residual energy from Levinson-Durbin */ - float A[CPE_CHANNELS][NB_SUBFR16k * ( M + 1 )], /* i : A(z) unquantized for the 4 subframes */ - float Aw[CPE_CHANNELS][NB_SUBFR16k * ( M + 1 )], /* i : weighted A(z) unquantized for subframes */ - float epsP[CPE_CHANNELS][M + 1], /* i : LP prediction errors */ - float lsp_new[CPE_CHANNELS][M], /* i : LSPs at the end of the frame */ - float lsp_mid[CPE_CHANNELS][M], /* i : LSPs in the middle of the frame */ - const int16_t vad_hover_flag[CPE_CHANNELS], /* i : VAD hanglover flag */ - int16_t attack_flag[CPE_CHANNELS], /* i : attack flag (GSC or TC) */ - float realBuffer[CPE_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: real buffer */ - float imagBuffer[CPE_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: imag buffer */ - float old_wsp[CPE_CHANNELS][L_WSP], /* i : weighted input signal buffer */ - const int16_t loc_harm[CPE_CHANNELS], /* i : harmonicity flag */ - const float cor_map_sum[CPE_CHANNELS], /* i : speech/music clasif. parameter */ - const int16_t vad_flag_dtx[CPE_CHANNELS], /* i : HE-SAD flag with additional DTX HO */ - float enerBuffer[CPE_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : energy buffer */ - float fft_buff[CPE_CHANNELS][2 * L_FFT], /* i : FFT buffer */ -#endif - const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag */ - const int16_t ivas_format, /* i : IVAS format */ - const int16_t flag_16k_smc /* i : flag to indicate if the OL SMC is run at 16 kHz */ + const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag */ + const int16_t ivas_format, /* i : IVAS format */ + const int16_t flag_16k_smc /* i : flag to indicate if the OL SMC is run at 16 kHz */ ) { int16_t n, input_frame; -- GitLab From 17ab7e28aca8f8d52d3fcb41a136f6a824738556 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:21:11 +0200 Subject: [PATCH 03/12] accept FIX_785_REMOVE_DEAD_CODE --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 5 ----- lib_enc/ivas_mct_enc.c | 6 ------ 3 files changed, 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4b0163f30f..21c0cbd7b1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ -#define FIX_785_REMOVE_DEAD_CODE /* VA: issue 785: remove dead code */ #define FIX_852_FIX_HANDLE_DEREF /* VA: issue 852: Fix missing handle dereferencing of hIsmMetadaData in ivas_ism_metadata_close() */ #define FIX_520_REMOVE_MEMMOVE_JBM /* VA: issue 520: Remove memmove() from JBM code */ #define FIX_853_ARRAY_SIZE_MISMATCH /* Nokia: Issue #853: Mismatch of declaration and definition of computeIntensityVector_ana and computeReferencePower_ana */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index e243494623..05c81f91ed 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -891,12 +891,7 @@ static void ivas_binaural_obtain_DMX( { int16_t chIdx, bandIdx, k; -#ifdef FIX_785_REMOVE_DEAD_CODE if ( hBinRenderer->ivas_format == MC_FORMAT ) -#else - // ToDo: hBinRenderer->ivas_format is never set to ISM_FORMAT - if ( hBinRenderer->ivas_format == MC_FORMAT || hBinRenderer->ivas_format == ISM_FORMAT ) -#endif { /* Obtain the downmix */ float P_in[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index e0d46ee26e..59bec00e27 100755 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -334,12 +334,6 @@ ivas_error create_mct_enc( { hMCT->nchan_out_woLFE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS - 1; } -#ifndef FIX_785_REMOVE_DEAD_CODE - else if ( ivas_format == SBA_FORMAT ) - { - hMCT->nchan_out_woLFE = ivas_sba_get_nchan( st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); - } -#endif #ifdef DEBUGGING else { -- GitLab From 13b3e54ccd18c0122a6990a3306ccfaffaaadd26 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:21:42 +0200 Subject: [PATCH 04/12] accept FIX_852_FIX_HANDLE_DEREF --- lib_com/ivas_ism_com.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index 69cfd10b07..3ec4656a9e 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -602,11 +602,7 @@ void ivas_ism_metadata_close( { int16_t n; -#ifdef FIX_852_FIX_HANDLE_DEREF if ( hIsmMetaData == NULL || *hIsmMetaData == NULL ) -#else - if ( hIsmMetaData == NULL || hIsmMetaData == NULL ) -#endif { return; } diff --git a/lib_com/options.h b/lib_com/options.h index 21c0cbd7b1..4a811ddd6a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ -#define FIX_852_FIX_HANDLE_DEREF /* VA: issue 852: Fix missing handle dereferencing of hIsmMetadaData in ivas_ism_metadata_close() */ #define FIX_520_REMOVE_MEMMOVE_JBM /* VA: issue 520: Remove memmove() from JBM code */ #define FIX_853_ARRAY_SIZE_MISMATCH /* Nokia: Issue #853: Mismatch of declaration and definition of computeIntensityVector_ana and computeReferencePower_ana */ #define FIX_814_DOUBLE_PREC_IN_REVERB /* Philips: Issue 814: Replace double precision arithmetic in reverb */ -- GitLab From d2300d4ff7b9a5de735153e1794e42c056ea6ddf Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:23:00 +0200 Subject: [PATCH 05/12] accept FIX_520_REMOVE_MEMMOVE_JBM --- lib_com/options.h | 1 - lib_dec/jbm_jb4_circularbuffer.c | 13 +------------ lib_dec/jbm_jb4_inputbuffer.c | 16 ++++------------ 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4a811ddd6a..3c01a4687e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ -#define FIX_520_REMOVE_MEMMOVE_JBM /* VA: issue 520: Remove memmove() from JBM code */ #define FIX_853_ARRAY_SIZE_MISMATCH /* Nokia: Issue #853: Mismatch of declaration and definition of computeIntensityVector_ana and computeReferencePower_ana */ #define FIX_814_DOUBLE_PREC_IN_REVERB /* Philips: Issue 814: Replace double precision arithmetic in reverb */ #define FIX_866_MOVE_VBAP /* Nokia: Issue 866: Move VBAP to lib_rend */ diff --git a/lib_dec/jbm_jb4_circularbuffer.c b/lib_dec/jbm_jb4_circularbuffer.c index a1a7ad76f6..b1067f96e2 100644 --- a/lib_dec/jbm_jb4_circularbuffer.c +++ b/lib_dec/jbm_jb4_circularbuffer.c @@ -437,10 +437,7 @@ static void JB4_CIRCULARBUFFER_calcPercentile( const uint16_t capacity, JB4_CIRCULARBUFFER_ELEMENT newElement ) { - uint16_t i; -#ifdef FIX_520_REMOVE_MEMMOVE_JBM - uint16_t j; -#endif + uint16_t i, j; /* insert newElement if elements buffer is not yet full */ if ( *size < capacity ) @@ -450,14 +447,10 @@ static void JB4_CIRCULARBUFFER_calcPercentile( if ( newElement <= elements[i] ) { /* insert newElement at index i */ -#ifdef FIX_520_REMOVE_MEMMOVE_JBM for ( j = *size; j > i; --j ) { elements[j] = elements[j - 1]; } -#else - memmove( elements + i + 1, elements + i, ( *size - i ) * sizeof( JB4_CIRCULARBUFFER_ELEMENT ) ); /* IVAS_fmToDo: avoid use of memmove() */ -#endif elements[i] = newElement; ++*size; return; @@ -481,14 +474,10 @@ static void JB4_CIRCULARBUFFER_calcPercentile( if ( newElement >= elements[i] ) { /* insert newElement at index i */ -#ifdef FIX_520_REMOVE_MEMMOVE_JBM for ( j = 0; j < i; j++ ) { elements[j] = elements[1 + j]; } -#else - memmove( elements, elements + 1, i * sizeof( JB4_CIRCULARBUFFER_ELEMENT ) ); -#endif elements[i] = newElement; return; } diff --git a/lib_dec/jbm_jb4_inputbuffer.c b/lib_dec/jbm_jb4_inputbuffer.c index 99f6c3ae2d..32c870bfa5 100644 --- a/lib_dec/jbm_jb4_inputbuffer.c +++ b/lib_dec/jbm_jb4_inputbuffer.c @@ -145,15 +145,13 @@ int16_t JB4_INPUTBUFFER_Enque( JB4_INPUTBUFFER_ELEMENT element, JB4_INPUTBUFFER_ELEMENT *replacedElement ) { - uint16_t size; + uint16_t j, size; int16_t low, high, middle, diff; uint16_t insertPos; uint16_t canMoveRight; uint16_t canMoveLeft; bool replace; -#ifdef FIX_520_REMOVE_MEMMOVE_JBM - uint16_t j; -#endif + *replacedElement = NULL; size = JB4_INPUTBUFFER_Size( h ); @@ -239,14 +237,11 @@ int16_t JB4_INPUTBUFFER_Enque( if ( canMoveRight ) { /* move higher elements to the right and insert at insertPos */ -#ifdef FIX_520_REMOVE_MEMMOVE_JBM for ( j = h->writePos; j > insertPos; --j ) { h->data[j] = h->data[j - 1]; } -#else - memmove( h->data + insertPos + 1, h->data + insertPos, ( h->writePos - insertPos ) * sizeof( JB4_INPUTBUFFER_ELEMENT ) ); /* IVAS_fmToDo: avoid use of memmove() */ -#endif + h->data[insertPos] = element; ++h->writePos; if ( h->writePos == h->capacity ) @@ -257,14 +252,11 @@ int16_t JB4_INPUTBUFFER_Enque( else { /* move lower elements to the left and insert before insertPos */ -#ifdef FIX_520_REMOVE_MEMMOVE_JBM for ( j = 0; j < low; j++ ) { h->data[h->readPos - 1 + j] = h->data[h->readPos + j]; } -#else - memmove( h->data + h->readPos - 1, h->data + h->readPos, low * sizeof( JB4_INPUTBUFFER_ELEMENT ) ); /* IVAS_fmToDo: avoid use of memmove() */ -#endif + h->data[insertPos - 1] = element; --h->readPos; assert( (int16_t) h->readPos >= 0 ); -- GitLab From bda232cf014f26b6c34d429df901d21853f1b6cc Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:23:54 +0200 Subject: [PATCH 06/12] accept FIX_853_ARRAY_SIZE_MISMATCH --- lib_com/options.h | 1 - lib_rend/ivas_prot_rend.h | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3c01a4687e..a5316d8095 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #define FIX_820_DOUBLE_PREC_MACROS /* VA: issue 820: Double precision arithmetic in IVAS_CALCULATE_ABS() */ -#define FIX_853_ARRAY_SIZE_MISMATCH /* Nokia: Issue #853: Mismatch of declaration and definition of computeIntensityVector_ana and computeReferencePower_ana */ #define FIX_814_DOUBLE_PREC_IN_REVERB /* Philips: Issue 814: Replace double precision arithmetic in reverb */ #define FIX_866_MOVE_VBAP /* Nokia: Issue 866: Move VBAP to lib_rend */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index cc2425e49b..4f2044ad50 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1691,7 +1691,6 @@ void ivas_omasa_ana_close( OMASA_ANA_HANDLE *hOMasa /* i/o: analysis OMASA handle */ ); -#ifdef FIX_853_ARRAY_SIZE_MISMATCH void computeIntensityVector_ana( const int16_t *band_grouping, /* i : Band grouping for estimation */ float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ @@ -1707,23 +1706,6 @@ void computeReferencePower_ana( float *reference_power, /* o : Estimated power */ const int16_t num_freq_bands /* i : Number of frequency bands */ ); -#else -void computeIntensityVector_ana( - const int16_t *band_grouping, /* i : Band grouping for estimation */ - float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ - float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Imag part of input signal */ - const int16_t num_frequency_bands, /* i : Number of frequency bands */ - float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] /* o : Intensity vector */ -); - -void computeReferencePower_ana( - const int16_t *band_grouping, /* i : Band grouping for estimation */ - float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ - float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Imag part of input signal */ - float *reference_power, /* o : Estimated power */ - const int16_t num_freq_bands /* i : Number of frequency bands */ -); -#endif void ivas_create_masa_out_meta( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: MASA metadata handle */ -- GitLab From 6e46dec15268a5492ad5a2b15def7d4f847bc5aa Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:24:45 +0200 Subject: [PATCH 07/12] accept NONBE_FIX_838_CRASH_24_4_WB --- lib_com/options.h | 1 - lib_enc/ivas_cpe_enc.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a5316d8095..d7b76fb40a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_838_CRASH_24_4_WB /* FhG: Issue 838: fix encoder crashes for Unified Stereo and MASA 2 TC at 24.4 kbps WB due to missing IGF (re-) allocation */ #define NONBE_FIX_839_MC_RS_CHANNEL_ALLOC /* FhG: Issues #839: problems with reallocation of the channels on the heap in case of MC RS */ #define BE_FIX_832_ASAN_ERROR_EFAP_OSBA /* FhG: issue #832: fix ASAN error caused by re-allocating EFAP memories in OSBA*/ #define NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS /* VA: issue 820: Double precision arithmetic in combined formats */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 1eadfc77b4..38508a70f0 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -110,12 +110,9 @@ ivas_error ivas_cpe_enc( ivas_error error; int32_t cpe_brate; int32_t element_brate_ref; -#ifdef NONBE_FIX_838_CRASH_24_4_WB int16_t last_bits_frame_nominal; /* last_bits_frame_nominal for M or PCh channel */ -#endif error = IVAS_ERR_OK; - push_wmops( "ivas_cpe_enc" ); hCPE = st_ivas->hCPE[cpe_id]; @@ -126,9 +123,7 @@ ivas_error ivas_cpe_enc( input_Fs = hEncoderConfig->input_Fs; ivas_total_brate = hEncoderConfig->ivas_total_brate; element_brate_ref = hCPE->element_brate; -#ifdef NONBE_FIX_838_CRASH_24_4_WB last_bits_frame_nominal = sts[0]->bits_frame_nominal; -#endif /*------------------------------------------------------------------* * Initialization - general @@ -527,11 +522,7 @@ ivas_error ivas_cpe_enc( /* IGF reconfiguration */ for ( n = 0; n < n_CoreChannels; n++ ) { -#ifdef NONBE_FIX_838_CRASH_24_4_WB if ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->element_mode != hCPE->last_element_mode || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal ) || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) -#else - if ( ( hCPE->last_element_brate != hCPE->element_brate || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) -#endif { int16_t igf; igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode ); -- GitLab From 5eced01d45026e0342b9082ba971a7b11510226b Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:27:17 +0200 Subject: [PATCH 08/12] accept NONBE_FIX_839_MC_RS_CHANNEL_ALLOC --- lib_com/ivas_prot.h | 4 +--- lib_com/options.h | 1 - lib_dec/ivas_ism_dec.c | 36 +------------------------------- lib_dec/ivas_mc_paramupmix_dec.c | 4 ---- lib_dec/ivas_mct_dec.c | 31 +-------------------------- lib_dec/ivas_omasa_dec.c | 28 ------------------------- lib_dec/ivas_sba_dec.c | 26 ----------------------- lib_rend/ivas_output_init.c | 2 -- 8 files changed, 3 insertions(+), 129 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 2b2dfd8046..1cbac362b6 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -294,13 +294,11 @@ ivas_error ivas_init_decoder( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC ivas_error ivas_output_buff_dec( float *p_output_f[], /* i/o: output audio buffers */ const int16_t nchan_out_buff_old, /* i : previous frame number of output channels*/ - const int16_t nchan_out_buff /* i : number of output channels */ + const int16_t nchan_out_buff /* i : number of output channels */ ); -#endif ivas_error stereo_dmx_evs_init_encoder( STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS, /* o : Stereo downmix for EVS encoder handle */ diff --git a/lib_com/options.h b/lib_com/options.h index d7b76fb40a..fda4a415dc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_839_MC_RS_CHANNEL_ALLOC /* FhG: Issues #839: problems with reallocation of the channels on the heap in case of MC RS */ #define BE_FIX_832_ASAN_ERROR_EFAP_OSBA /* FhG: issue #832: fix ASAN error caused by re-allocating EFAP memories in OSBA*/ #define NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS /* VA: issue 820: Double precision arithmetic in combined formats */ #define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 99a02aaabe..7d22eb50ba 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -67,11 +67,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( int16_t tc_nchan_tc_new; int16_t tc_nchan_allocate_new; int16_t tc_granularity_new; -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC int16_t nchan_out_buff, nchan_out_buff_old; -#else - int16_t ch, nchan_out_buff, nchan_out_buff_old; -#endif AUDIO_CONFIG intern_config_old; IVAS_OUTPUT_SETUP hIntSetupOld; RENDERER_TYPE renderer_type_old; @@ -80,17 +76,12 @@ static ivas_error ivas_ism_bitrate_switching_dec( nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; - /* we have to temporarily set the ism mode back to the old one, otherwise this can give wrong results*/ + /* temporarily set the ism mode back to the old one, otherwise this can give wrong results*/ ism_mode = st_ivas->ism_mode; st_ivas->ism_mode = last_ism_mode; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); st_ivas->ism_mode = ism_mode; -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#else - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif - if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK ) { @@ -337,37 +328,12 @@ static ivas_error ivas_ism_bitrate_switching_dec( if ( !st_ivas->hDecoderConfig->Opt_5ms ) #endif { -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; } -#else - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - - - if ( nchan_out_buff > nchan_out_buff_old ) - { - for ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) - { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[ch] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) /* note: 32000 == max internal sampling rate */ - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - } - } - else - { - for ( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ ) - { - free( st_ivas->p_output_f[ch] ); - st_ivas->p_output_f[ch] = NULL; - } - } -#endif } /*-----------------------------------------------------------------* diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 2582b5a808..fe93a65ee7 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -450,11 +450,7 @@ void ivas_mc_paramupmix_dec( } } -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); ch++ ) -#else - for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); ch++ ) -#endif { set_f( output_f[ch], 0.0f, output_frame ); } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index df488824b3..167d8b6727 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -731,19 +731,15 @@ static ivas_error ivas_mc_dec_reconfig( int16_t tc_granularity_new; AUDIO_CONFIG intern_config_old; IVAS_OUTPUT_SETUP hIntSetupOld; -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC int16_t nchan_out_buff_old, nchan_out_buff; -#endif error = IVAS_ERR_OK; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; nchan_transport_old = st_ivas->nchan_transport; -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#endif last_mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */ - /* we have to temporally set the current mc_mode back to the previous one to make sure the following call to + /* temporally set the current mc_mode back to the previous one to make sure the following call to ivas_init_dec_get_num_cldfb_instances() returns the correct counts */ mc_mode = st_ivas->mc_mode; st_ivas->mc_mode = last_mc_mode; @@ -1403,37 +1399,12 @@ static ivas_error ivas_mc_dec_reconfig( if ( !st_ivas->hDecoderConfig->Opt_5ms ) { #endif -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; } -#else - int16_t nchan_out_buff, ch; - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - - if ( nchan_out_buff > nchan_out_buf_old ) - { - for ( ch = nchan_out_buf_old; ch < nchan_out_buff; ch++ ) - { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[ch] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) /* note: 32000 == max internal sampling rate */ - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - } - } - else - { - for ( ch = nchan_out_buff; ch < nchan_out_buf_old; ch++ ) - { - free( st_ivas->p_output_f[ch] ); - st_ivas->p_output_f[ch] = NULL; - } - } -#endif #ifndef NONBE_UNIFIED_DECODING_PATHS } #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index fdcae487df..16f7462ef7 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -179,11 +179,7 @@ ivas_error ivas_omasa_dec_config( ivas_format_orig = st_ivas->ivas_format; st_ivas->ivas_format = st_ivas->last_ivas_format; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -#else - nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#endif st_ivas->ivas_format = ivas_format_orig; @@ -408,35 +404,11 @@ ivas_error ivas_omasa_dec_config( if ( !st_ivas->hDecoderConfig->Opt_5ms ) { #endif -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; } -#else - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - - if ( nchan_out_buff > nchan_out_buff_old ) - { - for ( k = nchan_out_buff_old; k < nchan_out_buff; k++ ) - { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[k] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) /* note: 32000 == max internal sampling rate */ - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - } - } - else - { - for ( k = nchan_out_buff; k < nchan_out_buff_old; k++ ) - { - free( st_ivas->p_output_f[k] ); - st_ivas->p_output_f[k] = NULL; - } - } -#endif #ifndef NONBE_UNIFIED_DECODING_PATHS } #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 575f14dedf..82ca41a271 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -118,11 +118,7 @@ ivas_error ivas_sba_dec_reconfigure( int32_t ivas_total_brate; int32_t last_ivas_total_brate; int16_t num_channels, num_md_sub_frames; -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC int16_t nchan_out_buff, nchan_out_buff_old; -#else - int16_t ch, nchan_out_buff, nchan_out_buff_old; -#endif #ifndef NONBE_UNIFIED_DECODING_PATHS int16_t sba_analysis_order_old; #endif @@ -684,32 +680,10 @@ ivas_error ivas_sba_dec_reconfigure( #endif nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( nchan_out_buff > nchan_out_buff_old ) - { - for ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ ) - { - /* note: these are intra-frame heap memories */ - if ( ( st_ivas->p_output_f[ch] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL ) /* note: 32000 == max internal sampling rate */ - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) ); - } - } - } - else - { - for ( ch = nchan_out_buff; ch < nchan_out_buff_old; ch++ ) - { - free( st_ivas->p_output_f[ch] ); - st_ivas->p_output_f[ch] = NULL; - } - } -#endif #ifndef NONBE_UNIFIED_DECODING_PATHS } #endif diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index aec9422460..7f4301cc2e 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -409,7 +409,6 @@ int16_t ivas_get_nchan_buffers_dec( } -#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC /*-------------------------------------------------------------------* * ivas_output_buff_dec() * @@ -446,4 +445,3 @@ ivas_error ivas_output_buff_dec( return IVAS_ERR_OK; } -#endif -- GitLab From ce372499a87006bd2a8c9adbae0c4cd81d8333c3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:28:02 +0200 Subject: [PATCH 09/12] accept BE_FIX_832_ASAN_ERROR_EFAP_OSBA --- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index fda4a415dc..e74cd8f327 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define BE_FIX_832_ASAN_ERROR_EFAP_OSBA /* FhG: issue #832: fix ASAN error caused by re-allocating EFAP memories in OSBA*/ #define NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS /* VA: issue 820: Double precision arithmetic in combined formats */ #define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index bb57f4c479..94060ae8ef 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -66,11 +66,7 @@ ivas_error ivas_ism_renderer_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer\n" ) ); } -#ifdef BE_FIX_832_ASAN_ERROR_EFAP_OSBA if ( st_ivas->hIntSetup.is_loudspeaker_setup && st_ivas->hIntSetup.ls_azimuth != NULL && st_ivas->hIntSetup.ls_elevation != NULL && st_ivas->hEFAPdata == NULL ) -#else - if ( st_ivas->hIntSetup.is_loudspeaker_setup && st_ivas->hIntSetup.ls_azimuth != NULL && st_ivas->hIntSetup.ls_elevation != NULL ) -#endif { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { -- GitLab From c4361f07d883737041c993a7b7572c8d4cd3b492 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:28:52 +0200 Subject: [PATCH 10/12] accept NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS --- lib_com/options.h | 1 - lib_enc/ivas_omasa_enc.c | 4 ---- lib_enc/ivas_osba_enc.c | 5 ----- lib_rend/ivas_omasa_ana.c | 4 ---- 4 files changed, 14 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e74cd8f327..c3b6d446ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS /* VA: issue 820: Double precision arithmetic in combined formats */ #define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 7a17117acd..8f0cf13487 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -127,11 +127,7 @@ ivas_error ivas_omasa_enc_open( for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { -#ifdef NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS set_f( hOMasa->prev_object_dm_gains[i], INV_SQRT_2, MASA_MAX_TRANSPORT_CHANNELS ); -#else - set_f( hOMasa->prev_object_dm_gains[i], (float) sqrt( 0.5 ), MASA_MAX_TRANSPORT_CHANNELS ); -#endif } set_zero( hOMasa->broadband_energy_sm, MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS ); set_zero( hOMasa->broadband_energy_prev, MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS ); diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index 7c4e844f45..83841795f7 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -96,7 +96,6 @@ ivas_error ivas_osba_enc_open( int16_t len; error = IVAS_ERR_OK; - if ( ( hOSba = (OSBA_ENC_HANDLE) malloc( sizeof( OSBA_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for OMASA encoder\n" ) ); @@ -104,11 +103,7 @@ ivas_error ivas_osba_enc_open( for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { -#ifdef NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS set_f( hOSba->prev_object_dm_gains[i], INV_SQRT_2, MAX_INPUT_CHANNELS ); -#else - set_f( hOSba->prev_object_dm_gains[i], (float) sqrt( 0.5 ), MAX_INPUT_CHANNELS ); -#endif } len = NS2SA( st_ivas->hEncoderConfig->input_Fs, IVAS_FB_ENC_DELAY_NS ); diff --git a/lib_rend/ivas_omasa_ana.c b/lib_rend/ivas_omasa_ana.c index 3114e8dd24..16f0e0b5d9 100644 --- a/lib_rend/ivas_omasa_ana.c +++ b/lib_rend/ivas_omasa_ana.c @@ -150,11 +150,7 @@ ivas_error ivas_omasa_ana_open( for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { -#ifdef NONBE_FIX_819_DOUBLE_PREC_COMB_FORMATS set_f( hOMasa->prev_object_dm_gains[i], INV_SQRT_2, MASA_MAX_TRANSPORT_CHANNELS ); -#else - set_f( hOMasa->prev_object_dm_gains[i], (float) sqrt( 0.5 ), MASA_MAX_TRANSPORT_CHANNELS ); -#endif } input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); -- GitLab From 8547aaae7ee5629e1832b15deae759a2e24aad52 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:29:42 +0200 Subject: [PATCH 11/12] accept NONBE_FIX_849_OMASA_BFI_CRASH --- lib_com/options.h | 1 - lib_dec/ivas_cpe_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c3b6d446ab..f819688d67 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_849_OMASA_BFI_CRASH /* VA: issue 849: fix OMASA 2TC and FEC crashes */ #define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ #define NONBE_UNIFIED_DECODING_PATHS /* FhG: unify decoding paths */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index b460948a98..d8b5ec4713 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -1114,10 +1114,8 @@ static void stereo_mode_combined_format_dec( ( ( st_ivas->nchan_ism == 3 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_96k ) || ( st_ivas->nchan_ism == 4 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_128k ) ) ) { -#ifdef NONBE_FIX_849_OMASA_BFI_CRASH if ( !st_ivas->bfi ) { -#endif /* read OMASA stereo mode signalling */ if ( get_next_indice( hCPE->hCoreCoder[0], NBITS_ELEMENT_MODE ) ) { @@ -1127,9 +1125,7 @@ static void stereo_mode_combined_format_dec( { hCPE->element_mode = IVAS_CPE_DFT; } -#ifdef NONBE_FIX_849_OMASA_BFI_CRASH } -#endif if ( hCPE->element_mode == IVAS_CPE_MDCT ) { -- GitLab From 65b8561f484ad37d684dfafd304b9e8aa713f087 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Oct 2023 11:32:22 +0200 Subject: [PATCH 12/12] clang-format --- lib_com/options.h | 4 ++-- lib_rend/lib_rend.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f819688d67..c5d1fd35b6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,6 +154,7 @@ #define FIX_814_DOUBLE_PREC_IN_REVERB /* Philips: Issue 814: Replace double precision arithmetic in reverb */ #define FIX_866_MOVE_VBAP /* Nokia: Issue 866: Move VBAP to lib_rend */ + /* #################### End BE switches ################################## */ @@ -162,13 +163,12 @@ /* 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_UNIFIED_DECODING_PATHS /* FhG: unify decoding paths */ #define NONBE_FIX_861_MASA_CRASH_STEREO_SWITCHING /* VA: issue 861: fix MASA 2TC crash when switching from MDCT stereo to TD/DFT stereo */ #define BE_FIX_867_PARAMC_RECONFIG /* FhG: issue #867: fix ParamMC CLDFB buffer dealloc when reconfiguring */ - #define NONBE_FIX_850_MASA_HBR_META_RATIO_DECODING /* Nokia: issue #850: Fixes rare non-valid diffuseness and energy ratio values in 2dir MASA. */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e6d8535ba3..d754ffa4b1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8819,7 +8819,7 @@ static ivas_error getSamplesInternal( convertBitsBufferToInternalBitsBuff( *hBits, &bits ); if ( ( error = ivas_renderMultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { return error; } -- GitLab