[x265] [PATCH] asm code for pixel_add_ps, 4x8 and 4x16

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 20 13:07:24 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384949234 -19800
# Node ID e7b1b81bbff43bcd881b75fbc30c0d56ba855dbf
# Parent  f698f44e7f54c27edc1d30e2ece2a8cca894acc6
asm code for pixel_add_ps, 4x8 and 4x16

diff -r f698f44e7f54 -r e7b1b81bbff4 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Nov 20 17:19:30 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Nov 20 17:37:14 2013 +0530
@@ -640,6 +640,8 @@
         // review.
 
         p.chroma_add_ps[X265_CSP_I420][CHROMA_4x4] = x265_pixel_add_ps_4x4_sse4;
+        p.chroma_add_ps[X265_CSP_I420][CHROMA_4x8] = x265_pixel_add_ps_4x8_sse4;
+        p.chroma_add_ps[X265_CSP_I420][CHROMA_4x16] = x265_pixel_add_ps_4x16_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
     {
diff -r f698f44e7f54 -r e7b1b81bbff4 source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Wed Nov 20 17:19:30 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Wed Nov 20 17:37:14 2013 +0530
@@ -77,3 +77,68 @@
 movd        [r0 + r1],     m0
 
 RET
+
+;-----------------------------------------------------------------------------
+; void pixel_add_ps_%1x%2(pixel *dest, int destride, pixel *src0, int16_t *scr1, int srcStride0, int srcStride1)
+;-----------------------------------------------------------------------------
+%macro PIXEL_ADD_PS_W4_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
+      movd        m0,            [r2]
+      pmovzxbw    m0,            m0
+      movh        m1,            [r3]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movd        [r0],          m0
+
+      movd        m0,            [r2 + r4]
+      pmovzxbw    m0,            m0
+      movh        m1,            [r3 + r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movd        [r0 + r1],     m0
+
+      movd        m0,            [r2 + 2 * r4]
+      pmovzxbw    m0,            m0
+      movh        m1,            [r3 + 2 * r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movd        [r0 + 2 * r1], m0
+
+      lea         r0,            [r0 + 2 * r1]
+      lea         r2,            [r2 + 2 * r4]
+      lea         r3,            [r3 + 2 * r5]
+
+      movd        m0,            [r2 + r4]
+      pmovzxbw    m0,            m0
+      movh        m1,            [r3 + r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movd        [r0 + r1],     m0
+
+      lea         r0,            [r0 + 2 * r1]
+      lea         r2,            [r2 + 2 * r4]
+      lea         r3,            [r3 + 2 * r5]
+
+      dec         r6d
+      jnz         .loop
+
+RET
+%endmacro
+
+PIXEL_ADD_PS_W4_H4   4,  8
+PIXEL_ADD_PS_W4_H4   4, 16


More information about the x265-devel mailing list