[x265] [PATCH 09 of 11] asm: intra_pred_ang4_20 improved by ~52% over SSE4

praveen at multicorewareinc.com praveen at multicorewareinc.com
Thu Apr 2 12:49:43 CEST 2015


# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1427962556 -19800
#      Thu Apr 02 13:45:56 2015 +0530
# Node ID f1c4ba178fe9fff0a065377a2b0ff10966d211c4
# Parent  24026838a60c28507f79bc6dd7a3df608e0b134f
asm: intra_pred_ang4_20 improved by ~52% over SSE4

AVX2:
intra_ang_4x4[20]       9.41x    92.60           871.12

SSE4:
intra_ang_4x4[20]       4.55x    190.01          864.54

diff -r 24026838a60c -r f1c4ba178fe9 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Apr 02 13:31:14 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Apr 02 13:45:56 2015 +0530
@@ -1606,6 +1606,7 @@
         p.weight_pp = x265_weight_pp_avx2;
 
         // intra_pred functions
+        p.cu[BLOCK_4x4].intra_pred[20] = x265_intra_pred_ang4_20_avx2;
         p.cu[BLOCK_4x4].intra_pred[21] = x265_intra_pred_ang4_21_avx2;
         p.cu[BLOCK_4x4].intra_pred[22] = x265_intra_pred_ang4_22_avx2;
         p.cu[BLOCK_4x4].intra_pred[23] = x265_intra_pred_ang4_23_avx2;
diff -r 24026838a60c -r f1c4ba178fe9 source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h	Thu Apr 02 13:31:14 2015 +0530
+++ b/source/common/x86/intrapred.h	Thu Apr 02 13:45:56 2015 +0530
@@ -174,6 +174,7 @@
 DECL_ANG(32, 33, sse4);
 
 #undef DECL_ANG
+void x265_intra_pred_ang4_20_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_intra_pred_ang4_21_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_intra_pred_ang4_22_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_intra_pred_ang4_23_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
diff -r 24026838a60c -r f1c4ba178fe9 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Thu Apr 02 13:31:14 2015 +0530
+++ b/source/common/x86/intrapred8.asm	Thu Apr 02 13:45:56 2015 +0530
@@ -516,6 +516,7 @@
 intra_pred4_shuff2:      db 0, 1, 1, 2, 2, 3, 3, 4, 0, 1, 1, 2, 2, 3, 3, 4, 1, 2, 2, 3, 3, 4, 4, 5, 1, 2, 2, 3, 3, 4, 4, 5
 intra_pred4_shuff31:     db 0, 1, 1, 2, 2, 3, 3, 4, 1, 2, 2, 3, 3, 4, 4, 5, 1, 2, 2, 3, 3, 4, 4, 5, 2, 3, 3, 4, 4, 5, 5, 6
 intra_pred4_shuff33:     db 0, 1, 1, 2, 2, 3, 3, 4, 1, 2, 2, 3, 3, 4, 4, 5, 2, 3, 3, 4, 4, 5, 5, 6, 3, 4, 4, 5, 5, 6, 6, 7
+intra_pred4_shuff20:     db 0, 1, 1, 2, 2, 3, 3, 4, 10, 0, 0, 1, 1, 2, 2, 3, 10, 0, 0, 1, 1, 2, 2, 3, 11, 10, 10, 0, 0, 1, 1, 2
 intra_pred4_shuff21:     db 0, 1, 1, 2, 2, 3, 3, 4, 10, 0, 0, 1, 1, 2, 2, 3, 10, 0, 0, 1, 1, 2, 2, 3, 12, 10, 10, 0, 0, 1, 1, 2
 intra_pred4_shuff22:     db 0, 1, 1, 2, 2, 3, 3, 4, 0, 1, 1, 2, 2, 3, 3, 4, 10, 0, 0, 1, 1, 2, 2, 3, 10, 0, 0, 1, 1, 2, 2, 3
 intra_pred4_shuff23:     db 0, 1, 1, 2, 2, 3, 3, 4, 0, 1, 1, 2, 2, 3, 3, 4, 0, 1, 1, 2, 2, 3, 3, 4, 12, 0, 0, 1, 1, 2, 2, 3
@@ -527,6 +528,7 @@
 c_ang4_mode_31:          db 15, 17, 15, 17, 15, 17, 15, 17, 30, 2, 30, 2, 30, 2, 30, 2, 13, 19, 13, 19, 13, 19, 13, 19, 28, 4, 28, 4, 28, 4, 28, 4
 c_ang4_mode_32:          db 11, 21, 11, 21, 11, 21, 11, 21, 22, 10, 22, 10, 22, 10, 22, 10, 1, 31, 1, 31, 1, 31, 1, 31, 12, 20, 12, 20, 12, 20, 12, 20
 c_ang4_mode_33:          db 6, 26, 6, 26, 6, 26, 6, 26, 12, 20, 12, 20, 12, 20, 12, 20, 18, 14, 18, 14, 18, 14, 18, 14, 24, 8, 24, 8, 24, 8, 24, 8
+c_ang4_mode_20:          db 21, 11, 21, 11, 21, 11, 21, 11, 10, 22, 10, 22, 10, 22, 10, 22, 31, 1, 31, 1, 31, 1, 31, 1, 20, 12, 20, 12, 20, 12, 20, 12
 c_ang4_mode_21:          db 17, 15, 17, 15, 17, 15, 17, 15, 2, 30, 2, 30, 2, 30, 2, 30, 19, 13, 19, 13, 19, 13, 19, 13, 4, 28, 4, 28, 4, 28, 4, 28
 c_ang4_mode_22:          db 13, 19, 13, 19, 13, 19, 13, 19, 26, 6, 26, 6, 26, 6, 26, 6, 7, 25, 7, 25, 7, 25, 7, 25, 20, 12, 20, 12, 20, 12, 20, 12
 c_ang4_mode_23:          db 9, 23, 9, 23, 9, 23, 9, 23, 18, 14, 18, 14, 18, 14, 18, 14, 27, 5, 27, 5, 27, 5, 27, 5, 4, 28, 4, 28, 4, 28, 4, 28
@@ -15606,6 +15608,23 @@
     RET
 
 
+
+INIT_YMM avx2
+cglobal intra_pred_ang4_20, 3, 3, 1
+    vbroadcasti128    m0, [r2]
+    pshufb            m0, [intra_pred4_shuff20]
+    pmaddubsw         m0, [c_ang4_mode_20]
+    pmulhrsw          m0, [pw_1024]
+    packuswb          m0, m0
+
+    movd              [r0], xm0
+    pextrd            [r0 + r1], xm0, 1
+    vextracti128      xm0, m0, 1
+    lea               r0, [r0 + 2 * r1]
+    movd              [r0], xm0
+    pextrd            [r0 + r1], xm0, 1
+    RET
+
 INIT_YMM avx2
 cglobal intra_pred_ang4_21, 3, 3, 1
     vbroadcasti128    m0, [r2]


More information about the x265-devel mailing list