[x265] [PATCH] pixel_add_ps, 16x8, 16x12, 16x16, 16x32 asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Thu Nov 21 10:06:53 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1385024782 -19800
# Node ID d5f74ae703f406c339ffe0e31683e75d6cfadd57
# Parent  2e4acdaf439855c54cec7af1d140a408a538b9c3
pixel_add_ps, 16x8, 16x12, 16x16, 16x32 asm code

diff -r 2e4acdaf4398 -r d5f74ae703f4 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Nov 21 14:11:37 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Nov 21 14:36:22 2013 +0530
@@ -646,6 +646,10 @@
         p.chroma[X265_CSP_I420].add_ps[CHROMA_8x16] = x265_pixel_add_ps_8x16_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_8x32] = x265_pixel_add_ps_8x32_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_16x4] = x265_pixel_add_ps_16x4_sse4;
+        p.chroma[X265_CSP_I420].add_ps[CHROMA_16x8] = x265_pixel_add_ps_16x8_sse4;
+        p.chroma[X265_CSP_I420].add_ps[CHROMA_16x12] = x265_pixel_add_ps_16x12_sse4;
+        p.chroma[X265_CSP_I420].add_ps[CHROMA_16x16] = x265_pixel_add_ps_16x16_sse4;
+        p.chroma[X265_CSP_I420].add_ps[CHROMA_16x32] = x265_pixel_add_ps_16x32_sse4;
 
         p.chroma[X265_CSP_I420].filter_vsp[CHROMA_2x4] = x265_interp_4tap_vert_sp_2x4_sse4;
         p.chroma[X265_CSP_I420].filter_vsp[CHROMA_2x8] = x265_interp_4tap_vert_sp_2x8_sse4;
diff -r 2e4acdaf4398 -r d5f74ae703f4 source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Thu Nov 21 14:11:37 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Thu Nov 21 14:36:22 2013 +0530
@@ -426,3 +426,86 @@
 movu        [r0 + r1],     m0
 
 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_W16_H4 2
+INIT_XMM sse4
+cglobal pixel_add_ps_%1x%2, 6, 7, 4, dest, destride, src0, scr1, srcStride0, srcStride1
+
+add         r5,            r5
+
+mov         r6d,           %2/4
+
+.loop
+      pmovzxbw    m0,            [r2]
+      pmovzxbw    m1,            [r2 + 8]
+
+      movu        m2,            [r3]
+      movu        m3,            [r3 + 16]
+
+      paddw       m0,            m2
+      paddw       m1,            m3
+
+      packuswb    m0,            m1
+
+      movu        [r0],          m0
+
+      pmovzxbw    m0,            [r2 + r4]
+      pmovzxbw    m1,            [r2 + r4 + 8]
+
+      movu        m2,            [r3 + r5]
+      movu        m3,            [r3 + r5 + 16]
+
+      paddw       m0,            m2
+      paddw       m1,            m3
+
+      packuswb    m0,            m1
+
+      movu        [r0 + r1],     m0
+
+      pmovzxbw    m0,            [r2 + 2 * r4]
+      pmovzxbw    m1,            [r2 + 2 * r4 + 8]
+
+      movu        m2,            [r3 + 2 * r5]
+      movu        m3,            [r3 + 2 * r5 + 16]
+
+      paddw       m0,            m2
+      paddw       m1,            m3
+
+      packuswb    m0,            m1
+
+      movu        [r0 + 2 * r1], m0
+
+      lea         r0,            [r0 + 2 * r1]
+      lea         r2,            [r2 + 2 * r4]
+      lea         r3,            [r3 + 2 * r5]
+
+      pmovzxbw    m0,            [r2 + r4]
+      pmovzxbw    m1,            [r2 + r4 + 8]
+
+      movu        m2,            [r3 + r5]
+      movu        m3,            [r3 + r5 + 16]
+
+      paddw       m0,            m2
+      paddw       m1,            m3
+
+      packuswb    m0,            m1
+
+      movu        [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_W16_H4 16,  8
+PIXEL_ADD_PS_W16_H4 16, 12
+PIXEL_ADD_PS_W16_H4 16, 16
+PIXEL_ADD_PS_W16_H4 16, 32


More information about the x265-devel mailing list