[x265] [PATCH] pixel_add_ps, 8x8, 8x16, 8x32 asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 20 15:18:32 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384957102 -19800
# Node ID 9653a7ecef70ad72f0f34b6214a805cb52844bbf
# Parent  bece58e29da2e749c76a320b9985b5fad3ffec5e
pixel_add_ps, 8x8, 8x16, 8x32 asm code

diff -r bece58e29da2 -r 9653a7ecef70 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Nov 20 19:35:08 2013 +0530
+++ b/source/common/x86/asm-primitives.cpp	Wed Nov 20 19:48:22 2013 +0530
@@ -646,6 +646,9 @@
         p.chroma_add_ps[X265_CSP_I420][CHROMA_8x2] = x265_pixel_add_ps_8x2_sse4;
         p.chroma_add_ps[X265_CSP_I420][CHROMA_8x4] = x265_pixel_add_ps_8x4_sse4;
         p.chroma_add_ps[X265_CSP_I420][CHROMA_8x6] = x265_pixel_add_ps_8x6_sse4;
+        p.chroma_add_ps[X265_CSP_I420][CHROMA_8x8] = x265_pixel_add_ps_8x8_sse4;
+        p.chroma_add_ps[X265_CSP_I420][CHROMA_8x16] = x265_pixel_add_ps_8x16_sse4;
+        p.chroma_add_ps[X265_CSP_I420][CHROMA_8x32] = x265_pixel_add_ps_8x32_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
     {
diff -r bece58e29da2 -r 9653a7ecef70 source/common/x86/pixeladd8.asm
--- a/source/common/x86/pixeladd8.asm	Wed Nov 20 19:35:08 2013 +0530
+++ b/source/common/x86/pixeladd8.asm	Wed Nov 20 19:48:22 2013 +0530
@@ -299,3 +299,65 @@
 movh        [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_W8_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]
+      movu        m1,            [r3]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movh        [r0],          m0
+
+      pmovzxbw    m0,            [r2 + r4]
+      movu        m1,            [r3 + r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movh        [r0 + r1],     m0
+
+      pmovzxbw    m0,            [r2 + 2 * r4]
+      movu        m1,            [r3 + 2 * r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movh        [r0 + 2 * r1], m0
+
+      lea         r0,            [r0 + 2 * r1]
+      lea         r2,            [r2 + 2 * r4]
+      lea         r3,            [r3 + 2 * r5]
+
+      pmovzxbw    m0,            [r2 + r4]
+      movu        m1,            [r3 + r5]
+
+      paddw       m0,            m1
+      packuswb    m0,            m0
+
+      movh        [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_W8_H4 8,  8
+PIXEL_ADD_PS_W8_H4 8, 16
+PIXEL_ADD_PS_W8_H4 8, 32


More information about the x265-devel mailing list