[x265] [PATCH 16 of 18] asm: intra_pred_ang4_16_sse2 16-bit

dtyx265 at gmail.com dtyx265 at gmail.com
Fri Apr 3 18:24:47 CEST 2015


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1428077344 25200
# Node ID 97e3406e46539aefb8e1568fb49c452a63554887
# Parent  9ec19f6d4e3aeb7ae686626438158aa6d67c2cea
asm: intra_pred_ang4_16_sse2 16-bit

This is backported from sse4 code and replaces c code.

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[16\]"
intra_ang_4x4[16]	4.30x 	 502.59   	 2162.63

transposed mode

/test/TestBench --testbench intrapred | grep "intra_ang_4x4\[20\]"
intra_ang_4x4[20]	4.03x 	 420.12   	 1693.37

diff -r 9ec19f6d4e3a -r 97e3406e4653 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Apr 03 09:05:30 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp	Fri Apr 03 09:09:04 2015 -0700
@@ -896,6 +896,8 @@
         p.cu[BLOCK_4x4].intra_pred[13] = x265_intra_pred_ang4_13_sse2;
         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[20] = x265_intra_pred_ang4_16_sse2;
         p.cu[BLOCK_4x4].intra_pred[21] = x265_intra_pred_ang4_15_sse2;
         p.cu[BLOCK_4x4].intra_pred[22] = x265_intra_pred_ang4_14_sse2;
         p.cu[BLOCK_4x4].intra_pred[23] = x265_intra_pred_ang4_13_sse2;
diff -r 9ec19f6d4e3a -r 97e3406e4653 source/common/x86/intrapred16.asm
--- a/source/common/x86/intrapred16.asm	Fri Apr 03 09:05:30 2015 -0700
+++ b/source/common/x86/intrapred16.asm	Fri Apr 03 09:09:04 2015 -0700
@@ -1111,6 +1111,36 @@
     mova        m7, [r3 +  5 * 16]  ; [28]
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
 
+cglobal intra_pred_ang4_16, 3,5,8
+    xor         r4d, r4d
+    cmp         r3m, byte 20
+    mov         r3d, 16
+    jz          .next
+    xchg        r3d, r4d
+.next:
+    movd        m4, [r2]                ;[x x x A]
+    movd        m5, [r2 + r3 + 4]       ;[x x C B]
+    movh        m0, [r2 + r4 + 2]       ;[4 3 2 1]
+    punpcklwd   m5, m4                  ;[x C A B]
+    pshuflw     m5, m5, 0x4A            ;[A B C C]
+    punpcklqdq  m5, m0                  ;[4 3 2 1 A B C C]
+    psrldq      m5, 2
+    mova        m2, m5
+    mova        m3, m5
+    psrldq      m2, 4
+    psrldq      m3, 2
+    punpcklwd   m5, m3          ; [2 1 1 0 0 x x y]
+    punpcklwd   m3, m2          ; [3 2 2 1 1 0 0 x]
+    punpcklwd   m2, m0          ; [4 3 3 2 2 1 1 0]
+    mova        m4, m3
+
+    lea         r3, [ang_table + 19 * 16]
+    mova        m0, [r3 -  8 * 16]  ; [11]
+    mova        m1, [r3 +  3 * 16]  ; [22]
+    mova        m6, [r3 - 18 * 16]  ; [ 1]
+    mova        m7, [r3 -  7 * 16]  ; [12]
+    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
+
 ;-----------------------------------------------------------------------------------
 ; void intra_pred_dc(pixel* dst, intptr_t dstStride, pixel* above, int, int filter)
 ;-----------------------------------------------------------------------------------


More information about the x265-devel mailing list