diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 594d00ee305a8d0908dc235ac0a1e6f5ebc0045b..eb2f59fe89ba689ca48c90e4ba92f31ba741215b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1453,7 +1453,11 @@ int16_t stereo_dft_sg_recovery( void stereo_dft_dec_res( CPE_DEC_HANDLE hCPE, /* i/o: decoder CPE handle */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float res_buf[STEREO_DFT_N_8k], /* i : residual buffer */ +#else float res_buf[STEREO_DFT_BUF_MAX], /* i : residual buffer */ +#endif float *output /* o : output frame */ ); @@ -1461,7 +1465,11 @@ void stereo_dft_dec_res( int16_t res_bpf_adapt( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: DFT stereo decoder handle */ const float *bpf_error_signal_8k, /* i : BPF modification signal */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float res_buf[STEREO_DFT_N_8k] /* i : residual buffer */ +#else float res_buf[STEREO_DFT_BUF_MAX] /* i : residual buffer */ +#endif ); void bpf_pitch_coherence( @@ -1477,7 +1485,11 @@ void stereo_dft_dec_read_BS( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder DFT stereo handle */ const int16_t bwidth, /* i : bandwidth */ const int16_t output_frame, /* i : output frame length */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float res_buf[STEREO_DFT_N_8k], /* o : residual buffer */ +#else float res_buf[STEREO_DFT_BUF_MAX], /* o : residual buffer */ +#endif int16_t *nb_bits, /* o : number of bits read */ float *coh, /* i/o: Coherence */ const int16_t ivas_format /* i : ivas format */ @@ -2252,10 +2264,19 @@ void EstimateStereoTCXNoiseLevel( void TNSAnalysisStereo( Encoder_State **sts, /* i : state handle */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float *mdst_spectrum[CPE_CHANNELS][NB_DIV], /* o : MDST spectrum */ +#else float *mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* o : MDST spectrum */ +#endif const int16_t bWhitenedDomain, /* i : whitened domain flag */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + int16_t tnsSize[CPE_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ + int16_t tnsBits[CPE_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ +#else int16_t tnsSize[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ int16_t tnsBits[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ +#endif int16_t param_core[][NB_DIV * NPRM_DIV], /* o : quantized noise filling level */ const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ ); @@ -2538,8 +2559,13 @@ void stereo_decoder_tcx( STEREO_MDCT_DEC_DATA *hStereoMdct, /* i/o: MDCT stereo decoder structure */ int16_t ms_mask[NB_DIV][MAX_SFB], /* i : bandwise MS mask */ float *spec_r_0[NB_DIV], /* i/o: spectrum right channel */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float *spec_l[], /* i/o: spectrum left channel [NB_DIV][N] */ + float *spec_r[], /* i/o: spectrum right channel [NB_DIV][N] */ +#else float *spec_l[NB_DIV], /* i/o: spectrum left channel */ float *spec_r[NB_DIV], /* i/o: spectrum right channel */ +#endif const int16_t mdct_stereo_mode[], /* i : stereo mode (FB/band wise MS, dual mono */ const int16_t core_l, /* i : core for left channel (TCX20/TCX10) */ const int16_t core_r, /* i : core for right channel (TCX20/TCX10) */ @@ -3071,7 +3097,11 @@ void mctStereoIGF_enc( void ivas_mdct_dec_side_bits_frame_channel( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ +#else int16_t param_lpc[MCT_MAX_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ +#endif int16_t p_param[CPE_CHANNELS][NB_DIV], /* o : pointer to param buffer */ Decoder_State *st0, /* i : pointer to bitstream handle */ int16_t nTnsBitsTCX10[CPE_CHANNELS][NB_DIV], /* o : number of bits for TNS */ diff --git a/lib_com/options.h b/lib_com/options.h index 4db8212f734cdf1ca4f71fded00632d3df209ab7..2c04e3772d596165540d1ff152daa49bc14fdbf6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,6 +156,7 @@ /* #################### End BE switches ################################## */ #define FIX_899_VARIABLE_SPEED_DECODING /* FhG: Fix variable speed decoding */ +#define FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO /* VA: Fix the definition of buffers/arrays in DFT and MDCT stereo to satisfy gcc v 11.4.0 */ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt selection floating point code */ diff --git a/lib_dec/bass_psfilter.c b/lib_dec/bass_psfilter.c index 0a0eabd1153824989e9f74fa00d17d5a670cf553..d1fc86e0ed2f100011d04748ec3b033f06abea4f 100644 --- a/lib_dec/bass_psfilter.c +++ b/lib_dec/bass_psfilter.c @@ -522,7 +522,11 @@ void addBassPostFilter( int16_t res_bpf_adapt( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: DFT stereo decoder handle */ const float *bpf_error_signal_8k, /* i : BPF modification signal */ - float res_buf[STEREO_DFT_BUF_MAX] /* i : residual buffer */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float res_buf[STEREO_DFT_N_8k] /* i : residual buffer */ +#else + float res_buf[STEREO_DFT_BUF_MAX] /* i : residual buffer */ +#endif ) { float error_nrg; diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index d189cdc5422fa5b2b729dae7ff76195da2833406..3e6d630a8e1ba1539dcf794df1a24851d3cd5e51 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -285,8 +285,12 @@ static void dec_prm_tcx_spec( *-----------------------------------------------------------------*/ void ivas_mdct_dec_side_bits_frame_channel( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - int16_t param_lpc[MCT_MAX_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + int16_t param_lpc[CPE_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ +#else + int16_t param_lpc[MCT_MAX_CHANNELS][NPRM_LPC_NEW], /* o : lpc_parameters */ +#endif int16_t p_param[CPE_CHANNELS][NB_DIV], /* o : pointer to param buffer */ Decoder_State *st0, /* i : pointer to bitstream handle */ int16_t nTnsBitsTCX10[CPE_CHANNELS][NB_DIV], /* o : number of bits for TNS */ diff --git a/lib_dec/ivas_stereo_dft_dec.c b/lib_dec/ivas_stereo_dft_dec.c index ad18db77784a9283e0fd6e4a11ccfc5c91bab2f6..caef6fe536cd553ee5480c5b119c3423de8504cf 100755 --- a/lib_dec/ivas_stereo_dft_dec.c +++ b/lib_dec/ivas_stereo_dft_dec.c @@ -1741,9 +1741,13 @@ void stereo_dft_dec( *-------------------------------------------------------------------------*/ void stereo_dft_dec_res( - CPE_DEC_HANDLE hCPE, /* i/o: decoder CPE handle */ + CPE_DEC_HANDLE hCPE, /* i/o: decoder CPE handle */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float res_buf[STEREO_DFT_N_8k], /* i : residual buffer */ +#else float res_buf[STEREO_DFT_BUF_MAX], /* i : residual buffer */ - float *output /* o : output */ +#endif + float *output /* o : output */ ) { int16_t i; @@ -1881,10 +1885,14 @@ void stereo_dft_dec_read_BS( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder stereo handle */ const int16_t bwidth, /* i : bandwidth */ const int16_t output_frame, /* i : output frame length */ - float res_buf[STEREO_DFT_BUF_MAX], /* o : residual buffer */ - int16_t *nb_bits, /* o : number of bits read */ - float *coh, /* i/o: Coherence */ - const int16_t ivas_format /* i : ivas format */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float res_buf[STEREO_DFT_N_8k], /* o : residual buffer */ +#else + float res_buf[STEREO_DFT_BUF_MAX], /* o : residual buffer */ +#endif + int16_t *nb_bits, /* o : number of bits read */ + float *coh, /* i/o: Coherence */ + const int16_t ivas_format /* i : ivas format */ ) { int16_t b, N_div, nbands; diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index 0610447a6f73cc8993f6818fa4c7e6375179b50d..95d7ba6d68ff20e8cce58293eadf6476d882899b 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -209,18 +209,23 @@ void stereo_decoder_tcx( STEREO_MDCT_DEC_DATA *hStereoMdct, /* i/o: MDCT stereo decoder structure */ int16_t ms_mask[NB_DIV][MAX_SFB], /* i : bandwise MS mask */ float *spec_r_0[NB_DIV], /* i/o: spectrum right channel */ - float *spec_l[NB_DIV], /* i/o: spectrum left channel */ - float *spec_r[NB_DIV], /* i/o: spectrum right channel */ - const int16_t mdct_stereo_mode[], /* i : stereo mode (FB/band wise MS, dual mono */ - const int16_t core_l, /* i : core for left channel (TCX20/TCX10) */ - const int16_t core_r, /* i : core for right channel (TCX20/TCX10) */ - const int16_t igf, /* i : flag for IGF activity */ - const int16_t L_frameTCX_l, /* i : TCX frame length of left channel */ - const int16_t L_frameTCX_r, /* i : TCX frame length of right channel */ - const int16_t mct_on, /* i : flag mct block (1) or stereo (0) */ - const int16_t last_core_l, /* i : last core for left channel */ - const int16_t last_core_r, /* i : last core for right channel */ - const int16_t tmp_plc_upmix /* i : indicates temp upmix for PLC decision */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float *spec_l[], /* i/o: spectrum left channel [NB_DIV][N] */ + float *spec_r[], /* i/o: spectrum right channel [NB_DIV][N] */ +#else + float *spec_l[NB_DIV], /* i/o: spectrum left channel */ + float *spec_r[NB_DIV], /* i/o: spectrum right channel */ +#endif + const int16_t mdct_stereo_mode[], /* i : stereo mode (FB/band wise MS, dual mono */ + const int16_t core_l, /* i : core for left channel (TCX20/TCX10) */ + const int16_t core_r, /* i : core for right channel (TCX20/TCX10) */ + const int16_t igf, /* i : flag for IGF activity */ + const int16_t L_frameTCX_l, /* i : TCX frame length of left channel */ + const int16_t L_frameTCX_r, /* i : TCX frame length of right channel */ + const int16_t mct_on, /* i : flag mct block (1) or stereo (0) */ + const int16_t last_core_l, /* i : last core for left channel */ + const int16_t last_core_r, /* i : last core for right channel */ + const int16_t tmp_plc_upmix /* i : indicates temp upmix for PLC decision */ ) { int16_t i, k, sfb, nSubframes; diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index abaa0a0a8c3f60fd1b0064541f30c9a8a48c926b..9e4b601a53243397e429485d02e46c3fe5301fb8 100755 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -109,13 +109,22 @@ void HBAutocorrelation( #define TNS_GAIN_THRESHOLD_FOR_WHITE ( 3.0f ) void TNSAnalysisStereo( - Encoder_State **sts, /* i : encoder state handle */ + Encoder_State **sts, /* i : encoder state handle */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + float *mdst_spectrum[CPE_CHANNELS][NB_DIV], /* o : MDST spectrum */ +#else float *mdst_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* o : MDST spectrum */ - const int16_t bWhitenedDomain, /* i : whitened domain flag */ +#endif + const int16_t bWhitenedDomain, /* i : whitened domain flag */ +#ifdef FIX_887_ARRAY_SIZE_DFT_MDCT_STEREO + int16_t tnsSize[CPE_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ + int16_t tnsBits[CPE_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ +#else int16_t tnsSize[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns parameters put into prm */ int16_t tnsBits[MCT_MAX_CHANNELS][NB_DIV], /* i : number of tns bits in the frame */ - int16_t param_core[][NB_DIV * NPRM_DIV], /* o : TNS parameters */ - const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ +#endif + int16_t param_core[][NB_DIV * NPRM_DIV], /* o : TNS parameters */ + const int16_t mct_on /* i : flag mct block (1) or stereo (0) */ ) { int16_t ch, k, L_spec, L_frame, nSubframes, iFilter;