]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/celp_filters.c
Export av_strtod() to eval.h.
[ffmpeg] / libavcodec / celp_filters.c
index 758c9b0a90a35f7940dde0ffb813d7dcd297294d..b2094a164a66d885bdf1098e0a3bb71a3597887c 100644 (file)
@@ -61,15 +61,14 @@ int ff_celp_lp_synthesis_filter(
 {
     int i,n;
 
-    // These two lines are to avoid a -1 subtraction in the main loop
+    // Avoids a +1 in the inner loop.
     filter_length++;
-    filter_coeffs--;
 
     for(n=0; n<buffer_length; n++)
     {
         int sum = rounder;
         for(i=1; i<filter_length; i++)
-            sum -= filter_coeffs[i] * out[n-i];
+            sum -= filter_coeffs[i-1] * out[n-i];
 
         sum = (sum >> 12) + in[n];
 
@@ -84,3 +83,43 @@ int ff_celp_lp_synthesis_filter(
 
     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;
+
+    // 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] * 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];
+    }
+}