[x265] [PATCH] asm code for luma blockcopy_ps_48x64

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Nov 11 16:36:18 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384184171 -19800
# Node ID b83d45863ceb3f88da420646a3789fb787043f6e
# Parent  afbc2f56225c1fab5b53a8c51b979814162a638b
asm code for luma blockcopy_ps_48x64

diff -r afbc2f56225c -r b83d45863ceb source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Nov 11 20:55:03 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 11 21:06:11 2013 +0530
@@ -458,6 +458,7 @@
 
         p.luma_copy_ps[LUMA_16x64] = x265_blockcopy_ps_16x64_sse4;
         p.luma_copy_ps[LUMA_32x64] = x265_blockcopy_ps_32x64_sse4;
+        p.luma_copy_ps[LUMA_48x64] = x265_blockcopy_ps_48x64_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
     {
diff -r afbc2f56225c -r b83d45863ceb source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Mon Nov 11 20:55:03 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Mon Nov 11 21:06:11 2013 +0530
@@ -2227,3 +2227,62 @@
 BLOCKCOPY_PS_W32_H2 32, 24
 BLOCKCOPY_PS_W32_H2 32, 32
 BLOCKCOPY_PS_W32_H2 32, 64
+
+;-----------------------------------------------------------------------------
+; void blockcopy_ps_%1x%2(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
+;-----------------------------------------------------------------------------
+%macro BLOCKCOPY_PS_W48_H2 2
+INIT_XMM sse4
+cglobal blockcopy_ps_%1x%2, 4, 5, 3, dest, destStride, src, srcStride
+
+add        r1,      r1
+mov        r4d,     %2/2
+pxor       m0,      m0
+
+.loop
+      movu       m1,             [r2]
+      pmovzxbw   m2,             m1
+      movu       [r0],           m2
+      punpckhbw  m1,             m0
+      movu       [r0 + 16],      m1
+
+      movu       m1,             [r2 + 16]
+      pmovzxbw   m2,             m1
+      movu       [r0 + 32],      m2
+      punpckhbw  m1,             m0
+      movu       [r0 + 48],      m1
+
+      movu       m1,             [r2 + 32]
+      pmovzxbw   m2,             m1
+      movu       [r0 + 64],      m2
+      punpckhbw  m1,             m0
+      movu       [r0 + 80],      m1
+
+      movu       m1,             [r2 + r3]
+      pmovzxbw   m2,             m1
+      movu       [r0 + r1],      m2
+      punpckhbw  m1,             m0
+      movu       [r0 + r1 + 16], m1
+
+      movu       m1,             [r2 + r3 + 16]
+      pmovzxbw   m2,             m1
+      movu       [r0 + r1 + 32], m2
+      punpckhbw  m1,             m0
+      movu       [r0 + r1 + 48], m1
+
+      movu       m1,             [r2 + r3 + 32]
+      pmovzxbw   m2,             m1
+      movu       [r0 + r1 + 64], m2
+      punpckhbw  m1,             m0
+      movu       [r0 + r1 + 80], m1
+
+      lea        r0,             [r0 + 2 * r1]
+      lea        r2,             [r2 + 2 * r3]
+
+      dec        r4d
+      jnz        .loop
+
+RET
+%endmacro
+
+BLOCKCOPY_PS_W48_H2 48, 64
diff -r afbc2f56225c -r b83d45863ceb source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Mon Nov 11 20:55:03 2013 +0530
+++ b/source/common/x86/blockcopy8.h	Mon Nov 11 21:06:11 2013 +0530
@@ -124,7 +124,8 @@
 
 #define LUMA_BLOCKCOPY_DEF_SSE4(cpu) \
     SETUP_LUMA_BLOCKCOPY_FUNC_SSE4(16, 64, cpu); \
-    SETUP_LUMA_BLOCKCOPY_FUNC_SSE4(32, 64, cpu);
+    SETUP_LUMA_BLOCKCOPY_FUNC_SSE4(32, 64, cpu); \
+    SETUP_LUMA_BLOCKCOPY_FUNC_SSE4(48, 64, cpu);
 
 CHROMA_BLOCKCOPY_DEF_SSE4(_sse4);
 LUMA_BLOCKCOPY_DEF_SSE4(_sse4);


More information about the x265-devel mailing list