diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-01-20 15:41:52 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2013-01-22 11:55:42 -0800 |
commit | d56668bd80075615b89aff652fe8a576bf853ceb (patch) | |
tree | 9da3ed036b716dbaf33f5c9869578bedb6e393a2 /libavutil/float_dsp.c | |
parent | 5959bfaca396ecaf63a8123055f499688b79cae3 (diff) | |
download | ffmpeg-d56668bd80075615b89aff652fe8a576bf853ceb.tar.gz |
floatdsp: move scalarproduct_float from dsputil to avfloatdsp.
This makes the aac decoder and all voice codecs independent of dsputil.
Diffstat (limited to 'libavutil/float_dsp.c')
-rw-r--r-- | libavutil/float_dsp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c index c6e2b41d66..a40b029a29 100644 --- a/libavutil/float_dsp.c +++ b/libavutil/float_dsp.c @@ -101,6 +101,17 @@ static void butterflies_float_c(float *restrict v1, float *restrict v2, } } +float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len) +{ + float p = 0.0; + int i; + + for (i = 0; i < len; i++) + p += v1[i] * v2[i]; + + return p; +} + void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) { fdsp->vector_fmul = vector_fmul_c; @@ -111,6 +122,7 @@ void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact) fdsp->vector_fmul_add = vector_fmul_add_c; fdsp->vector_fmul_reverse = vector_fmul_reverse_c; fdsp->butterflies_float = butterflies_float_c; + fdsp->scalarproduct_float = avpriv_scalarproduct_float_c; #if ARCH_ARM ff_float_dsp_init_arm(fdsp); |