shithub: opus

Download patch

ref: f54a0a39e5031713a778e003fdd4c74e560f7d92
parent: 5f3d1afc059fa22005e12fe01b9e67d745bf1e31
author: Jean-Marc Valin <[email protected]>
date: Fri May 13 13:36:31 EDT 2011

Reduces the PLC array sizes to what's necessary

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -2124,13 +2124,14 @@
    if (plc)
    {
       c=0; do {
-         /* FIXME: This is more memory than necessary */
-         celt_word32 e[2*MAX_PERIOD];
-         celt_word16 exc[2*MAX_PERIOD];
+         VARDECL(celt_word32, e);
+         celt_word16 exc[MAX_PERIOD];
          celt_word32 ac[LPC_ORDER+1];
          celt_word16 decay = 1;
          celt_word32 S1=0;
          celt_word16 mem[LPC_ORDER]={0};
+
+         ALLOC(e, MAX_PERIOD+2*st->mode->overlap, celt_word32);
 
          offset = MAX_PERIOD-pitch_index;
          for (i=0;i<MAX_PERIOD;i++)