[x265] [PATCH] asm: 10bpp code for blockcopy_ps_24x32

murugan at multicorewareinc.com murugan at multicorewareinc.com
Tue Dec 10 08:55:02 CET 2013


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1386662045 -19800
#      Tue Dec 10 13:24:05 2013 +0530
# Node ID 1800544438538254fc5e53f7a1eef2920491ece7
# Parent  093495408a1efc297ca292d6be182e3330bfb38d
asm: 10bpp code for blockcopy_ps_24x32

diff -r 093495408a1e -r 180054443853 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Dec 10 12:45:04 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Dec 10 13:24:05 2013 +0530
@@ -684,6 +684,7 @@
         p.chroma[X265_CSP_I420].copy_pp[LUMA_32x32] = x265_blockcopy_pp_16x16_sse2;
         p.chroma[X265_CSP_I420].copy_pp[LUMA_32x64] = x265_blockcopy_pp_16x32_sse2;
         p.luma_copy_pp[LUMA_16x64] = x265_blockcopy_pp_16x64_sse2;
+        p.chroma[X265_CSP_I420].copy_pp[LUMA_48x64] = x265_blockcopy_pp_24x32_sse2;
     }
     if (cpuMask & X265_CPU_SSSE3)
     {
diff -r 093495408a1e -r 180054443853 source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Tue Dec 10 12:45:04 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Tue Dec 10 13:24:05 2013 +0530
@@ -809,51 +809,80 @@
 ;-----------------------------------------------------------------------------
 ; void blockcopy_pp_%1x%2(pixel *dest, intptr_t deststride, pixel *src, intptr_t srcstride)
 ;-----------------------------------------------------------------------------
-%macro BLOCKCOPY_PP_W24_H32 2
+%macro BLOCKCOPY_PP_W24_H4 2
 INIT_XMM sse2
-cglobal blockcopy_pp_%1x%2, 4, 7, 8, dest, deststride, src, srcstride
-
-mov         r4d,       %2
-
+cglobal blockcopy_pp_%1x%2, 4, 5, 6, dest, deststride, src, srcstride
+    mov    r4d,    %2/4
+%if HIGH_BIT_DEPTH
+    add     r1,    r1
+    add     r3,    r3
 .loop
-      movu     m0,     [r2]
-      movh     m1,     [r2 + 16]
-
-      movu     m2,     [r2 + r3]
-      movh     m3,     [r2 + r3 + 16]
-
-      movu     m4,     [r2 + 2 * r3]
-      movh     m5,     [r2 + 2 * r3 + 16]
-
-      lea      r5,     [r2 + 2 * r3]
-
-      movu     m6,     [r5 + r3]
-      movh     m7,     [r5 + r3 + 16]
-
-      movu     [r0],                 m0
-      movh     [r0 + 16],            m1
-
-      movu     [r0 + r1],            m2
-      movh     [r0 + r1 + 16],       m3
-
-      movu     [r0 + 2 * r1],        m4
-      movh     [r0 + 2 * r1 + 16],   m5
-
-      lea      r6,                   [r0 + 2 * r1]
-
-      movu     [r6 + r1],            m6
-      movh     [r6 + r1 + 16],       m7
-
-      lea      r0,                   [r0 + 4 * r1]
-      lea      r2,                   [r2 + 4 * r3]
-
-      sub      r4d,                  4
-      jnz      .loop
-
-RET
+    movu    m0,    [r2]
+    movu    m1,    [r2 + 16]
+    movu    m2,    [r2 + 32]
+    movu    m3,    [r2 + r3]
+    movu    m4,    [r2 + r3 + 16]
+    movu    m5,    [r2 + r3 + 32]
+    lea     r2,    [r2 + 2 * r3]
+
+    movu    [r0],              m0
+    movu    [r0 + 16],         m1
+    movu    [r0 + 32],         m2
+    movu    [r0 + r1],         m3
+    movu    [r0 + r1 + 16],    m4
+    movu    [r0 + r1 + 32],    m5
+
+    lea     r0,    [r0 + 2 * r1]
+    movu    m0,    [r2]
+    movu    m1,    [r2 + 16]
+    movu    m2,    [r2 + 32]
+    movu    m3,    [r2 + r3]
+    movu    m4,    [r2 + r3 + 16]
+    movu    m5,    [r2 + r3 + 32]
+
+    movu    [r0],              m0
+    movu    [r0 + 16],         m1
+    movu    [r0 + 32],         m2
+    movu    [r0 + r1],         m3
+    movu    [r0 + r1 + 16],    m4
+    movu    [r0 + r1 + 32],    m5
+
+    dec     r4d
+    lea     r0,    [r0 + 2 * r1]
+    lea     r2,    [r2 + 2 * r3]
+    jnz     .loop
+%else
+.loop
+    movu    m0,    [r2]
+    movh    m1,    [r2 + 16]
+    movu    m2,    [r2 + r3]
+    movh    m3,    [r2 + r3 + 16]
+    lea     r2,    [r2 + 2 * r3]
+    movu    m4,    [r2]
+    movh    m5,    [r2 + 16]
+
+    movu    [r0],              m0
+    movh    [r0 + 16],         m1
+    movu    [r0 + r1],         m2
+    movh    [r0 + r1 + 16],    m3
+    lea     r0,                [r0 + 2 * r1]
+    movu    [r0],              m4
+    movh    [r0 + 16],         m5
+
+    movu    m0,                [r2 + r3]
+    movh    m1,                [r2 + r3 + 16]
+    movu    [r0 + r1],         m0
+    movh    [r0 + r1 + 16],    m1
+
+    dec    r4d
+    lea    r0,    [r0 + 2 * r1]
+    lea    r2,    [r2 + 2 * r3]
+    jnz    .loop
+%endif
+    RET
 %endmacro
 
-BLOCKCOPY_PP_W24_H32 24, 32
+BLOCKCOPY_PP_W24_H4 24, 32
 
 ;-----------------------------------------------------------------------------
 ; void blockcopy_pp_%1x%2(pixel *dest, intptr_t deststride, pixel *src, intptr_t srcstride)


More information about the x265-devel mailing list