aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/arm
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-01-20 15:41:52 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2013-01-22 11:55:42 -0800
commitd56668bd80075615b89aff652fe8a576bf853ceb (patch)
tree9da3ed036b716dbaf33f5c9869578bedb6e393a2 /libavutil/arm
parent5959bfaca396ecaf63a8123055f499688b79cae3 (diff)
downloadffmpeg-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/arm')
-rw-r--r--libavutil/arm/float_dsp_init_neon.c3
-rw-r--r--libavutil/arm/float_dsp_neon.S13
2 files changed, 16 insertions, 0 deletions
diff --git a/libavutil/arm/float_dsp_init_neon.c b/libavutil/arm/float_dsp_init_neon.c
index b3644e82a2..a7245ad92b 100644
--- a/libavutil/arm/float_dsp_init_neon.c
+++ b/libavutil/arm/float_dsp_init_neon.c
@@ -43,6 +43,8 @@ void ff_vector_fmul_reverse_neon(float *dst, const float *src0,
void ff_butterflies_float_neon(float *v1, float *v2, int len);
+float ff_scalarproduct_float_neon(const float *v1, const float *v2, int len);
+
void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp)
{
fdsp->vector_fmul = ff_vector_fmul_neon;
@@ -52,4 +54,5 @@ void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp)
fdsp->vector_fmul_add = ff_vector_fmul_add_neon;
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
fdsp->butterflies_float = ff_butterflies_float_neon;
+ fdsp->scalarproduct_float = ff_scalarproduct_float_neon;
}
diff --git a/libavutil/arm/float_dsp_neon.S b/libavutil/arm/float_dsp_neon.S
index 4acc406d33..559b565628 100644
--- a/libavutil/arm/float_dsp_neon.S
+++ b/libavutil/arm/float_dsp_neon.S
@@ -256,3 +256,16 @@ function ff_butterflies_float_neon, export=1
bgt 1b
bx lr
endfunc
+
+function ff_scalarproduct_float_neon, export=1
+ vmov.f32 q2, #0.0
+1: vld1.32 {q0},[r0,:128]!
+ vld1.32 {q1},[r1,:128]!
+ vmla.f32 q2, q0, q1
+ subs r2, r2, #4
+ bgt 1b
+ vadd.f32 d0, d4, d5
+ vpadd.f32 d0, d0, d0
+NOVFP vmov.32 r0, d0[0]
+ bx lr
+endfunc