]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/celp_filters.c
DCA: ARM/NEON optimised lfe_fir
[ffmpeg] / libavcodec / celp_filters.c
index 7f23acae00605a656a60ca9820891cde338eb635..26a62eed14f99aee49e44e4574aed54ea70ee5c4 100644 (file)
 #include "avcodec.h"
 #include "celp_filters.h"
 
-void ff_celp_convolve_circ(int16_t* fc_out,
-                           const int16_t* fc_in,
-                           const int16_t* filter,
-                           int len)
+void ff_celp_convolve_circ(int16_t* fc_out, const int16_t* fc_in,
+                           const int16_t* filter, int len)
 {
     int i, k;
 
@@ -57,12 +55,9 @@ void ff_celp_circ_addf(float *out, const float *in,
         out[k] = in[k] + fac * lagged[    k - lag];
 }
 
-int ff_celp_lp_synthesis_filter(int16_t *out,
-                                const int16_t* filter_coeffs,
-                                const int16_t* in,
-                                int buffer_length,
-                                int filter_length,
-                                int stop_on_overflow,
+int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
+                                const int16_t *in, int buffer_length,
+                                int filter_length, int stop_on_overflow,
                                 int rounder)
 {
     int i,n;
@@ -85,14 +80,19 @@ int ff_celp_lp_synthesis_filter(int16_t *out,
     return 0;
 }
 
-void ff_celp_lp_synthesis_filterf(float *out,
-                                  const float* filter_coeffs,
-                                  const float* in,
-                                  int buffer_length,
+void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
+                                  const float* in, int buffer_length,
                                   int filter_length)
 {
     int i,n;
 
+#if 0 // Unoptimized code path for improved readability
+    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];
+    }
+#else
     float out0, out1, out2, out3;
     float old_out0, old_out1, old_out2, old_out3;
     float a,b,c;
@@ -193,12 +193,11 @@ void ff_celp_lp_synthesis_filterf(float *out,
         for (i = 1; i <= filter_length; i++)
             out[n] -= filter_coeffs[i-1] * out[n-i];
     }
+#endif
 }
 
-void ff_celp_lp_zero_synthesis_filterf(float *out,
-                                       const float* filter_coeffs,
-                                       const float* in,
-                                       int buffer_length,
+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;