[x265] [PATCH] asm code for asm code for blockcopy_ps, 16x8, 16x12, 16x16, 16x32

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Nov 11 11:59:54 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384167584 -19800
# Node ID 859aa956515ccc0b1717edaed67c7e8f59f915fc
# Parent  b688888f1f127c7a08a32c50d965218d50d3eeba
asm code for asm code for blockcopy_ps,16x8, 16x12, 16x16, 16x32

diff -r b688888f1f12 -r 859aa956515c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Nov 11 16:00:59 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 11 16:29:44 2013 +0530
@@ -368,7 +368,10 @@
         p.blockfill_s[BLOCK_32x32] = x265_blockfill_s_32x32_sse2;
 
         p.chroma_copy_ps[CHROMA_16x4] = x265_blockcopy_ps_16x4_sse2;
-
+        p.chroma_copy_ps[CHROMA_16x8] = x265_blockcopy_ps_16x8_sse2;
+        p.chroma_copy_ps[CHROMA_16x12] = x265_blockcopy_ps_16x12_sse2;
+        p.chroma_copy_ps[CHROMA_16x16] = x265_blockcopy_ps_16x16_sse2;
+        p.chroma_copy_ps[CHROMA_16x32] = x265_blockcopy_ps_16x32_sse2;
 #if X86_64
         p.satd[LUMA_8x32] = x265_pixel_satd_8x32_sse2;
         p.satd[LUMA_16x4] = x265_pixel_satd_16x4_sse2;
diff -r b688888f1f12 -r 859aa956515c source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Mon Nov 11 16:00:59 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Mon Nov 11 16:29:44 2013 +0530
@@ -1824,3 +1824,56 @@
 movu       [r0 + r1 + 16],     m1
 
 RET
+
+;-----------------------------------------------------------------------------
+; void blockcopy_ps_%1x%2(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
+;-----------------------------------------------------------------------------
+%macro BLOCKCOPY_PS_W16_H4 2
+INIT_XMM sse2
+cglobal blockcopy_ps_%1x%2, 4, 5, 3, dest, destStride, src, srcStride
+
+add        r1,      r1
+mov        r4d,     %2/4
+pxor       m0,      m0
+
+.loop
+      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
+
+      lea        r0,                 [r0 + 2 * r1]
+      lea        r2,                 [r2 + 2 * r3]
+
+      dec        r4d
+      jnz        .loop
+
+RET
+%endmacro
+
+BLOCKCOPY_PS_W16_H4 16,  8
+BLOCKCOPY_PS_W16_H4 16, 12
+BLOCKCOPY_PS_W16_H4 16, 16
+BLOCKCOPY_PS_W16_H4 16, 32
diff -r b688888f1f12 -r 859aa956515c source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Mon Nov 11 16:00:59 2013 +0530
+++ b/source/common/x86/blockcopy8.h	Mon Nov 11 16:29:44 2013 +0530
@@ -113,6 +113,10 @@
 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);
+void x265_blockcopy_ps_16x8_sse2(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
+void x265_blockcopy_ps_16x12_sse2(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
+void x265_blockcopy_ps_16x16_sse2(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
+void x265_blockcopy_ps_16x32_sse2(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
 
 #undef SETUP_CHROMA_BLOCKCOPY_FUNC
 #undef SETUP_LUMA_BLOCK_FUNC


More information about the x265-devel mailing list