[x265] [PATCH] asm code for blockcopy_sp, 2x4

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 6 15:28:30 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1383748101 -19800
# Node ID 6e8d917d7d904c1498307f4895fc0f2c3a959389
# Parent  37d3f032ad7595f040ab4279d2424672cd881635
asm code for blockcopy_sp, 2x4

diff -r 37d3f032ad75 -r 6e8d917d7d90 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Nov 06 19:31:12 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Nov 06 19:58:21 2013 +0530
@@ -330,6 +330,7 @@
 //This function pointer initaliztion is temprory will be remove later with macro definitions.
 //It is used to avoid linker error until all partion are coded and commit smaller patches, easier to review.
 
+        p.chroma_copy_sp[CHROMA_2x4] = x265_blockcopy_sp_2x4_sse2;
         p.chroma_copy_sp[CHROMA_4x2] = x265_blockcopy_sp_4x2_sse2;
         p.chroma_copy_sp[CHROMA_4x4] = x265_blockcopy_sp_4x4_sse2;
         p.chroma_copy_sp[CHROMA_4x8] = x265_blockcopy_sp_4x8_sse2;
diff -r 37d3f032ad75 -r 6e8d917d7d90 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Wed Nov 06 19:31:12 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Wed Nov 06 19:58:21 2013 +0530
@@ -799,6 +799,41 @@
 BLOCKCOPY_PP_W64_H2 64, 48
 BLOCKCOPY_PP_W64_H2 64, 64
 
+;-----------------------------------------------------------------------------
+; void blockcopy_sp_2x4(pixel *dest, intptr_t destStride, int16_t *src, intptr_t srcStride)
+;-----------------------------------------------------------------------------
+INIT_XMM sse2
+cglobal blockcopy_sp_2x4, 4, 6, 5, dest, destStride, src, srcStride
+
+add        r3,     r3
+
+mova       m0,     [tab_Vm]
+
+movd       m1,     [r2]
+movd       m2,     [r2 + r3]
+movd       m3,     [r2 + 2 * r3]
+lea        r4,     [r2 + 2 * r3]
+movd       m4,     [r4 + r3]
+
+pshufb     m1,     m0
+pshufb     m2,     m0
+pshufb     m3,     m0
+pshufb     m4,     m0
+
+pextrw     r5,            m1,          0
+mov        [r0],          r5w
+
+pextrw     r5,            m2,          0
+mov        [r0 + r1],     r5w
+
+pextrw     r5,            m3,          0
+mov        [r0 + 2 * r1], r5w
+
+lea        r4,            [r0 + 2 * r1]
+pextrw     r5,            m4,          0
+mov        [r4 + r1],     r5w
+
+RET
 
 ;-----------------------------------------------------------------------------
 ; void blockcopy_sp_4x2(pixel *dest, intptr_t destStride, int16_t *src, intptr_t srcStride)


More information about the x265-devel mailing list