[x265] [PATCH 09 of 11] asm: intra_pred_ang4_17_sse2

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


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1427509373 25200
# Node ID 89f337fa1d295b161d4800cc28674c9d02d4c6a9
# Parent  4a4f7a2263c939b6a50f5c56c223cace78b01c0c
asm: intra_pred_ang4_17_sse2

This is backported from sse4 code and replaces c code.

64-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[17\]"
intra_ang_4x4[17]	2.96x 	 732.50   	 2165.32

32-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[17\]"
intra_ang_4x4[17]	3.89x 	 795.00   	 3093.16

diff -r 4a4f7a2263c9 -r 89f337fa1d29 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Mar 27 19:13:47 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp	Fri Mar 27 19:22:53 2015 -0700
@@ -1211,6 +1211,7 @@
         p.cu[BLOCK_4x4].intra_pred[14] = x265_intra_pred_ang4_14_sse2;
         p.cu[BLOCK_4x4].intra_pred[15] = x265_intra_pred_ang4_15_sse2;
         p.cu[BLOCK_4x4].intra_pred[16] = x265_intra_pred_ang4_16_sse2;
+        p.cu[BLOCK_4x4].intra_pred[17] = x265_intra_pred_ang4_17_sse2;
         p.cu[BLOCK_4x4].intra_pred[26] = x265_intra_pred_ang4_26_sse2;
 
         p.cu[BLOCK_4x4].calcresidual = x265_getResidual4_sse2;
diff -r 4a4f7a2263c9 -r 89f337fa1d29 source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h	Fri Mar 27 19:13:47 2015 -0700
+++ b/source/common/x86/intrapred.h	Fri Mar 27 19:22:53 2015 -0700
@@ -62,6 +62,7 @@
 DECL_ANG(4, 14, sse2);
 DECL_ANG(4, 15, sse2);
 DECL_ANG(4, 16, sse2);
+DECL_ANG(4, 17, sse2);
 DECL_ANG(4, 26, sse2);
 
 DECL_ANG(4, 2, ssse3);
diff -r 4a4f7a2263c9 -r 89f337fa1d29 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Fri Mar 27 19:13:47 2015 -0700
+++ b/source/common/x86/intrapred8.asm	Fri Mar 27 19:22:53 2015 -0700
@@ -1716,6 +1716,41 @@
     mova        m7, [r3 -  7 * 16]  ; [12]
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
 
+cglobal intra_pred_ang4_17, 4,5,8
+    xor         r4d, r4d
+    cmp         r3m, byte 19
+    mov         r3d, 8
+    jz          .next
+    xchg        r3d, r4d
+
+.next:
+    movd        m2, [r2]                ;[x x x A]
+    movd        m3, [r2 + r3 + 1]       ;[x x x B]
+    movd        m4, [r2 + r3 + 2]       ;[x x x C]
+    movd        m0, [r2 + r3 + 4]       ;[x x x D]
+    punpcklbw   m3, m2                  ;[x x A B]
+    punpcklbw   m0, m4                  ;[x x C D]
+    punpcklwd   m0, m3                  ;[A B C D]
+    movd        m1, [r2 + r4 + 1]       ;[4 3 2 1]
+    punpckldq   m0, m1                  ;[4 3 2 1 A B C D]
+    punpcklbw   m0, m0                  ;[4 4 3 3 2 2 1 1 A A B B C C D D]
+    psrldq      m0, 1
+    movh        m1, m0
+    psrldq      m0, 2
+    movh        m2, m0
+    punpcklqdq  m2, m1
+    psrldq      m0, 2
+    movh        m1, m0
+    psrldq      m0, 2
+    punpcklqdq  m0, m1
+
+    lea         r3, [pw_ang_table + 14 * 16]
+    mova        m4, [r3 -  8 * 16]  ; [ 6]
+    mova        m5, [r3 -  2 * 16]  ; [12]
+    mova        m6, [r3 +  4 * 16]  ; [18]
+    mova        m7, [r3 + 10 * 16]  ; [24]
+    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
+
 ;---------------------------------------------------------------------------------------------
 ; void intra_pred_dc(pixel* dst, intptr_t dstStride, pixel *srcPix, int dirMode, int bFilter)
 ;---------------------------------------------------------------------------------------------


More information about the x265-devel mailing list