diff celp_filters.c @ 9509:2838045383c5 libavcodec

Add LP zero synthesis filter. Patch by Kenan Gillet.
author reynaldo
date Sat, 18 Apr 2009 22:53:37 +0000
parents d7554a5e3fd7
children 24952f1a8979
line wrap: on
line diff
--- a/celp_filters.c	Sat Apr 18 20:23:13 2009 +0000
+++ b/celp_filters.c	Sat Apr 18 22:53:37 2009 +0000
@@ -103,3 +103,23 @@
             out[n] -= filter_coeffs[i-1] * out[n-i];
     }
 }
+
+void ff_celp_lp_zero_synthesis_filterf(
+        float *out,
+        const float* filter_coeffs,
+        const float* in,
+        int buffer_length,
+        int filter_length)
+{
+    int i,n;
+
+    // Avoids a +1 in the inner loop.
+    filter_length++;
+
+    for(n=0; n<buffer_length; n++)
+    {
+        out[n] = in[n];
+        for(i=1; i<filter_length; i++)
+            out[n] -= filter_coeffs[i-1] * in[n-i];
+    }
+}