[x265] [PATCH 01 of 11] asm: intra_pred_ang4_10_sse2

dtyx265 at gmail.com dtyx265 at gmail.com
Wed Apr 1 23:14:22 CEST 2015


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1427915495 25200
# Node ID e1c4c4e77ac10b73634e359b8f3d8bd4fe50958e
# Parent  9e3b73c1396b474f44c5d94099d3e74ed3516556
asm: intra_pred_ang4_10_sse2

This is backported from sse4 code and replaces c code.

64-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[10\]"
intra_ang_4x4[10]	5.87x 	 215.04   	 1261.43

32-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[10\]"
intra_ang_4x4[10]	7.53x 	 275.16   	 2070.89

diff -r 9e3b73c1396b -r e1c4c4e77ac1 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Apr 01 11:48:06 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp	Wed Apr 01 12:11:35 2015 -0700
@@ -1204,6 +1204,7 @@
         p.cu[BLOCK_4x4].intra_pred[7] = x265_intra_pred_ang4_7_sse2;
         p.cu[BLOCK_4x4].intra_pred[8] = x265_intra_pred_ang4_8_sse2;
         p.cu[BLOCK_4x4].intra_pred[9] = x265_intra_pred_ang4_9_sse2;
+        p.cu[BLOCK_4x4].intra_pred[10] = x265_intra_pred_ang4_10_sse2;
 
         p.cu[BLOCK_4x4].calcresidual = x265_getResidual4_sse2;
         p.cu[BLOCK_8x8].calcresidual = x265_getResidual8_sse2;
diff -r 9e3b73c1396b -r e1c4c4e77ac1 source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h	Wed Apr 01 11:48:06 2015 -0700
+++ b/source/common/x86/intrapred.h	Wed Apr 01 12:11:35 2015 -0700
@@ -55,6 +55,7 @@
 DECL_ANG(4, 7, sse2);
 DECL_ANG(4, 8, sse2);
 DECL_ANG(4, 9, sse2);
+DECL_ANG(4, 10, sse2);
 
 DECL_ANG(4, 2, ssse3);
 DECL_ANG(4, 3, sse4);
diff -r 9e3b73c1396b -r e1c4c4e77ac1 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Wed Apr 01 11:48:06 2015 -0700
+++ b/source/common/x86/intrapred8.asm	Wed Apr 01 12:11:35 2015 -0700
@@ -1544,6 +1544,36 @@
     mova        m7, [r3 +  4 * 16]  ; [ 8]
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
 
+cglobal intra_pred_ang4_10, 3,5,4
+    movd        m0, [r2 + 9]            ; [8 7 6 5 4 3 2 1]
+    punpcklbw   m0, m0
+    punpcklwd   m0, m0
+    pshufd      m1, m0, 1
+    movhlps     m2, m0
+    pshufd      m3, m0, 3
+    movd        [r0 + r1], m1
+    movd        [r0 + r1 * 2], m2
+    lea         r1, [r1 * 3]
+    movd        [r0 + r1], m3
+    cmp         r4m, byte 0
+    jz          .quit
+
+    ; filter
+    pxor        m3, m3
+    punpcklbw   m0, m3
+    movh        m1, [r2]                ; [4 3 2 1 0]
+    punpcklbw   m1, m3
+    pshuflw     m2, m1, 0x00
+    psrldq      m1, 2
+    psubw       m1, m2
+    psraw       m1, 1
+    paddw       m0, m1
+    packuswb    m0, m0
+
+.quit:
+    movd        [r0], m0
+    RET
+
 ;---------------------------------------------------------------------------------------------
 ; void intra_pred_dc(pixel* dst, intptr_t dstStride, pixel *srcPix, int dirMode, int bFilter)
 ;---------------------------------------------------------------------------------------------


More information about the x265-devel mailing list