Index: silk/decode_core.c |
diff --git a/silk/decode_core.c b/silk/decode_core.c |
index 2142dd4b1b7a53efe30e698e6062a62493a08793..0365ffdfaa431f18d050b3c553540269867c804e 100644 |
--- a/silk/decode_core.c |
+++ b/silk/decode_core.c |
@@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. |
#endif |
#include "main.h" |
+#include "stack_alloc.h" |
/**********************************************************/ |
/* Core decoder. Performs inverse NSQ operation LTP + LPC */ |
@@ -43,15 +44,21 @@ void silk_decode_core( |
{ |
opus_int i, k, lag = 0, start_idx, sLTP_buf_idx, NLSF_interpolation_flag, signalType; |
opus_int16 *A_Q12, *B_Q14, *pxq, A_Q12_tmp[ MAX_LPC_ORDER ]; |
- opus_int16 sLTP[ MAX_FRAME_LENGTH ]; |
- opus_int32 sLTP_Q15[ 2 * MAX_FRAME_LENGTH ]; |
+ VARDECL( opus_int16, sLTP ); |
+ VARDECL( opus_int32, sLTP_Q15 ); |
opus_int32 LTP_pred_Q13, LPC_pred_Q10, Gain_Q10, inv_gain_Q31, gain_adj_Q16, rand_seed, offset_Q10; |
opus_int32 *pred_lag_ptr, *pexc_Q14, *pres_Q14; |
- opus_int32 res_Q14[ MAX_SUB_FRAME_LENGTH ]; |
- opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + MAX_LPC_ORDER ]; |
+ VARDECL( opus_int32, res_Q14 ); |
+ VARDECL( opus_int32, sLPC_Q14 ); |
+ SAVE_STACK; |
silk_assert( psDec->prev_gain_Q16 != 0 ); |
+ ALLOC( sLTP, psDec->ltp_mem_length, opus_int16 ); |
+ ALLOC( sLTP_Q15, psDec->ltp_mem_length + psDec->frame_length, opus_int32 ); |
+ ALLOC( res_Q14, psDec->subfr_length, opus_int32 ); |
+ ALLOC( sLPC_Q14, psDec->subfr_length + MAX_LPC_ORDER, opus_int32 ); |
+ |
offset_Q10 = silk_Quantization_Offsets_Q10[ psDec->indices.signalType >> 1 ][ psDec->indices.quantOffsetType ]; |
if( psDec->indices.NLSFInterpCoef_Q2 < 1 << 2 ) { |
@@ -227,4 +234,5 @@ void silk_decode_core( |
/* Save LPC state */ |
silk_memcpy( psDec->sLPC_Q14_buf, sLPC_Q14, MAX_LPC_ORDER * sizeof( opus_int32 ) ); |
+ RESTORE_STACK; |
} |