[x265] [PATCH] pixel_add_ps_2x8 asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Thu Nov 21 14:23:22 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1385040193 -19800
# Node ID eedc0b988cea0944007c80e29f2088ba16fd5eb1
# Parent  7d79ebc5ff44b4d8be01b8fcd6092031af6a1d3f
pixel_add_ps_2x8 asm code

diff -r 7d79ebc5ff44 -r eedc0b988cea source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Nov 21 18:42:36 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Nov 21 18:53:13 2013 +0530
@@ -635,6 +635,7 @@
         // until all partitions are coded and commit smaller patches, easier to
         // review.
 
+        p.chroma[X265_CSP_I420].add_ps[CHROMA_2x8] = x265_pixel_add_ps_2x8_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_2x4] = x265_pixel_add_ps_2x4_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_4x2] = x265_pixel_add_ps_4x2_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_4x4] = x265_pixel_add_ps_4x4_sse4;
diff -r 7d79ebc5ff44 -r eedc0b988cea source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Thu Nov 21 18:42:36 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Thu Nov 21 18:53:13 2013 +0530
@@ -75,6 +75,67 @@
 
 RET
 
+
+;-----------------------------------------------------------------------------
+; 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_W2_H4 2
+INIT_XMM sse4
+cglobal pixel_add_ps_%1x%2, 6, 7, 2, dest, destride, src0, scr1, srcStride0, srcStride1
+
+add         r5,            r5
+
+mov         r6d,           %2/4
+
+.loop
+      pmovzxbw    m0,            [r2]
+      movd        m1,            [r3]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      pextrw      [r0],          m0,      0
+
+      pmovzxbw    m0,            [r2 + r4]
+      movd        m1,            [r3 + r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      pextrw      [r0 + r1],     m0,      0
+
+      pmovzxbw    m0,            [r2 + 2 * r4]
+      movd        m1,            [r3 + 2 * r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      pextrw      [r0 + 2 * r1], m0,      0
+
+      lea         r0,            [r0 + 2 * r1]
+      lea         r2,            [r2 + 2 * r4]
+      lea         r3,            [r3 + 2 * r5]
+
+      pmovzxbw    m0,            [r2 + r4]
+      movd        m1,            [r3 + r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      pextrw      [r0 + r1],     m0,      0
+
+      lea         r0,            [r0 + 2 * r1]
+      lea         r2,            [r2 + 2 * r4]
+      lea         r3,            [r3 + 2 * r5]
+
+      dec         r6d
+      jnz         .loop
+
+RET
+%endmacro
+
+PIXEL_ADD_PS_W2_H4   2, 8
+
 ;-----------------------------------------------------------------------------
 ; void pixel_add_ps_4x2(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list