[x265] [PATCH] asm code for blockcopy_ps_16x4

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Nov 11 11:31:09 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384165859 -19800
# Node ID b688888f1f127c7a08a32c50d965218d50d3eeba
# Parent  6da0a0291ed8d10dc3dfdb3df396cd1a8c74ceeb
asm code for blockcopy_ps_16x4

diff -r 6da0a0291ed8 -r b688888f1f12 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Nov 11 14:58:09 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 11 16:00:59 2013 +0530
@@ -367,6 +367,8 @@
         p.blockfill_s[BLOCK_16x16] = x265_blockfill_s_16x16_sse2;
         p.blockfill_s[BLOCK_32x32] = x265_blockfill_s_32x32_sse2;
 
+        p.chroma_copy_ps[CHROMA_16x4] = x265_blockcopy_ps_16x4_sse2;
+
 #if X86_64
         p.satd[LUMA_8x32] = x265_pixel_satd_8x32_sse2;
         p.satd[LUMA_16x4] = x265_pixel_satd_16x4_sse2;
diff -r 6da0a0291ed8 -r b688888f1f12 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Mon Nov 11 14:58:09 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Mon Nov 11 16:00:59 2013 +0530
@@ -1786,3 +1786,41 @@
 BLOCKCOPY_PS_W8_H4  8,  8
 BLOCKCOPY_PS_W8_H4  8, 16
 BLOCKCOPY_PS_W8_H4  8, 32
+
+;-----------------------------------------------------------------------------
+; void blockcopy_ps_16x4(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
+;-----------------------------------------------------------------------------
+INIT_XMM sse2
+cglobal blockcopy_ps_16x4, 4, 4, 3, dest, destStride, src, srcStride
+
+add        r1,      r1
+pxor       m0,      m0
+
+movu       m1,                 [r2]
+punpcklbw  m2,                 m1,            m0
+movu       [r0],               m2
+punpckhbw  m1,                 m0
+movu       [r0 + 16],          m1
+
+movu       m1,                 [r2 + r3]
+punpcklbw  m2,                 m1,            m0
+movu       [r0 + r1],          m2
+punpckhbw  m1,                 m0
+movu       [r0 + r1 + 16],     m1
+
+movu       m1,                 [r2 + 2 * r3]
+punpcklbw  m2,                 m1,            m0
+movu       [r0 + 2 * r1],      m2
+punpckhbw  m1,                 m0
+movu       [r0 + 2 * r1 + 16], m1
+
+lea        r0,                 [r0 + 2 * r1]
+lea        r2,                 [r2 + 2 * r3]
+
+movu       m1,                 [r2 + r3]
+punpcklbw  m2,                 m1,            m0
+movu       [r0 + r1],          m2
+punpckhbw  m1,                 m0
+movu       [r0 + r1 + 16],     m1
+
+RET
diff -r 6da0a0291ed8 -r b688888f1f12 source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Mon Nov 11 14:58:09 2013 +0530
+++ b/source/common/x86/blockcopy8.h	Mon Nov 11 16:00:59 2013 +0530
@@ -112,6 +112,8 @@
 void x265_blockfill_s_16x16_sse2(int16_t *dst, intptr_t dstride, int16_t val);
 void x265_blockfill_s_32x32_sse2(int16_t *dst, intptr_t dstride, int16_t val);
 
+void x265_blockcopy_ps_16x4_sse2(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
+
 #undef SETUP_CHROMA_BLOCKCOPY_FUNC
 #undef SETUP_LUMA_BLOCK_FUNC
 #undef CHROMA_BLOCKCOPY_DEF


More information about the x265-devel mailing list