[xiph-commits] r12068 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Thu Nov 9 03:58:45 PST 2006


Author: jm
Date: 2006-11-09 03:58:42 -0800 (Thu, 09 Nov 2006)
New Revision: 12068

Modified:
   trunk/speex/libspeex/mdf.c
Log:
a bit of cleaning up and comments


Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2006-11-08 22:19:29 UTC (rev 12067)
+++ trunk/speex/libspeex/mdf.c	2006-11-09 11:58:42 UTC (rev 12068)
@@ -521,8 +521,8 @@
    ss_1 = 1-ss;
 #endif
 
-   filter_dc_notch16(in, st->notch_radius, st->d, st->frame_size, st->notch_mem);
-   /* Copy input data to buffer */
+   filter_dc_notch16(in, st->notch_radius, st->d+st->frame_size, st->frame_size, st->notch_mem);
+   /* Copy input data to buffer and apply pre-emphasis */
    for (i=0;i<st->frame_size;i++)
    {
       spx_word16_t tmp;
@@ -545,9 +545,7 @@
       st->x[i+st->frame_size] = EXTRACT16(tmp32);
       st->memX = far_end[i];
       
-      tmp = st->d[i];
-      st->d[i] = st->d[i+st->frame_size];
-      tmp32 = SUB32(EXTEND32(tmp), EXTEND32(MULT16_16_P15(st->preemph, st->memD)));
+      tmp32 = SUB32(EXTEND32(st->d[i+st->frame_size]), EXTEND32(MULT16_16_P15(st->preemph, st->memD)));
 #ifdef FIXED_POINT
       if (tmp32 > 32767)
       {
@@ -560,8 +558,8 @@
          st->saturated = 1;
       }
 #endif
+      st->memD = st->d[i+st->frame_size];
       st->d[i+st->frame_size] = tmp32;
-      st->memD = tmp;
    }
 
    /* Shift memory: this could be optimized eventually*/
@@ -822,6 +820,7 @@
       st->sum_adapt = ADD32(st->sum_adapt,adapt_rate);
    }
 
+   /* Save residual echo so it can be used by the nonlinear processor */
    if (st->adapted)
    {
       /* If the filter is adapted, take the filtered echo */



More information about the commits mailing list