Subject: [codec] [PATCH] Remove a _overlap_mem only used for -DRESYNTH builds in celt.c.

From: Gregory Maxwell <[email-masked]>
Date: Fri, 29 Jul 2011 09:41:19 -0700

https://people.xiph.org/~greg/0001-Remove-a-_overlap_mem-only-used-for-DRESYNTH-builds-.patch

>From 911c2e17dba1f48b8ac8dc52cb918c52b1d779f8 Mon Sep 17 00:00:00 2001
From: Gregory Maxwell <[email-masked]>
Date: Fri, 29 Jul 2011 11:53:45 -0400
Subject: [PATCH] Remove a _overlap_mem only used for -DRESYNTH builds in
 celt.c.

---
 libcelt/celt.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libcelt/celt.c b/libcelt/celt.c
index 7419e17..c9b8b8b 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -921,7 +921,6 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
    VARDECL(int, fine_priority);
    VARDECL(int, tf_res);
    VARDECL(unsigned char, collapse_masks);
-   celt_sig *_overlap_mem;
    celt_sig *prefilter_mem;
    celt_word16 *oldBandE, *oldLogE, *oldLogE2;
    int shortBlocks=0;
@@ -968,8 +967,6 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
    N = M*st->mode->shortMdctSize;
 
    prefilter_mem = st->in_mem+CC*(st->overlap);
-   _overlap_mem = prefilter_mem+CC*COMBFILTER_MAXPERIOD;
-   /*_overlap_mem = st->in_mem+C*(st->overlap);*/
    oldBandE = (celt_word16*)(st->in_mem+CC*(2*st->overlap+COMBFILTER_MAXPERIOD));
    oldLogE = oldBandE + CC*st->mode->nbEBands;
    oldLogE2 = oldLogE + CC*st->mode->nbEBands;
@@ -1605,9 +1602,9 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
       if (CC==2)
          out_mem[1] = st->syn_mem[1]+MAX_PERIOD;
 
-      c=0; do
-         overlap_mem[c] = _overlap_mem + c*st->overlap;
-      while (++c<CC);
+      overlap_mem[0] = prefilter_mem+CC*COMBFILTER_MAXPERIOD;
+      if (CC==2)
+         overlap_mem[1] = overlap_mem[0] + st->overlap;
 
       compute_inv_mdcts(st->mode, shortBlocks, freq, out_mem, overlap_mem, CC, LM);
 
-- 
1.7.4.4