[x265] [PATCH] asm code for blockcopy_sp, 6x8

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 6 15:01:21 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1383746472 -19800
# Node ID 37d3f032ad7595f040ab4279d2424672cd881635
# Parent  5215787730d23fcffaf6fa00a85bc07c4fea9e99
asm code for blockcopy_sp, 6x8

diff -r 5215787730d2 -r 37d3f032ad75 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Nov 06 17:42:52 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Nov 06 19:31:12 2013 +0530
@@ -334,6 +334,7 @@
         p.chroma_copy_sp[CHROMA_4x4] = x265_blockcopy_sp_4x4_sse2;
         p.chroma_copy_sp[CHROMA_4x8] = x265_blockcopy_sp_4x8_sse2;
         p.chroma_copy_sp[CHROMA_4x16] = x265_blockcopy_sp_4x16_sse2;
+        p.chroma_copy_sp[CHROMA_6x8] = x265_blockcopy_sp_6x8_sse2;
         p.chroma_copy_sp[CHROMA_8x2] = x265_blockcopy_sp_8x2_sse2;
         p.chroma_copy_sp[CHROMA_8x4] = x265_blockcopy_sp_8x4_sse2;
         p.chroma_copy_sp[CHROMA_8x6] = x265_blockcopy_sp_8x6_sse2;
diff -r 5215787730d2 -r 37d3f032ad75 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Wed Nov 06 17:42:52 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Wed Nov 06 19:31:12 2013 +0530
@@ -955,6 +955,60 @@
 
 BLOCKCOPY_SP_W4_H8 4, 16
 
+
+;-----------------------------------------------------------------------------
+; void blockcopy_sp_6x8(pixel *dest, intptr_t destStride, int16_t *src, intptr_t srcStride)
+;-----------------------------------------------------------------------------
+%macro BLOCKCOPY_SP_W6_H4 2
+INIT_XMM sse2
+cglobal blockcopy_sp_6x8, 4, 7, 8, dest, destStride, src, srcStride
+
+mov       r5d,    %2
+
+add       r3,      r3
+
+mova      m0,      [tab_Vm]
+
+.loop
+     movu      m1,      [r2]
+     movu      m2,      [r2 + r3]
+     movu      m3,      [r2 + 2 * r3]
+     lea       r4,      [r2 + 2 * r3]
+     movu      m4,      [r4 + r3]
+
+     pshufb    m1,      m0
+     pshufb    m2,      m0
+     pshufb    m3,      m0
+     pshufb    m4,      m0
+
+     movd      [r0],              m1
+     pextrw    r6,                m1,    2
+     mov       [r0 + 4],          r6w
+
+     movd      [r0 + r1],         m2
+     pextrw    r6,                m2,    2
+     mov       [r0 + r1 + 4],     r6w
+
+     movd      [r0 + 2 * r1],     m3
+     pextrw    r6,                m3,    2
+     mov       [r0 + 2 * r1 + 4], r6w
+
+     lea       r4,                [r0 + 2 * r1]
+     movd      [r4 + r1],         m4
+     pextrw    r6,                m4,    2
+     mov       [r4 + r1 + 4],     r6w
+
+     lea        r0,               [r0 + 4 * r1]
+     lea        r2,               [r2 + 4 * r3]
+
+     sub        r5d,              4
+     jnz        .loop
+
+RET
+%endmacro
+
+BLOCKCOPY_SP_W6_H4 6, 8
+
 ;-----------------------------------------------------------------------------
 ; void blockcopy_sp_8x2(pixel *dest, intptr_t destStride, int16_t *src, intptr_t srcStride)
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list