From 82fdad6dfa960410f9aa7702e807026df1286f7c Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 1 May 2025 08:39:13 +0200 Subject: [PATCH 1/3] issue 1320: Optimize the stack memory consumption in the CPE decoder; under FIX_1320_STACK_CPE_DECODER --- lib_com/options.h | 1 + lib_dec/ivas_core_dec.c | 32 +++++++++++++-- lib_dec/ivas_cpe_dec.c | 87 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 904e462921..a7ea44edba 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,6 +161,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ +#define FIX_1320_STACK_CPE_DECODER /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index eb961c38dc..7b6e5770e1 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -75,7 +75,12 @@ ivas_error ivas_core_dec( float synth[CPE_CHANNELS][L_FRAME48k]; float tmp_buffer[L_FRAME48k]; int16_t tmps, incr; +#ifdef FIX_1320_STACK_CPE_DECODER + float *bwe_exc_extended[CPE_CHANNELS] = { NULL, NULL }; + int16_t flag_bwe_bws; +#else float bwe_exc_extended[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; +#endif float voice_factors[CPE_CHANNELS][NB_SUBFR16k]; int16_t core_switching_flag[CPE_CHANNELS]; float old_syn_12k8_16k[CPE_CHANNELS][L_FRAME16k]; @@ -200,6 +205,9 @@ ivas_error ivas_core_dec( set_f( voice_factors[n], 0.f, NB_SUBFR16k ); set_f( hb_synth[n], 0.0f, L_FRAME48k ); +#ifdef FIX_1320_STACK_CPE_DECODER + bwe_exc_extended[n] = hb_synth[n]; /* note: reuse the buffer */ +#endif /*------------------------------------------------------------------* * Decision matrix (selection of technologies) @@ -510,6 +518,10 @@ ivas_error ivas_core_dec( * SWB(FB) BWE decoding *---------------------------------------------------------------------*/ +#ifdef FIX_1320_STACK_CPE_DECODER + flag_bwe_bws = ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); + +#endif if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ) { /* SWB TBE decoder */ @@ -521,12 +533,23 @@ ivas_error ivas_core_dec( fb_tbe_dec( st, tmp_buffer /*fb_exc*/, hb_synth[n], tmp_buffer /*fb_synth_ref*/, output_frame ); } } +#ifdef FIX_1320_STACK_CPE_DECODER + else if ( st->extl == SWB_BWE || st->extl == FB_BWE || flag_bwe_bws ) +#else else if ( st->extl == SWB_BWE || st->extl == FB_BWE || ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && !st->ppp_mode_dec && !( st->nelp_mode_dec == 1 && st->bfi == 1 ) ) ) +#endif { /* SWB BWE decoder */ swb_bwe_dec( st, output[n], synth[n], hb_synth[n], use_cldfb_for_dft, output_frame ); } +#ifdef FIX_1320_STACK_CPE_DECODER + if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 ) + { + set_f( hb_synth[n], 0.0f, L_FRAME48k ); + } + +#endif /*---------------------------------------------------------------------* * FEC - recovery after lost HQ core (smoothing of the BWE component) *---------------------------------------------------------------------*/ @@ -560,6 +583,7 @@ ivas_error ivas_core_dec( stereo_icBWE_dec( hCPE, hb_synth[0], hb_synth[1], tmp_buffer /*fb_synth_ref*/, voice_factors[0], output_frame ); } +#ifndef FIX_1320_STACK_CPE_DECODER if ( st->element_mode == EVS_MONO ) { /*----------------------------------------------------------------* @@ -575,7 +599,7 @@ ivas_error ivas_core_dec( st->hPlcInfo->Pitch = 0; } } - +#endif /*----------------------------------------------------------------* * Transition and synchronization of BWE components *----------------------------------------------------------------*/ @@ -590,6 +614,7 @@ ivas_error ivas_core_dec( } else { +#ifndef FIX_1320_STACK_CPE_DECODER if ( st->extl == SWB_BWE_HIGHRATE || st->extl == FB_BWE_HIGHRATE ) { /* HR SWB BWE on top of ACELP@16kHz */ @@ -597,9 +622,12 @@ ivas_error ivas_core_dec( } else { +#endif /* TBE on top of ACELP@16kHz */ tmps = NS2SA( output_Fs, MAX_DELAY_TBE_NS - DELAY_SWB_TBE_16k_NS ); +#ifndef FIX_1320_STACK_CPE_DECODER } +#endif } /* Smooth transitions when switching between different technologies */ @@ -733,11 +761,9 @@ ivas_error ivas_core_dec( } /* n_channels loop */ - #ifdef DEBUG_MODE_INFO output_debug_mode_info_dec( sts, n_channels, output_frame, pitch_buf ); #endif - pop_wmops(); return error; } diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index dea4a37211..e9d9a62384 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -54,6 +54,10 @@ static void read_stereo_mode_and_bwidth( CPE_DEC_HANDLE hCPE, const Decoder_Stru static void stereo_mode_combined_format_dec( const Decoder_Struct *st_ivas, CPE_DEC_HANDLE hCPE ); +#ifdef FIX_1320_STACK_CPE_DECODER +static ivas_error stereo_dft_dec_main( CPE_DEC_HANDLE hCPE, const int32_t ivas_total_brate, const int16_t n_channels, float res_buf[STEREO_DFT_N_8k], float *output[], float outputHB[][L_FRAME48k], const int16_t output_frame ); + +#endif /*--------------------------------------------------------------------------* * ivas_cpe_dec() @@ -74,7 +78,11 @@ ivas_error ivas_cpe_dec( int16_t last_bwidth; int16_t tdm_ratio_idx; float outputHB[CPE_CHANNELS][L_FRAME48k]; /* 'float' buffer for output HB synthesis, both channels */ +#ifdef FIX_1320_STACK_CPE_DECODER + float *res_buf = NULL; +#else float res_buf[STEREO_DFT_N_8k]; +#endif CPE_DEC_HANDLE hCPE; Decoder_State **sts; STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft; @@ -265,6 +273,10 @@ ivas_error ivas_cpe_dec( } else { +#ifdef FIX_1320_STACK_CPE_DECODER + res_buf = outputHB[0]; /* note: temporarily reused buffer */ + +#endif if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) { nb_bits -= nb_bits_metadata; @@ -443,6 +455,12 @@ ivas_error ivas_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_DFT && !( hCPE->nchan_out == 1 && hConfigDft->res_cod_mode == STEREO_DFT_RES_COD_OFF ) ) { +#ifdef FIX_1320_STACK_CPE_DECODER + if ( ( error = stereo_dft_dec_main( hCPE, ivas_total_brate, n_channels, res_buf, output, outputHB, output_frame ) ) != IVAS_ERR_OK ) + { + return error; + } +#else float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX]; /* core decoder */ @@ -477,6 +495,7 @@ ivas_error ivas_cpe_dec( { stereo_dft_dec_synthesize( hCPE, DFT, n, output[n], output_frame ); } +#endif } else if ( hCPE->element_mode == IVAS_CPE_TD ) { @@ -601,6 +620,74 @@ ivas_error ivas_cpe_dec( return error; } +#ifdef FIX_1320_STACK_CPE_DECODER + +/*------------------------------------------------------------------------- + * stereo_dft_dec_main() + * + * DFT decoder main function + *-------------------------------------------------------------------------*/ + +static ivas_error stereo_dft_dec_main( + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t n_channels, /* i : number of channels to be decoded */ + float *p_res_buf, /* i : DFT stereo residual S signal */ + float *output[], /* o : output synthesis signal */ + float outputHB[][L_FRAME48k], /* o : output HB synthesis signal */ + const int16_t output_frame /* i : output frame length per channel */ +) +{ + float DFT[CPE_CHANNELS][STEREO_DFT_BUF_MAX]; + int16_t n; + Decoder_State *st0; + ivas_error error; + + st0 = hCPE->hCoreCoder[0]; + + /* copy from temporary buffer */ + if ( hCPE->hStereoDft->res_cod_band_max > 0 && !st0->bfi ) + { + mvr2r( p_res_buf, DFT[1], STEREO_DFT_N_8k ); + } + + /* core decoder */ + if ( ( error = ivas_core_dec( NULL, NULL, hCPE, NULL, n_channels, output, outputHB, DFT, 0 ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* DFT Stereo residual decoding */ + if ( hCPE->hStereoDft->res_cod_band_max > 0 && !st0->bfi ) + { + stereo_dft_dec_res( hCPE, DFT[1] /*res_buf*/, output[1] ); + + stereo_dft_dec_analyze( hCPE, output[1], DFT, 1, L_FRAME8k, output_frame, DFT_STEREO_DEC_ANA_LB, 0, 0 ); + } + + /* DFT stereo CNG */ + stereo_dtf_cng( hCPE, ivas_total_brate, DFT, output_frame ); + + /* decoding */ + if ( hCPE->nchan_out == 1 ) + { + stereo_dft_unify_dmx( hCPE->hStereoDft, st0, DFT, hCPE->input_mem[1], hCPE->hStereoCng->prev_sid_nodata ); + } + else + { + stereo_dft_dec( hCPE->hStereoDft, st0, DFT, hCPE->input_mem[1], hCPE->hStereoCng, 0, 0, 0, 0, 0, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); + } + + /* synthesis iFFT */ + for ( n = 0; n < hCPE->nchan_out; n++ ) + { + stereo_dft_dec_synthesize( hCPE, DFT, n, output[n], output_frame ); + } + + return IVAS_ERR_OK; +} + +#endif /*------------------------------------------------------------------------- * create_cpe_dec() -- GitLab From f79d86a2c03a8cdac6f4c26e0ea92e4f21ffaac8 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 1 May 2025 09:47:23 +0200 Subject: [PATCH 2/3] FIX_1320_STACK_CPE_DECODER in mdct_core --- lib_dec/ivas_mdct_core_dec.c | 8 ++++++++ lib_dec/ivas_stereo_mdct_core_dec.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index dd0bfac76d..581374ac74 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -804,7 +804,11 @@ void ivas_mdct_core_reconstruct( int16_t L_frame[CPE_CHANNELS], L_frameTCX[CPE_CHANNELS], nSubframes[CPE_CHANNELS]; int16_t L_frame_global[CPE_CHANNELS], L_frame_globalTCX[CPE_CHANNELS]; /* Synth */ +#ifdef FIX_1320_STACK_CPE_DECODER + float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME32k + L_FRAME32k / 4 + M]; +#else float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; +#endif float *synth; float synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; float *synthFB; @@ -841,7 +845,11 @@ void ivas_mdct_core_reconstruct( synthFB = synth_bufFB + st->hTcxDec->old_synth_lenFB; mvr2r( st->hTcxDec->old_synth, synth_buf, st->hTcxDec->old_synth_len ); mvr2r( st->hTcxDec->old_synthFB, synth_bufFB, st->hTcxDec->old_synth_lenFB ); +#ifdef FIX_1320_STACK_CPE_DECODER + set_zero( synth, L_FRAME32k + L_FRAME32k / 4 + M ); +#else set_zero( synth, L_FRAME_PLUS + M ); +#endif set_zero( synthFB, L_FRAME_PLUS + M ); if ( st->core != ACELP_CORE ) diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index d569640669..a70e62ea2e 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -156,7 +156,9 @@ void stereo_mdct_core_dec( float *x[CPE_CHANNELS][NB_DIV]; /*needed to allocate N_MAX to prevent stereo switching crash */ +#ifndef FIX_1320_STACK_CPE_DECODER float x_0_buf[CPE_CHANNELS][N_MAX]; +#endif float *x_0[CPE_CHANNELS][NB_DIV]; /* Concealment */ @@ -178,6 +180,7 @@ void stereo_mdct_core_dec( int16_t p_param[CPE_CHANNELS][NB_DIV]; int16_t nTnsBitsTCX10[CPE_CHANNELS][NB_DIV]; + float signal_outFB_tmp[CPE_CHANNELS][L_FRAME_PLUS]; float signal_out_tmp[CPE_CHANNELS][L_FRAME_PLUS]; push_wmops( "stereo_mdct_core_dec" ); @@ -202,9 +205,15 @@ void stereo_mdct_core_dec( x[ch][0] = &signal_out_tmp[ch][0]; x[ch][1] = &signal_out_tmp[ch][0] + L_FRAME_PLUS / 2; +#ifdef FIX_1320_STACK_CPE_DECODER + set_zero( signal_outFB_tmp[ch], N_MAX ); /* length of N_MAX is needed to prevent stereo switching crash -> reuse buffer signal_outFB_tmp[][] */ + x_0[ch][0] = &signal_outFB_tmp[ch][0]; + x_0[ch][1] = &signal_outFB_tmp[ch][0] + L_FRAME48k / 2; +#else set_zero( x_0_buf[ch], N_MAX ); x_0[ch][0] = &x_0_buf[ch][0]; x_0[ch][1] = &x_0_buf[ch][0] + L_FRAME48k / 2; +#endif nTnsBitsTCX10[ch][0] = 0; nTnsBitsTCX10[ch][1] = 0; @@ -355,6 +364,15 @@ void stereo_mdct_core_dec( apply_dmx_weights( hCPE, x, sts[0]->transform_type, sts[1]->transform_type ); } +#ifdef FIX_1320_STACK_CPE_DECODERaa + mvr2r( signal_out_tmp[0], signal_out[0], L_FRAME48k ); + mvr2r( signal_out_tmp[1], signal_out[1], L_FRAME48k ); + + ivas_mdct_core_reconstruct( hCPE, x, signal_outFB_tmp, fUseTns, 0 ); + + mvr2r( signal_outFB_tmp[0], signal_outFB[0], hCPE->hCoreCoder[0]->hTcxDec->L_frameTCX ); + mvr2r( signal_outFB_tmp[1], signal_outFB[1], hCPE->hCoreCoder[1]->hTcxDec->L_frameTCX ); +#else ivas_mdct_core_reconstruct( hCPE, x, signal_outFB_tmp, fUseTns, 0 ); mvr2r( signal_out_tmp[0], signal_out[0], L_FRAME48k ); @@ -362,6 +380,7 @@ void stereo_mdct_core_dec( mvr2r( signal_outFB_tmp[0], signal_outFB[0], hCPE->hCoreCoder[0]->hTcxDec->L_frameTCX ); mvr2r( signal_outFB_tmp[1], signal_outFB[1], hCPE->hCoreCoder[1]->hTcxDec->L_frameTCX ); +#endif pop_wmops(); return; -- GitLab From 7cd84ef1fefebe4163c57edaddda65b54d6de3ce Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 1 May 2025 10:34:01 +0200 Subject: [PATCH 3/3] fix also to stereo TCX decoder --- lib_com/cnst.h | 3 +++ lib_dec/dec_LPD.c | 8 ++++++++ lib_dec/ivas_mdct_core_dec.c | 4 ++-- lib_dec/ivas_stereo_mdct_core_dec.c | 10 ---------- lib_dec/ivas_tcx_core_dec.c | 8 ++++++++ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 2108ab81c6..ebb363e692 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -524,6 +524,9 @@ enum #define ACELP_TCX_TRANS_NS 1250000 /* Duration of the ACELP->TCX overlap - 1.25 ms */ #define L_FRAME_MAX L_FRAME48k /* Max 20ms frame size @48kHz */ #define L_FRAME_PLUS 1200 /* Max frame size (long TCX frame) */ +#ifdef FIX_1320_STACK_CPE_DECODER +#define L_FRAME_PLUS_INTERNAL 800 /* Max frame size (long TCX frame) at maximum internal sampling rate */ +#endif #define L_MDCT_OVLP_MAX NS2SA( 48000, ACELP_LOOK_NS ) /* = Max mdct overlap */ #define N_TCX10_MAX 480 /* Max size of TCX10 MDCT spectrum */ #define BITS_TEC 1 /* number of bits for TEC */ diff --git a/lib_dec/dec_LPD.c b/lib_dec/dec_LPD.c index 89597cae4a..bf4aab5e31 100644 --- a/lib_dec/dec_LPD.c +++ b/lib_dec/dec_LPD.c @@ -71,7 +71,11 @@ void decoder_LPD( { int16_t *prm; int16_t param_lpc[NPRM_LPC_NEW]; +#ifdef FIX_1320_STACK_CPE_DECODER + float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; +#else float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; +#endif float *synth; float synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; float *synthFB; @@ -124,7 +128,11 @@ void decoder_LPD( synthFB = synth_bufFB + st->hTcxDec->old_synth_lenFB; mvr2r( st->hTcxDec->old_synth, synth_buf, st->hTcxDec->old_synth_len ); mvr2r( st->hTcxDec->old_synthFB, synth_bufFB, st->hTcxDec->old_synth_lenFB ); +#ifdef FIX_1320_STACK_CPE_DECODER + set_zero( synth, L_FRAME_PLUS_INTERNAL + M ); +#else set_zero( synth, L_FRAME_PLUS + M ); +#endif set_zero( synthFB, L_FRAME_PLUS + M ); diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 581374ac74..29ca975ee0 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -805,7 +805,7 @@ void ivas_mdct_core_reconstruct( int16_t L_frame_global[CPE_CHANNELS], L_frame_globalTCX[CPE_CHANNELS]; /* Synth */ #ifdef FIX_1320_STACK_CPE_DECODER - float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME32k + L_FRAME32k / 4 + M]; + float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; #else float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; #endif @@ -846,7 +846,7 @@ void ivas_mdct_core_reconstruct( mvr2r( st->hTcxDec->old_synth, synth_buf, st->hTcxDec->old_synth_len ); mvr2r( st->hTcxDec->old_synthFB, synth_bufFB, st->hTcxDec->old_synth_lenFB ); #ifdef FIX_1320_STACK_CPE_DECODER - set_zero( synth, L_FRAME32k + L_FRAME32k / 4 + M ); + set_zero( synth, L_FRAME_PLUS_INTERNAL + M ); #else set_zero( synth, L_FRAME_PLUS + M ); #endif diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index a70e62ea2e..5a3c4f8a7c 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -364,15 +364,6 @@ void stereo_mdct_core_dec( apply_dmx_weights( hCPE, x, sts[0]->transform_type, sts[1]->transform_type ); } -#ifdef FIX_1320_STACK_CPE_DECODERaa - mvr2r( signal_out_tmp[0], signal_out[0], L_FRAME48k ); - mvr2r( signal_out_tmp[1], signal_out[1], L_FRAME48k ); - - ivas_mdct_core_reconstruct( hCPE, x, signal_outFB_tmp, fUseTns, 0 ); - - mvr2r( signal_outFB_tmp[0], signal_outFB[0], hCPE->hCoreCoder[0]->hTcxDec->L_frameTCX ); - mvr2r( signal_outFB_tmp[1], signal_outFB[1], hCPE->hCoreCoder[1]->hTcxDec->L_frameTCX ); -#else ivas_mdct_core_reconstruct( hCPE, x, signal_outFB_tmp, fUseTns, 0 ); mvr2r( signal_out_tmp[0], signal_out[0], L_FRAME48k ); @@ -380,7 +371,6 @@ void stereo_mdct_core_dec( mvr2r( signal_outFB_tmp[0], signal_outFB[0], hCPE->hCoreCoder[0]->hTcxDec->L_frameTCX ); mvr2r( signal_outFB_tmp[1], signal_outFB[1], hCPE->hCoreCoder[1]->hTcxDec->L_frameTCX ); -#endif pop_wmops(); return; diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index 85e79e8b7d..4133af03ea 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -179,7 +179,11 @@ void stereo_tcx_core_dec( Word16 Aind[M + 1], lspind[M]; /*Synth*/ +#ifdef FIX_1320_STACK_CPE_DECODER + float synth_buf[OLD_SYNTH_INTERNAL_DEC + L_FRAME_PLUS_INTERNAL + M]; +#else float synth_buf[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; +#endif float *synth; float synth_bufFB[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; float *synthFB; @@ -246,7 +250,11 @@ void stereo_tcx_core_dec( synthFB = synth_bufFB + hTcxDec->old_synth_lenFB; mvr2r( hTcxDec->old_synth, synth_buf, hTcxDec->old_synth_len ); mvr2r( hTcxDec->old_synthFB, synth_bufFB, hTcxDec->old_synth_lenFB ); +#ifdef FIX_1320_STACK_CPE_DECODER + set_zero( synth, L_FRAME_PLUS_INTERNAL + M ); +#else set_zero( synth, L_FRAME_PLUS + M ); +#endif set_zero( synthFB, L_FRAME_PLUS + M ); #ifdef DEBUG_MODE_INFO_PLC -- GitLab