minor RAM tweak: delayed stack allocation to reduce max scratch memory use
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sat, 8 Apr 2006 15:35:07 +0000 (15:35 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sat, 8 Apr 2006 15:35:07 +0000 (15:35 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@11110 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/ltp.c

index aac97e0..ac9fdf9 100644 (file)
@@ -622,16 +622,17 @@ int plc_tuning
       return start;
    }
    
-   ALLOC(best_exc, nsf, spx_sig_t);
-   ALLOC(new_target, nsf, spx_sig_t);
-   ALLOC(best_target, nsf, spx_sig_t);
-   
    if (N>end-start+1)
       N=end-start+1;
    if (end != start)
       open_loop_nbest_pitch(sw, start, end, nsf, nbest, NULL, N, stack);
    else
       nbest[0] = start;
+   
+   ALLOC(best_exc, nsf, spx_sig_t);
+   ALLOC(new_target, nsf, spx_sig_t);
+   ALLOC(best_target, nsf, spx_sig_t);
+   
    for (i=0;i<N;i++)
    {
       pitch=nbest[i];