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

murugan at multicorewareinc.com murugan at multicorewareinc.com
Mon Dec 9 08:51:05 CET 2013


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1386575401 -19800
#      Mon Dec 09 13:20:01 2013 +0530
# Node ID 2332a5cb06381b9a67c5a262842312dc59ba761a
# Parent  a6ead95389e7e81f419b9f4bd2c67e90df0de198
asm: 10bpp code for pixel_add_ps_24x32

diff -r a6ead95389e7 -r 2332a5cb0638 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Dec 09 13:11:31 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Dec 09 13:20:01 2013 +0530
@@ -684,6 +684,7 @@
         p.chroma[X265_CSP_I420].add_ps[CHROMA_16x16] = x265_pixel_add_ps_16x16_sse2;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_16x32] = x265_pixel_add_ps_16x32_sse2;
         p.luma_add_ps[LUMA_16x64] = x265_pixel_add_ps_16x64_sse2;
+        p.chroma[X265_CSP_I420].add_ps[CHROMA_24x32] = x265_pixel_add_ps_24x32_sse2;
     }
     if (cpuMask & X265_CPU_SSSE3)
     {
diff -r a6ead95389e7 -r 2332a5cb0638 source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Mon Dec 09 13:11:31 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Mon Dec 09 13:20:01 2013 +0530
@@ -1061,6 +1061,52 @@
 ; void pixel_add_ps_%1x%2(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
 ;-----------------------------------------------------------------------------
 %macro PIXEL_ADD_PS_W24_H2 2
+%if HIGH_BIT_DEPTH
+INIT_XMM sse2
+cglobal pixel_add_ps_%1x%2, 6, 7, 6, dest, destride, src0, scr1, srcStride0, srcStride1
+    mov     r6d,    %2/2
+    add      r1,    r1
+    add      r4,    r4
+    add      r5,    r5
+    pxor     m4,    m4
+    mova     m5,    [pw_pixel_max]
+.loop
+    movu     m0,    [r2]
+    movu     m1,    [r3]
+    movu     m2,    [r2 + 16]
+    movu     m3,    [r3 + 16]
+    paddw    m0,    m1
+    paddw    m2,    m3
+    CLIPW    m0,    m4,    m5
+    CLIPW    m2,    m4,    m5
+
+    movu     [r0],         m0
+    movu     [r0 + 16],    m2
+
+    movu     m0,    [r2 + 32]
+    movu     m1,    [r3 + 32]
+    movu     m2,    [r2 + r4]
+    movu     m3,    [r3 + r5]
+    paddw    m0,    m1
+    paddw    m2,    m3
+    CLIPW    m0,    m4,    m5
+    CLIPW    m2,    m4,    m5
+
+    movu     [r0 + 32],    m0
+    movu     [r0 + r1],    m2
+
+    movu     m0,    [r2 + r4 + 16]
+    movu     m1,    [r3 + r5 + 16]
+    movu     m2,    [r2 + r4 + 32]
+    movu     m3,    [r3 + r5 + 32]
+    paddw    m0,    m1
+    paddw    m2,    m3
+    CLIPW    m0,    m4,    m5
+    CLIPW    m2,    m4,    m5
+
+    movu     [r0 + r1 + 16],    m0
+    movu     [r0 + r1 + 32],    m2
+%else
 INIT_XMM sse4
 cglobal pixel_add_ps_%1x%2, 6, 7, 6, dest, destride, src0, scr1, srcStride0, srcStride1
 
@@ -1103,7 +1149,7 @@
 
     movu        [r0 + r1],      m0
     movh        [r0 + r1 + 16], m2
-
+%endif
     lea         r0,             [r0 + 2 * r1]
     lea         r2,             [r2 + 2 * r4]
     lea         r3,             [r3 + 2 * r5]


More information about the x265-devel mailing list