summaryrefslogtreecommitdiff
path: root/libavcodec/celp_filters.c
diff options
context:
space:
mode:
authorColin McQuillan <m.niloc@googlemail.com>2009-08-12 19:54:28 +0000
committerRobert Swain <robert.swain@gmail.com>2009-08-12 19:54:28 +0000
commitd4d6ae16033097462c8336868eb4acfa617acd6c (patch)
tree48060d235aebc1afe921c636182b6aafe1deb2aa /libavcodec/celp_filters.c
parent51fdb6f08d3e18d052f2be630ad7ec160d4247ec (diff)
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 ) Originally committed as revision 19634 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/celp_filters.c')
-rw-r--r--libavcodec/celp_filters.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c
index cd475533a5..d54e2fa709 100644
--- a/libavcodec/celp_filters.c
+++ b/libavcodec/celp_filters.c
@@ -47,6 +47,16 @@ void ff_celp_convolve_circ(int16_t* fc_out,
}
}
+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,