[xiph-cvs] cvs commit: speex/libspeex filters.c

Jean-Marc Valin jm at xiph.org
Sun Nov 30 12:23:31 PST 2003



jm          03/11/30 15:23:31

  Modified:    libspeex filters.c
  Log:
  fixed-point: comb filter, part II

Revision  Changes    Path
1.71      +10 -10    speex/libspeex/filters.c

Index: filters.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/filters.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- filters.c	30 Nov 2003 19:38:47 -0000	1.70
+++ filters.c	30 Nov 2003 20:23:30 -0000	1.71
@@ -486,16 +486,16 @@
    {
       fact += step;
 
-      new_exc[i] = exc[i] + GAIN_SCALING_1*comb_gain * fact * (
-                                         (float)pitch_gain[0]*exc[i-pitch+1] +
-                                         (float)pitch_gain[1]*exc[i-pitch] +
-                                         (float)pitch_gain[2]*exc[i-pitch-1]
-                                         )
-      + GAIN_SCALING_1*comb_gain * (1-fact) * (
-                                         (float)mem->last_pitch_gain[0]*exc[i-mem->last_pitch+1] +
-                                         (float)mem->last_pitch_gain[1]*exc[i-mem->last_pitch] +
-                                         (float)mem->last_pitch_gain[2]*exc[i-mem->last_pitch-1]
-                                         );
+      new_exc[i] = exc[i] + comb_gain * fact * SHL(
+                                         MULT16_32_Q15(SHL(pitch_gain[0],7),exc[i-pitch+1]) +
+                                         MULT16_32_Q15(SHL(pitch_gain[1],7),exc[i-pitch]) +
+                                         MULT16_32_Q15(SHL(pitch_gain[2],7),exc[i-pitch-1])
+                                         ,2)
+      + comb_gain * (1-fact) * SHL(
+                                         MULT16_32_Q15(SHL(mem->last_pitch_gain[0],7),exc[i-mem->last_pitch+1]) +
+                                         MULT16_32_Q15(SHL(mem->last_pitch_gain[1],7),exc[i-mem->last_pitch]) +
+                                         MULT16_32_Q15(SHL(mem->last_pitch_gain[2],7),exc[i-mem->last_pitch-1])
+                                         ,2);
    }
 
    mem->last_pitch_gain[0] = pitch_gain[0];

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list