diff celp_filters.c @ 8091:4c95f44c4c23 libavcodec

Add a LPC filter Part of the QCELP patch by Kenan Gillet, kenan.gillet gmail com
author vitor
date Thu, 30 Oct 2008 21:05:37 +0000
parents 611a21e4b01b
children 1e2c96617886
line wrap: on
line diff
--- a/celp_filters.c	Thu Oct 30 21:04:17 2008 +0000
+++ b/celp_filters.c	Thu Oct 30 21:05:37 2008 +0000
@@ -84,3 +84,24 @@
 
     return 0;
 }
+
+void ff_celp_lp_synthesis_filterf(
+        float *out,
+        const float* filter_coeffs,
+        const float* in,
+        int buffer_length,
+        int filter_length)
+{
+    int i,n;
+
+    // These two lines are to avoid a -1 subtraction in the main loop
+    filter_length++;
+    filter_coeffs--;
+
+    for(n=0; n<buffer_length; n++)
+    {
+        out[n] = in[n];
+        for(i=1; i<filter_length; i++)
+            out[n] += filter_coeffs[i] * out[n-i];
+    }
+}