[x264-devel] ppc: AltiVec plane_copy_interleave
Alexandra Hájková
git at videolan.org
Thu Dec 1 21:01:46 CET 2016
x264 | branch: master | Alexandra Hájková <alexandra at khirnov.net> | Mon Nov 28 10:51:54 2016 +0000| [ea1fee272b20e1bcff2a862ea9a29e151c9136a9] | committer: Henrik Gramner
ppc: AltiVec plane_copy_interleave
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=ea1fee272b20e1bcff2a862ea9a29e151c9136a9
---
common/ppc/mc.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/common/ppc/mc.c b/common/ppc/mc.c
index e9dcb10..5c92b10 100644
--- a/common/ppc/mc.c
+++ b/common/ppc/mc.c
@@ -168,6 +168,23 @@ void x264_plane_copy_swap_core_altivec( uint8_t *dst, intptr_t i_dst,
}
}
+void x264_plane_copy_interleave_core_altivec( uint8_t *dst, intptr_t i_dst,
+ uint8_t *srcu, intptr_t i_srcu,
+ uint8_t *srcv, intptr_t i_srcv, int w, int h )
+{
+ for( int y = 0; y < h; y++, dst += i_dst, srcu += i_srcu, srcv += i_srcv )
+ for( int x = 0; x < w; x += 16 )
+ {
+ vec_u8_t srcvv = vec_vsx_ld( x, srcv );
+ vec_u8_t srcuv = vec_vsx_ld( x, srcu );
+ vec_u8_t dstv1 = vec_mergeh( srcuv, srcvv );
+ vec_u8_t dstv2 = vec_mergel( srcuv, srcvv );
+
+ vec_vsx_st( dstv1, 2 * x, dst );
+ vec_vsx_st( dstv2, 2 * x + 16, dst );
+ }
+}
+
static void mc_luma_altivec( uint8_t *dst, intptr_t i_dst_stride,
uint8_t *src[4], intptr_t i_src_stride,
int mvx, int mvy,
@@ -1183,6 +1200,7 @@ static weight_fn_t x264_mc_weight_wtab_altivec[6] =
#endif // !HIGH_BIT_DEPTH
PLANE_COPY_SWAP(16, altivec)
+PLANE_INTERLEAVE(altivec)
void x264_mc_altivec_init( x264_mc_functions_t *pf )
{
@@ -1200,5 +1218,6 @@ void x264_mc_altivec_init( x264_mc_functions_t *pf )
pf->weight = x264_mc_weight_wtab_altivec;
pf->plane_copy_swap = x264_plane_copy_swap_altivec;
+ pf->plane_copy_interleave = x264_plane_copy_interleave_altivec;
#endif // !HIGH_BIT_DEPTH
}
More information about the x264-devel
mailing list