diff celp_filters.c @ 10045:d35904b4fe3f libavcodec

Add ff_celp_circ_addf() function to be used for sparse vector circular convolution in the upcoming AMR-NB floating point decoder. The function scales and adds a vector, that is lagged by some offset, to another vector with the same number of elements. Patch by Colin McQuillan ( m.niloc googlemail com )
author superdump
date Wed, 12 Aug 2009 19:54:28 +0000
parents 454cb6aa43a3
children 8d536f190e6e
line wrap: on
line diff
--- a/celp_filters.c	Wed Aug 12 13:25:37 2009 +0000
+++ b/celp_filters.c	Wed Aug 12 19:54:28 2009 +0000
@@ -47,6 +47,16 @@
     }
 }
 
+void ff_celp_circ_addf(float *out, const float *in,
+                       const float *lagged, int lag, float fac, int n)
+{
+    int k;
+    for (k = 0; k < lag; k++)
+        out[k] = in[k] + fac * lagged[n + k - lag];
+    for (; k < n; k++)
+        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,