[x265] [PATCH] asm code for blockcopy_ps_8x2
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Mon Nov 11 08:38:07 CET 2013
# HG changeset patch
# User Praveen Tiwari
# Date 1384155477 -19800
# Node ID 74f525729a65be1dc6c6e3136c268c7ea9f5c724
# Parent be34513fdc32ca1215dbc5dc9ec6b42f7d254827
asm code for blockcopy_ps_8x2
diff -r be34513fdc32 -r 74f525729a65 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Mon Nov 11 12:30:32 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp Mon Nov 11 13:07:57 2013 +0530
@@ -450,6 +450,13 @@
p.chroma_copy_sp[CHROMA_2x4] = x265_blockcopy_sp_2x4_sse4;
p.chroma_copy_sp[CHROMA_2x8] = x265_blockcopy_sp_2x8_sse4;
p.chroma_copy_sp[CHROMA_6x8] = x265_blockcopy_sp_6x8_sse4;
+
+ // This function pointer initialization is temporary will be removed
+ // later with macro definitions. It is used to avoid linker errors
+ // until all partitions are coded and commit smaller patches, easier to
+ // review.
+
+ p.chroma_copy_ps[CHROMA_8x2] = x265_blockcopy_ps_8x2_sse4;
}
if (cpuMask & X265_CPU_AVX)
{
diff -r be34513fdc32 -r 74f525729a65 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm Mon Nov 11 12:30:32 2013 +0530
+++ b/source/common/x86/blockcopy8.asm Mon Nov 11 13:07:57 2013 +0530
@@ -1656,3 +1656,21 @@
%endmacro
BLOCKFILL_S_W32_H4 32, 32
+
+;-----------------------------------------------------------------------------
+; void blockcopy_ps_8x2(int16_t *dest, intptr_t destStride, pixel *src, intptr_t srcStride);
+;-----------------------------------------------------------------------------
+INIT_XMM sse4
+cglobal blockcopy_ps_8x2, 4, 4, 1, dest, destStride, src, srcStride
+
+add r1, r1
+
+movh m0, [r2]
+pmovzxbw m0, m0
+movu [r0], m0
+
+movh m0, [r2 + r3]
+pmovzxbw m0, m0
+movu [r0 + r1], m0
+
+RET
diff -r be34513fdc32 -r 74f525729a65 source/common/x86/blockcopy8.h
--- a/source/common/x86/blockcopy8.h Mon Nov 11 12:30:32 2013 +0530
+++ b/source/common/x86/blockcopy8.h Mon Nov 11 13:07:57 2013 +0530
@@ -90,6 +90,14 @@
CHROMA_BLOCKCOPY_DEF(_sse2);
LUMA_BLOCKCOPY_DEF(_sse2);
+#define SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(W, H, cpu) \
+ void x265_blockcopy_ps_ ## W ## x ## H ## cpu(int16_t *dst, intptr_t dstStride, pixel *src, intptr_t srcStride);
+
+#define CHROMA_BLOCKCOPY_DEF_SSE4(cpu) \
+ SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4(8, 2, cpu);
+
+CHROMA_BLOCKCOPY_DEF_SSE4(_sse4);
+
void x265_blockcopy_sp_2x4_sse4(pixel *a, intptr_t stridea, int16_t *b, intptr_t strideb);
void x265_blockcopy_sp_2x8_sse4(pixel *a, intptr_t stridea, int16_t *b, intptr_t strideb);
void x265_blockcopy_sp_6x8_sse4(pixel *a, intptr_t stridea, int16_t *b, intptr_t strideb);
@@ -104,4 +112,7 @@
#undef CHROMA_BLOCKCOPY_DEF
#undef LUMA_BLOCKCOPY_DEF
+#undef SETUP_CHROMA_BLOCKCOPY_FUNC_SSE4
+#undef CHROMA_BLOCKCOPY_DEF_SSE4
+
#endif // ifndef X265_I386_PIXEL_H
More information about the x265-devel
mailing list