aboutsummaryrefslogtreecommitdiff
path: root/silk/decode_frame.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2014-01-07 15:27:02 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2014-01-07 15:27:02 -0500
commite17ca25617009ce0ec7701c08bdb0e367da94ca0 (patch)
tree77b97422ea86281fb02f0efdee828679e2eae811 /silk/decode_frame.c
parentb63e7110cb72f48c1319e8848ccf670bcfbe4f63 (diff)
downloadlibopus-e17ca25617009ce0ec7701c08bdb0e367da94ca0.tar.gz
Don't allocate pulses on the stack when calling the SILK PLC.
Also minor C89 fix for the previous commit
Diffstat (limited to 'silk/decode_frame.c')
-rw-r--r--silk/decode_frame.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/silk/decode_frame.c b/silk/decode_frame.c
index 1d98267f..37459a32 100644
--- a/silk/decode_frame.c
+++ b/silk/decode_frame.c
@@ -47,13 +47,10 @@ opus_int silk_decode_frame(
{
VARDECL( silk_decoder_control, psDecCtrl );
opus_int L, mv_len, ret = 0;
- VARDECL( opus_int16, pulses );
SAVE_STACK;
L = psDec->frame_length;
ALLOC( psDecCtrl, 1, silk_decoder_control );
- ALLOC( pulses, (L + SHELL_CODEC_FRAME_LENGTH - 1) &
- ~(SHELL_CODEC_FRAME_LENGTH - 1), opus_int16 );
psDecCtrl->LTP_scale_Q14 = 0;
/* Safety checks */
@@ -62,6 +59,9 @@ opus_int silk_decode_frame(
if( lostFlag == FLAG_DECODE_NORMAL ||
( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) )
{
+ VARDECL( opus_int16, pulses );
+ ALLOC( pulses, (L + SHELL_CODEC_FRAME_LENGTH - 1) &
+ ~(SHELL_CODEC_FRAME_LENGTH - 1), opus_int16 );
/*********************************************/
/* Decode quantization indices of side info */
/*********************************************/