[x265] [PATCH] asm code for blockcopy_ps_32xN
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Mon Nov 11 12:43:35 CET 2013
# HG changeset patch
# User Praveen Tiwari
# Date 1384170205 -19800
# Node ID 2614cd2c1f6262edf61b3b30434f0ef091871942
# Parent 6ca58aa3d85bc962510509c7f04be76c9a9cf591
asm code for blockcopy_ps_32xN
diff -r 6ca58aa3d85b -r 2614cd2c1f62 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Mon Nov 11 16:54:27 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp Mon Nov 11 17:13:25 2013 +0530
@@ -466,6 +466,11 @@
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_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;
+ p.chroma_copy_ps[CHROMA_32x32] = x265_blockcopy_ps_32x32_sse4;
+
}
if (cpuMask & X265_CPU_AVX)
{
diff -r 6ca58aa3d85b -r 2614cd2c1f62 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm Mon Nov 11 16:54:27 2013 +0530
+++ b/source/common/x86/blockcopy8.asm Mon Nov 11 17:13:25 2013 +0530
@@ -1877,3 +1877,53 @@
BLOCKCOPY_PS_W16_H4 16, 12
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_W32_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 + 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
+
+ lea r0, [r0 + 2 * r1]
+ lea r2, [r2 + 2 * r3]
+
+ dec r4d
+ jnz .loop
+
+RET
+%endmacro
+
+BLOCKCOPY_PS_W32_H2 32, 8
+BLOCKCOPY_PS_W32_H2 32, 16
+BLOCKCOPY_PS_W32_H2 32, 24
+BLOCKCOPY_PS_W32_H2 32, 32
diff -r 6ca58aa3d85b -r 2614cd2c1f62 source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h Mon Nov 11 16:54:27 2013 +0530
+++ b/source/common/x86/blockcopy8.h Mon Nov 11 17:13:25 2013 +0530
@@ -104,7 +104,11 @@
SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(16, 8, cpu); \
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(16, 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); \
+ SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(32, 32, cpu);
CHROMA_BLOCKCOPY_DEF_SSE4(_sse4);
More information about the x265-devel
mailing list