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

dtyx265 at gmail.com dtyx265 at gmail.com
Sat Mar 28 03:42:41 CET 2015


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1427503866 25200
# Node ID d7fee58a8466d6862e72cced5a4aa12e37294d4e
# Parent  dc7a6c5fbda13173004e6193f185ea857d7a22c8
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]	6.16x 	 215.12   	 1326.19

32-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[10\]"
intra_ang_4x4[10]	6.91x 	 290.06   	 2004.46

diff -r dc7a6c5fbda1 -r d7fee58a8466 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Mar 26 11:24:23 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Fri Mar 27 17:51:06 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 dc7a6c5fbda1 -r d7fee58a8466 source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h	Thu Mar 26 11:24:23 2015 -0500
+++ b/source/common/x86/intrapred.h	Fri Mar 27 17:51:06 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 dc7a6c5fbda1 -r d7fee58a8466 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Thu Mar 26 11:24:23 2015 -0500
+++ b/source/common/x86/intrapred8.asm	Fri Mar 27 17:51:06 2015 -0700
@@ -1482,6 +1482,36 @@
     mova        m7, [r3 +  4 * 16]  ; [ 8]
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
 
+cglobal intra_pred_ang4_10, 5,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