[x265] [PATCH] asm code for blockcopy_ps_12x16

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Nov 11 13:20:55 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384172445 -19800
# Node ID afcf4952995ca2da024776b1795841cf45187d9c
# Parent  c377535d47574ae132835ecaedf342439d1df27f
asm code for blockcopy_ps_12x16

diff -r c377535d4757 -r afcf4952995c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Nov 11 17:34:06 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 11 17:50:45 2013 +0530
@@ -461,6 +461,7 @@
         p.chroma_copy_ps[CHROMA_8x8] = x265_blockcopy_ps_8x8_sse4;
         p.chroma_copy_ps[CHROMA_8x16] = x265_blockcopy_ps_8x16_sse4;
         p.chroma_copy_ps[CHROMA_8x32] = x265_blockcopy_ps_8x32_sse4;
+        p.chroma_copy_ps[CHROMA_12x16] = x265_blockcopy_ps_12x16_sse4;
         p.chroma_copy_ps[CHROMA_16x4] = x265_blockcopy_ps_16x4_sse4;
         p.chroma_copy_ps[CHROMA_16x8] = x265_blockcopy_ps_16x8_sse4;
         p.chroma_copy_ps[CHROMA_16x12] = x265_blockcopy_ps_16x12_sse4;
diff -r c377535d4757 -r afcf4952995c source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Mon Nov 11 17:34:06 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Mon Nov 11 17:50:45 2013 +0530
@@ -1787,6 +1787,42 @@
 BLOCKCOPY_PS_W8_H4  8, 16
 BLOCKCOPY_PS_W8_H4  8, 32
 
+
+;-----------------------------------------------------------------------------
+; void blockcopy_ps_%1x%2(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
+;-----------------------------------------------------------------------------
+%macro BLOCKCOPY_PS_W12_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
+      movh       [r0 + 16],      m1
+
+      movu       m1,             [r2 + r3]
+      pmovzxbw   m2,             m1
+      movu       [r0 + r1],      m2
+      punpckhbw  m1,             m0
+      movh       [r0 + r1 + 16], m1
+
+      lea        r0,             [r0 + 2 * r1]
+      lea        r2,             [r2 + 2 * r3]
+
+      dec        r4d
+      jnz        .loop
+
+RET
+%endmacro
+
+BLOCKCOPY_PS_W12_H2 12, 16
+
 ;-----------------------------------------------------------------------------
 ; void blockcopy_ps_16x4(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
 ;-----------------------------------------------------------------------------
diff -r c377535d4757 -r afcf4952995c source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h	Mon Nov 11 17:34:06 2013 +0530
+++ b/source/common/x86/blockcopy8.h	Mon Nov 11 17:50:45 2013 +0530
@@ -100,6 +100,7 @@
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(8, 8, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(8, 16, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(8, 32, cpu); \
+    SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(12, 16, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 4, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 8, cpu); \
     SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 12, cpu); \


More information about the x265-devel mailing list