Scaling up after pre-emphasis was *almost* a good idea...
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Mon, 9 Jan 2006 09:18:59 +0000 (09:18 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Mon, 9 Jan 2006 09:18:59 +0000 (09:18 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@10712 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/mdf.c

index 5b9058c..f5b65bc 100644 (file)
@@ -63,7 +63,6 @@
 
 #include "misc.h"
 #include "speex/speex_echo.h"
-#include "smallft.h"
 #include "fftwrap.h"
 #include "pseudofloat.h"
 #include "math_approx.h"
@@ -399,12 +398,12 @@ void speex_echo_cancel(SpeexEchoState *st, short *ref, short *echo, short *out,
    {
       spx_word16_t tmp;
       st->x[i] = st->x[i+st->frame_size];
-      st->x[i+st->frame_size] = SHL16(SUB16(echo[i], MULT16_16_P15(st->preemph, st->memX)),1);
+      st->x[i+st->frame_size] = SUB16(echo[i], MULT16_16_P15(st->preemph, st->memX));
       st->memX = echo[i];
       
       tmp = st->d[i];
       st->d[i] = st->d[i+st->frame_size];
-      st->d[i+st->frame_size] = SHL16(SUB16(tmp, MULT16_16_P15(st->preemph, st->memD)),1);
+      st->d[i+st->frame_size] = SUB16(tmp, MULT16_16_P15(st->preemph, st->memD));
       st->memD = tmp;
    }
 
@@ -436,7 +435,6 @@ void speex_echo_cancel(SpeexEchoState *st, short *ref, short *echo, short *out,
       tmp_out = SUB32(EXTEND32(st->d[i+st->frame_size]), EXTEND32(st->y[i+st->frame_size]));
 #endif
 
-      tmp_out = PSHR32(tmp_out,1);
       /* Saturation */
       if (tmp_out>32767)
          tmp_out = 32767;