[x265] [PATCH] asm: psyCost_pp_8x8 in sse4: improve 6425c->928c

Divya Manivannan divya at multicorewareinc.com
Tue Dec 30 06:40:06 CET 2014


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1419917965 -19800
#      Tue Dec 30 11:09:25 2014 +0530
# Node ID 0fe68395d98afda88407a7d2bfd4a3f665adf2d1
# Parent  32ed3f21039a5b93a54da8961442825e4db69d88
asm: psyCost_pp_8x8 in sse4: improve 6425c->928c

diff -r 32ed3f21039a -r 0fe68395d98a source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Dec 29 13:49:02 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Dec 30 11:09:25 2014 +0530
@@ -1719,6 +1719,7 @@
 //        p.denoiseDct = x265_denoise_dct_sse4;
 
         p.psy_cost_pp[BLOCK_4x4] = x265_psyCost_pp_4x4_sse4;
+        p.psy_cost_pp[BLOCK_8x8] = x265_psyCost_pp_8x8_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
     {
diff -r 32ed3f21039a -r 0fe68395d98a source/common/x86/pixel-a.asm
--- a/source/common/x86/pixel-a.asm	Mon Dec 29 13:49:02 2014 +0530
+++ b/source/common/x86/pixel-a.asm	Tue Dec 30 11:09:25 2014 +0530
@@ -6743,3 +6743,105 @@
     movd            eax, m0
 %endif ; HIGH_BIT_DEPTH
     RET
+
+%if ARCH_X86_64
+INIT_XMM sse4
+cglobal psyCost_pp_8x8, 4, 6, 13
+
+    FIX_STRIDES r1, r3
+    lea             r4, [3 * r1]
+    mova            m8, [hmul_8p]
+
+    movddup         m0, [r0]
+    movddup         m1, [r0 + r1]
+    movddup         m2, [r0 + r1 * 2]
+    movddup         m3, [r0 + r4]
+    lea             r5, [r0 + r1 * 4]
+    movddup         m4, [r5]
+    movddup         m5, [r5 + r1]
+    movddup         m6, [r5 + r1 * 2]
+    movddup         m7, [r5 + r4]
+
+    pmaddubsw       m0, m8
+    pmaddubsw       m1, m8
+    pmaddubsw       m2, m8
+    pmaddubsw       m3, m8
+    pmaddubsw       m4, m8
+    pmaddubsw       m5, m8
+    pmaddubsw       m6, m8
+    pmaddubsw       m7, m8
+
+    paddw           m11, m0, m1
+    paddw           m11, m2
+    paddw           m11, m3
+    paddw           m11, m4
+    paddw           m11, m5
+    paddw           m11, m6
+    paddw           m11, m7
+
+    pmaddwd         m11, [pw_1]
+    psrldq          m10, m11, 4
+    paddd           m11, m10
+    psrld           m11, 2
+
+    HADAMARD8_2D_HMUL 0, 1, 2, 3, 4, 5, 6, 7, 9, 10
+
+    paddw           m0, m1
+    paddw           m0, m2
+    paddw           m0, m3
+    HADDW m0, m1
+
+    paddd           m0, [pd_1]
+    psrld           m0, 1
+    psubd           m12, m0, m11
+
+    lea             r4, [3 * r3]
+
+    movddup         m0, [r2]
+    movddup         m1, [r2 + r3]
+    movddup         m2, [r2 + r3 * 2]
+    movddup         m3, [r2 + r4]
+    lea             r5, [r2 + r3 * 4]
+    movddup         m4, [r5]
+    movddup         m5, [r5 + r3]
+    movddup         m6, [r5 + r3 * 2]
+    movddup         m7, [r5 + r4]
+
+    pmaddubsw       m0, m8
+    pmaddubsw       m1, m8
+    pmaddubsw       m2, m8
+    pmaddubsw       m3, m8
+    pmaddubsw       m4, m8
+    pmaddubsw       m5, m8
+    pmaddubsw       m6, m8
+    pmaddubsw       m7, m8
+
+    paddw           m11, m0, m1
+    paddw           m11, m2
+    paddw           m11, m3
+    paddw           m11, m4
+    paddw           m11, m5
+    paddw           m11, m6
+    paddw           m11, m7
+
+    pmaddwd         m11, [pw_1]
+    psrldq          m10, m11, 4
+    paddd           m11, m10
+    psrld           m11, 2
+
+    HADAMARD8_2D_HMUL 0, 1, 2, 3, 4, 5, 6, 7, 9, 10
+
+    paddw           m0, m1
+    paddw           m0, m2
+    paddw           m0, m3
+    HADDW m0, m1
+
+    paddd           m0, [pd_1]
+    psrld           m0, 1
+    psubd           m0, m11
+    psubd           m12, m0
+    pabsd           m0, m12
+    movd            eax, m0
+
+    RET
+%endif
diff -r 32ed3f21039a -r 0fe68395d98a source/common/x86/pixel.h
--- a/source/common/x86/pixel.h	Mon Dec 29 13:49:02 2014 +0530
+++ b/source/common/x86/pixel.h	Tue Dec 30 11:09:25 2014 +0530
@@ -219,6 +219,7 @@
 void x265_downShift_16_sse2(const uint16_t* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int width, int height, int shift, uint16_t mask);
 void x265_upShift_8_sse4(const uint8_t* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int width, int height, int shift);
 int x265_psyCost_pp_4x4_sse4(const pixel* source, intptr_t sstride, const pixel* recon, intptr_t rstride);
+int x265_psyCost_pp_8x8_sse4(const pixel* source, intptr_t sstride, const pixel* recon, intptr_t rstride);
 
 #undef DECL_PIXELS
 #undef DECL_HEVC_SSD


More information about the x265-devel mailing list