diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-01-19 22:26:58 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2013-01-22 11:55:42 -0800 |
commit | 55aa03b9f8f11ebb7535424cc0e5635558590f49 (patch) | |
tree | e13b12d715aa32cb1d81ed066735af40ea6dbb8a /libavutil/ppc | |
parent | 0881cbf314982cce8448bd12644ce2a6e0b8c576 (diff) | |
download | ffmpeg-streaming-55aa03b9f8f11ebb7535424cc0e5635558590f49.zip ffmpeg-streaming-55aa03b9f8f11ebb7535424cc0e5635558590f49.tar.gz |
floatdsp: move vector_fmul_add from dsputil to avfloatdsp.
Diffstat (limited to 'libavutil/ppc')
-rw-r--r-- | libavutil/ppc/float_dsp_altivec.c | 24 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_altivec.h | 4 | ||||
-rw-r--r-- | libavutil/ppc/float_dsp_init.c | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/libavutil/ppc/float_dsp_altivec.c b/libavutil/ppc/float_dsp_altivec.c index e5fd9ab..87379e9 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); + } +} diff --git a/libavutil/ppc/float_dsp_altivec.h b/libavutil/ppc/float_dsp_altivec.h index 4d46edf..38a9e15 100644 --- a/libavutil/ppc/float_dsp_altivec.h +++ b/libavutil/ppc/float_dsp_altivec.h @@ -28,4 +28,8 @@ extern void ff_vector_fmul_window_altivec(float *dst, const float *src0, const float *src1, const float *win, int len); +extern void ff_vector_fmul_add_altivec(float *dst, const float *src0, + const float *src1, const float *src2, + int len); + #endif /* AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H */ diff --git a/libavutil/ppc/float_dsp_init.c b/libavutil/ppc/float_dsp_init.c index 1134b56..f3d8a42 100644 --- a/libavutil/ppc/float_dsp_init.c +++ b/libavutil/ppc/float_dsp_init.c @@ -32,6 +32,7 @@ void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact) return; fdsp->vector_fmul = ff_vector_fmul_altivec; + fdsp->vector_fmul_add = ff_vector_fmul_add_altivec; if (!bit_exact) { fdsp->vector_fmul_window = ff_vector_fmul_window_altivec; |