From 83e70ab8dab8bf13b47b5407fe1e93332cd50e90 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 11 Oct 2023 12:33:30 +0200 Subject: [PATCH 1/2] issue 854: correct the mismatch between definition and declaration of `ivas_core_dec(); under FIX_854_ARRAY_SIZE_MISMATCH --- lib_com/options.h | 1 + lib_dec/ivas_core_dec.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9348bf96aa..f696227de7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,7 @@ /*#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_854_ARRAY_SIZE_MISMATCH /* VA: issue 854: correct the mismatch between definition and declaration of `ivas_core_dec() */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 77495c76d1..b94185d77d 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -55,12 +55,16 @@ *-------------------------------------------------------------------*/ 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 */ - float *output[L_FRAME48k], /* o : output synthesis signal */ + 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[CPE_CHANNELS], /* o : output synthesis signal */ +#else + float *output[L_FRAME48k], /* o : output synthesis signal */ +#endif float hb_synth[CPE_CHANNELS][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 */ -- GitLab From 175d2f6dea63be8f7ee08b1cea434a1cee259fc5 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 11 Oct 2023 17:11:53 +0200 Subject: [PATCH 2/2] More updates within FIX_854_ARRAY_SIZE_MISMATCH. --- lib_com/ivas_prot.h | 30 ++++++++++++++++++++++++++++-- lib_dec/ivas_core_dec.c | 7 ++++--- lib_enc/ivas_core_enc.c | 35 ++++++++++++++++++++++++++++------- 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 66350fb694..ec085c6584 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -430,6 +430,26 @@ ivas_error ivas_core_enc( 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 */ @@ -448,8 +468,9 @@ ivas_error ivas_core_enc( 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 */ - const int16_t tdm_SM_flag, /* i : channel combination scheme flag */ - const int16_t ivas_format, /* i : IVAS format */ +#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 */ ); @@ -459,8 +480,13 @@ 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_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index b94185d77d..da01c5de82 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -61,11 +61,12 @@ ivas_error ivas_core_dec( 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[CPE_CHANNELS], /* o : output synthesis signal */ + 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 *output[L_FRAME48k], /* o : output synthesis signal */ + float hb_synth[CPE_CHANNELS][L_FRAME48k], /* o : output HB synthesis signal */ #endif - float hb_synth[CPE_CHANNELS][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 c242018ee0..bebd321827 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -55,10 +55,30 @@ 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 */ + 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 */ @@ -77,9 +97,10 @@ ivas_error ivas_core_enc( 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 */ - const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag in TD stereo OR LRTD primary channel */ - 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 */ +#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 */ ) { int16_t n, input_frame; -- GitLab