aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/ppc/float_dsp_altivec.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-01-19 22:26:58 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2013-01-22 11:55:42 -0800
commit55aa03b9f8f11ebb7535424cc0e5635558590f49 (patch)
treee13b12d715aa32cb1d81ed066735af40ea6dbb8a /libavutil/ppc/float_dsp_altivec.c
parent0881cbf314982cce8448bd12644ce2a6e0b8c576 (diff)
downloadffmpeg-55aa03b9f8f11ebb7535424cc0e5635558590f49.tar.gz
floatdsp: move vector_fmul_add from dsputil to avfloatdsp.
Diffstat (limited to 'libavutil/ppc/float_dsp_altivec.c')
-rw-r--r--libavutil/ppc/float_dsp_altivec.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavutil/ppc/float_dsp_altivec.c b/libavutil/ppc/float_dsp_altivec.c
index e5fd9aba33..87379e92f8 100644
--- a/libavutil/ppc/float_dsp_altivec.c
+++ b/libavutil/ppc/float_dsp_altivec.c
@@ -69,3 +69,27 @@ void ff_vector_fmul_window_altivec(float *dst, const float *src0,
vec_st(t1, j, dst);
}
}
+
+void ff_vector_fmul_add_altivec(float *dst, const float *src0,
+ const float *src1, const float *src2,
+ int len)
+{
+ int i;
+ vector float d, s0, s1, s2, t0, t1, edges;
+ vector unsigned char align = vec_lvsr(0,dst),
+ mask = vec_lvsl(0, dst);
+
+ for (i = 0; i < len - 3; i += 4) {
+ t0 = vec_ld(0, dst + i);
+ t1 = vec_ld(15, dst + i);
+ s0 = vec_ld(0, src0 + i);
+ s1 = vec_ld(0, src1 + i);
+ s2 = vec_ld(0, src2 + i);
+ edges = vec_perm(t1, t0, mask);
+ d = vec_madd(s0, s1, s2);
+ t1 = vec_perm(d, edges, align);
+ t0 = vec_perm(edges, d, align);
+ vec_st(t1, 15, dst + i);
+ vec_st(t0, 0, dst + i);
+ }
+}