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

murugan at multicorewareinc.com murugan at multicorewareinc.com
Tue Dec 10 09:32:05 CET 2013


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1386663087 -19800
#      Tue Dec 10 13:41:27 2013 +0530
# Node ID c86148cae36d031891801911fbe29f7390f01da3
# Parent  1800544438538254fc5e53f7a1eef2920491ece7
asm: 10bpp code for blockcopy_ps_32xN

diff -r 180054443853 -r c86148cae36d source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Dec 10 13:24:05 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Dec 10 13:41:27 2013 +0530
@@ -685,6 +685,11 @@
         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;
+        p.chroma[X265_CSP_I420].copy_pp[LUMA_64x16] = x265_blockcopy_pp_32x8_sse2;
+        p.chroma[X265_CSP_I420].copy_pp[LUMA_64x32] = x265_blockcopy_pp_32x16_sse2;
+        p.chroma[X265_CSP_I420].copy_pp[LUMA_64x48] = x265_blockcopy_pp_32x24_sse2;
+        p.chroma[X265_CSP_I420].copy_pp[LUMA_64x64] = x265_blockcopy_pp_32x32_sse2;
+        p.luma_copy_pp[LUMA_32x64] = x265_blockcopy_pp_32x64_sse2;
     }
     if (cpuMask & X265_CPU_SSSE3)
     {
diff -r 180054443853 -r c86148cae36d source/common/x86/blockcopy8.asm
--- a/source/common/x86/blockcopy8.asm	Tue Dec 10 13:24:05 2013 +0530
+++ b/source/common/x86/blockcopy8.asm	Tue Dec 10 13:41:27 2013 +0530
@@ -889,46 +889,88 @@
 ;-----------------------------------------------------------------------------
 %macro BLOCKCOPY_PP_W32_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, 4, dest, deststride, src, srcstride
+    mov    r4d,    %2/4
+%if HIGH_BIT_DEPTH
+    add     r1,    r1
+    add     r3,    r3
 .loop
-      movu     m0,     [r2]
-      movu     m1,     [r2 + 16]
-
-      movu     m2,     [r2 + r3]
-      movu     m3,     [r2 + r3 + 16]
-
-      movu     m4,     [r2 + 2 * r3]
-      movu     m5,     [r2 + 2 * r3 + 16]
-
-      lea      r5,     [r2 + 2 * r3]
-
-      movu     m6,     [r5 + r3]
-      movu     m7,     [r5 + r3 + 16]
-
-      movu     [r0],                 m0
-      movu     [r0 + 16],            m1
-
-      movu     [r0 + r1],            m2
-      movu     [r0 + r1 + 16],       m3
-
-      movu     [r0 + 2 * r1],        m4
-      movu     [r0 + 2 * r1 + 16],   m5
-
-      lea      r6,                   [r0 + 2 * r1]
-
-      movu     [r6 + r1],            m6
-      movu     [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 + 48]
+
+    movu    [r0],         m0
+    movu    [r0 + 16],    m1
+    movu    [r0 + 32],    m2
+    movu    [r0 + 48],    m3
+
+    movu    m0,    [r2 + r3]
+    movu    m1,    [r2 + r3 + 16]
+    movu    m2,    [r2 + r3 + 32]
+    movu    m3,    [r2 + r3 + 48]
+    lea     r2,    [r2 + 2 * r3]
+
+    movu    [r0 + r1],         m0
+    movu    [r0 + r1 + 16],    m1
+    movu    [r0 + r1 + 32],    m2
+    movu    [r0 + r1 + 48],    m3
+
+    lea     r0,    [r0 + 2 * r1]
+    movu    m0,    [r2]
+    movu    m1,    [r2 + 16]
+    movu    m2,    [r2 + 32]
+    movu    m3,    [r2 + 48]
+
+    movu    [r0],         m0
+    movu    [r0 + 16],    m1
+    movu    [r0 + 32],    m2
+    movu    [r0 + 48],    m3
+
+    movu    m0,    [r2 + r3]
+    movu    m1,    [r2 + r3 + 16]
+    movu    m2,    [r2 + r3 + 32]
+    movu    m3,    [r2 + r3 + 48]
+
+    movu    [r0 + r1],         m0
+    movu    [r0 + r1 + 16],    m1
+    movu    [r0 + r1 + 32],    m2
+    movu    [r0 + r1 + 48],    m3
+
+    dec     r4d
+    lea     r0,    [r0 + 2 * r1]
+    lea     r2,    [r2 + 2 * r3]
+    jnz     .loop
+%else
+.loop
+    movu    m0,    [r2]
+    movu    m1,    [r2 + 16]
+    movu    m2,    [r2 + r3]
+    movu    m3,    [r2 + r3 + 16]
+    lea     r2,    [r2 + 2 * r3]
+
+    movu    [r0],              m0
+    movu    [r0 + 16],         m1
+    movu    [r0 + r1],         m2
+    movu    [r0 + r1 + 16],    m3
+    lea     r0,                [r0 + 2 * r1]
+
+    movu    m0,    [r2]
+    movu    m1,    [r2 + 16]
+    movu    m2,    [r2 + r3]
+    movu    m3,    [r2 + r3 + 16]
+
+    movu    [r0],              m0
+    movu    [r0 + 16],         m1
+    movu    [r0 + r1],         m2
+    movu    [r0 + r1 + 16],    m3
+
+    dec    r4d
+    lea    r0,    [r0 + 2 * r1]
+    lea    r2,    [r2 + 2 * r3]
+    jnz    .loop
+%endif
+    RET
 %endmacro
 
 BLOCKCOPY_PP_W32_H4 32, 8


More information about the x265-devel mailing list