[x265] [PATCH] asm code for blockcopy_ps_24x32

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Nov 11 13:04:16 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384171446 -19800
# Node ID c377535d47574ae132835ecaedf342439d1df27f
# Parent  2614cd2c1f6262edf61b3b30434f0ef091871942
asm code for blockcopy_ps_24x32

diff -r 2614cd2c1f62 -r c377535d4757 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Nov 11 17:13:25 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 11 17:34:06 2013 +0530
@@ -466,6 +466,7 @@
         p.chroma_copy_ps[CHROMA_16x12] = x265_blockcopy_ps_16x12_sse4;
         p.chroma_copy_ps[CHROMA_16x16] = x265_blockcopy_ps_16x16_sse4;
         p.chroma_copy_ps[CHROMA_16x32] = x265_blockcopy_ps_16x32_sse4;
+        p.chroma_copy_ps[CHROMA_24x32] = x265_blockcopy_ps_24x32_sse4;
         p.chroma_copy_ps[CHROMA_32x8] = x265_blockcopy_ps_32x8_sse4;
         p.chroma_copy_ps[CHROMA_32x16] = x265_blockcopy_ps_32x16_sse4;
         p.chroma_copy_ps[CHROMA_32x24] = x265_blockcopy_ps_32x24_sse4;
diff -r 2614cd2c1f62 -r c377535d4757 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Mon Nov 11 17:13:25 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Mon Nov 11 17:34:06 2013 +0530
@@ -1878,6 +1878,50 @@
 BLOCKCOPY_PS_W16_H4 16, 16
 BLOCKCOPY_PS_W16_H4 16, 32
 
+
+;-----------------------------------------------------------------------------
+; void blockcopy_ps_%1x%2(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
+;-----------------------------------------------------------------------------
+%macro BLOCKCOPY_PS_W24_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   m1,             m1
+      movu       [r0 + 32],      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   m1,             m1
+      movu       [r0 + r1 + 32], m1
+
+      lea        r0,             [r0 + 2 * r1]
+      lea        r2,             [r2 + 2 * r3]
+
+      dec        r4d
+      jnz        .loop
+
+RET
+%endmacro
+
+BLOCKCOPY_PS_W24_H2 24, 32
+
 ;-----------------------------------------------------------------------------
 ; void blockcopy_ps_%1x%2(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
 ;-----------------------------------------------------------------------------
diff -r 2614cd2c1f62 -r c377535d4757 source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Mon Nov 11 17:13:25 2013 +0530
+++ b/source/common/x86/blockcopy8.h	Mon Nov 11 17:34:06 2013 +0530
@@ -105,6 +105,7 @@
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 12, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 16, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 32, cpu); \
+    SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(24, 32, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(32,  8, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(32, 16, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(32, 24, cpu); \


More information about the x265-devel mailing list