[x265] [PATCH] pixel_add_ps, asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Thu Nov 21 11:06:19 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1385028318 -19800
# Node ID 98421b5f515c79e757ab4cf2b73f6b2ed1b2424b
# Parent  b31d8d6bc67203ca34a42a7672f1b057e69a6552
pixel_add_ps, asm code

diff -r b31d8d6bc672 -r 98421b5f515c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Nov 21 15:13:39 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Nov 21 15:35:18 2013 +0530
@@ -650,6 +650,7 @@
         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].add_ps[CHROMA_24x32] = x265_pixel_add_ps_24x32_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_32x8] = x265_pixel_add_ps_32x8_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_32x16] = x265_pixel_add_ps_32x16_sse4;
         p.chroma[X265_CSP_I420].add_ps[CHROMA_32x24] = x265_pixel_add_ps_32x24_sse4;
diff -r b31d8d6bc672 -r 98421b5f515c source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Thu Nov 21 15:13:39 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Thu Nov 21 15:35:18 2013 +0530
@@ -510,6 +510,67 @@
 PIXEL_ADD_PS_W16_H4 16, 16
 PIXEL_ADD_PS_W16_H4 16, 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_W24_H2 2
+INIT_XMM sse4
+cglobal pixel_add_ps_%1x%2, 6, 7, 6, dest, destride, src0, scr1, srcStride0, srcStride1
+
+add         r5,            r5
+
+mov         r6d,           %2/2
+
+.loop
+      pmovzxbw    m0,             [r2]
+      pmovzxbw    m1,             [r2 + 8]
+      pmovzxbw    m2,             [r2 + 16]
+
+      movu        m3,             [r3]
+      movu        m4,             [r3 + 16]
+      movu        m5,             [r3 + 32]
+
+      paddw       m0,             m3
+      paddw       m1,             m4
+      paddw       m2,             m5
+
+      packuswb    m0,             m1
+      packuswb    m2,             m2
+
+      movu        [r0],           m0
+      movh        [r0 + 16],      m2
+
+      pmovzxbw    m0,             [r2 + r4]
+      pmovzxbw    m1,             [r2 + r4 + 8]
+      pmovzxbw    m2,             [r2 + r4 + 16]
+
+      movu        m3,             [r3 + r5]
+      movu        m4,             [r3 + r5 + 16]
+      movu        m5,             [r3 + r5 + 32]
+
+      paddw       m0,             m3
+      paddw       m1,             m4
+      paddw       m2,             m5
+
+      packuswb    m0,             m1
+      packuswb    m2,             m2
+
+      movu        [r0 + r1],      m0
+      movh        [r0 + r1 + 16], m2
+
+      lea         r0,             [r0 + 2 * r1]
+      lea         r2,             [r2 + 2 * r4]
+      lea         r3,             [r3 + 2 * r5]
+
+      dec         r6d
+      jnz         .loop
+
+RET
+%endmacro
+
+PIXEL_ADD_PS_W24_H2 24, 32
+
 ;-----------------------------------------------------------------------------
 ; void pixel_add_ps_%1x%2(pixel *dest, intptr_t destride, pixel *src0, int16_t *scr1, intptr_t srcStride0, intptr_t srcStride1)
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list