[x265] [PATCH 8 of 8] asm:intra_pred_ang4_9_sse2

dtyx265 at gmail.com dtyx265 at gmail.com
Mon Mar 23 21:30:36 CET 2015


# HG changeset patch
# User David T Yuen <dtyx265 at gmail.com>
# Date 1427142515 25200
# Node ID 0d08ce644f573368c7b6702eb4704af0404c1e87
# Parent  285479649d24146867b809d7a00644ff5c645656
asm:intra_pred_ang4_9_sse2

This is backported from sse4 code and replaces c code.

64-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[ 9\]"
intra_ang_4x4[ 9]	2.97x 	 645.00   	 1917.47

32-bit

./test/TestBench --testbench intrapred | grep "intra_ang_4x4\[ 9\]"
intra_ang_4x4[ 9]	4.03x 	 722.50   	 2910.00

diff -r 285479649d24 -r 0d08ce644f57 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Mar 23 13:22:23 2015 -0700
+++ b/source/common/x86/asm-primitives.cpp	Mon Mar 23 13:28:35 2015 -0700
@@ -1203,6 +1203,7 @@
         p.cu[BLOCK_4x4].intra_pred[6] = x265_intra_pred_ang4_6_sse2;
         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].calcresidual = x265_getResidual4_sse2;
         p.cu[BLOCK_8x8].calcresidual = x265_getResidual8_sse2;
diff -r 285479649d24 -r 0d08ce644f57 source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h	Mon Mar 23 13:22:23 2015 -0700
+++ b/source/common/x86/intrapred.h	Mon Mar 23 13:28:35 2015 -0700
@@ -54,6 +54,7 @@
 DECL_ANG(4, 6, sse2);
 DECL_ANG(4, 7, sse2);
 DECL_ANG(4, 8, sse2);
+DECL_ANG(4, 9, sse2);
 
 DECL_ANG(4, 2, ssse3);
 DECL_ANG(4, 3, sse4);
diff -r 285479649d24 -r 0d08ce644f57 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Mon Mar 23 13:22:23 2015 -0700
+++ b/source/common/x86/intrapred8.asm	Mon Mar 23 13:28:35 2015 -0700
@@ -1332,6 +1332,27 @@
     mova        m7, [r3 +  7 * 16]  ; [20]
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang4_3 %+ SUFFIX %+ .do_filter4x4)
 
+cglobal intra_pred_ang4_9, 3,5,8
+    xor         r4, r4
+    inc         r4
+    cmp         r3m, byte 27
+    mov         r3, 9
+    cmove       r3, r4
+
+    movh        m0, [r2 + r3]    ; [8 7 6 5 4 3 2 1]
+    mova        m1, m0
+    psrldq      m1, 1           ; [x 8 7 6 5 4 3 2]
+    punpcklbw   m0, m1          ; [x 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
+    punpcklqdq  m0, m0
+    mova        m2, m0
+
+    lea         r3, [pw_ang_table + 4 * 16]
+    mova        m4, [r3 -  2 * 16]  ; [ 2]
+    mova        m5, [r3 -  0 * 16]  ; [ 4]
+    mova        m6, [r3 +  2 * 16]  ; [ 6]
+    mova        m7, [r3 +  4 * 16]  ; [ 8]
+    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