[x265] [PATCH] pixel_add_ps_12x16, asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Fri Nov 22 10:35:57 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1385112945 -19800
# Node ID aaefb650f66bde878f6a2a2ece77541aed02a60c
# Parent  685deb56a701ed5b29174875563727ea73eb25fd
pixel_add_ps_12x16, asm code

diff -r 685deb56a701 -r aaefb650f66b source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Nov 22 14:57:19 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Fri Nov 22 15:05:45 2013 +0530
@@ -630,6 +630,7 @@
         p.chroma[X265_CSP_I420].add_ps[CHROMA_8x8] = x265_pixel_add_ps_8x8_sse4;
         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_12x16] = x265_pixel_add_ps_12x16_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;
diff -r 685deb56a701 -r aaefb650f66b source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Fri Nov 22 14:57:19 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Fri Nov 22 15:05:45 2013 +0530
@@ -530,6 +530,95 @@
 PIXEL_ADD_PS_W8_H4 8, 16
 PIXEL_ADD_PS_W8_H4 8, 32
 
+
+;-----------------------------------------------------------------------------
+; 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_W12_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]
+      movh        m3,                [r3 + 16]
+
+      paddw       m0,                m2
+      paddw       m1,                m3
+
+      packuswb    m0,                m1
+
+      movh        [r0],              m0
+      movhlps     m0,                m0
+      movd        [r0 + 8],          m0
+
+      pmovzxbw    m0,                [r2 + r4]
+      pmovzxbw    m1,                [r2 + r4 + 8]
+
+      movu        m2,                [r3 + r5]
+      movh        m3,                [r3 + r5 + 16]
+
+      paddw       m0,                m2
+      paddw       m1,                m3
+
+      packuswb    m0,                m1
+
+      movh        [r0 + r1],         m0
+      movhlps     m0,                m0
+      movd        [r0 + r1 + 8],     m0
+
+      pmovzxbw    m0,                [r2 + 2 * r4]
+      pmovzxbw    m1,                [r2 + 2 * r4 + 8]
+
+      movu        m2,                [r3 + 2 * r5]
+      movh        m3,                [r3 + 2 * r5 + 16]
+
+      paddw       m0,                m2
+      paddw       m1,                m3
+
+      packuswb    m0,                m1
+
+      movh        [r0 + 2 * r1],     m0
+      movhlps     m0,                m0
+      movd        [r0 + 2 * r1 + 8], 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]
+      movh        m3,                [r3 + r5 + 16]
+
+      paddw       m0,                m2
+      paddw       m1,                m3
+
+      packuswb    m0,                m1
+
+      movh        [r0 + r1],         m0
+      movhlps     m0,                m0
+      movd        [r0 + r1 + 8],     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_W12_H4 12, 16
+
 ;-----------------------------------------------------------------------------
 ; void pixel_add_ps_16x4(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list