[x265] [PATCH 1 of 2] asm: intra_pred_ang8_20 improved by ~4% over SSE4
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Fri Apr 10 15:50:48 CEST 2015
# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1428647479 -19800
# Fri Apr 10 12:01:19 2015 +0530
# Node ID c25751eb5a1ab4b19a171e9f35f149b408c4c19e
# Parent 984e254f93f7cedc5a9b00851d2e14b49dc94e91
asm: intra_pred_ang8_20 improved by ~4% over SSE4
AVX2:
intra_ang_8x8[20] 7.98x 256.94 2050.52
SSE4:
intra_ang_8x8[20] 7.59x 267.77 2031.49
diff -r 984e254f93f7 -r c25751eb5a1a source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Thu Apr 09 11:48:08 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp Fri Apr 10 12:01:19 2015 +0530
@@ -1769,6 +1769,7 @@
p.cu[BLOCK_8x8].intra_pred[24] = x265_intra_pred_ang8_24_avx2;
p.cu[BLOCK_8x8].intra_pred[11] = x265_intra_pred_ang8_11_avx2;
p.cu[BLOCK_8x8].intra_pred[13] = x265_intra_pred_ang8_13_avx2;
+ p.cu[BLOCK_8x8].intra_pred[20] = x265_intra_pred_ang8_20_avx2;
p.cu[BLOCK_8x8].intra_pred[21] = x265_intra_pred_ang8_21_avx2;
p.cu[BLOCK_8x8].intra_pred[22] = x265_intra_pred_ang8_22_avx2;
p.cu[BLOCK_8x8].intra_pred[23] = x265_intra_pred_ang8_23_avx2;
diff -r 984e254f93f7 -r c25751eb5a1a source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h Thu Apr 09 11:48:08 2015 -0500
+++ b/source/common/x86/intrapred.h Fri Apr 10 12:01:19 2015 +0530
@@ -236,6 +236,7 @@
void x265_intra_pred_ang8_13_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_14_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_15_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
+void x265_intra_pred_ang8_20_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_21_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_22_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_23_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
diff -r 984e254f93f7 -r c25751eb5a1a source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm Thu Apr 09 11:48:08 2015 -0500
+++ b/source/common/x86/intrapred8.asm Fri Apr 10 12:01:19 2015 +0530
@@ -690,6 +690,12 @@
db 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 6, 26, 6, 26, 6, 26, 6, 26, 6, 26, 6, 26, 6, 26, 6, 26
db 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24
+ALIGN 32
+c_ang8_mode_20: db 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 21, 11, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22
+ db 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 20, 12, 20, 12, 20, 12, 20, 12, 20, 12, 20, 12, 20, 12, 20, 12
+ db 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 30, 2, 30, 2, 30, 2, 30, 2, 30, 2, 30, 2, 30, 2, 30, 2
+ db 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24
+
const ang_table
%assign x 0
%rep 32
@@ -11945,6 +11951,61 @@
movhps [r0 + r3], xm2
RET
+
+INIT_YMM avx2
+cglobal intra_pred_ang8_20, 3, 6, 6
+ mova m3, [pw_1024]
+ movu xm5, [r2]
+ lea r5, [intra_pred_shuff_0_8]
+ mova xm0, xm5
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 2 + 16], 0
+ vinserti128 m0, m0, xm5, 1
+ pshufb m0, [r5]
+
+ lea r4, [c_ang8_mode_20]
+ pmaddubsw m1, m0, [r4]
+ pmulhrsw m1, m3
+ mova xm0, xm5
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 3 + 16], 0
+ vinserti128 m0, m0, xm5, 1
+ pshufb m0, [r5]
+ pmaddubsw m2, m0, [r4 + mmsize]
+ pmulhrsw m2, m3
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 5 + 16], 0
+ vinserti128 m0, m5, xm5, 1
+ pshufb m0, [r5]
+ pmaddubsw m4, m0, [r4 + 2 * mmsize]
+ pmulhrsw m4, m3
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 6 + 16], 0
+ mova xm0, xm5
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 8 + 16], 0
+ vinserti128 m0, m0, xm5, 1
+ pshufb m0, [r5]
+ pmaddubsw m0, [r4 + 3 * mmsize]
+ pmulhrsw m0, m3
+
+ packuswb m1, m2
+ packuswb m4, m0
+
+ lea r3, [3 * r1]
+ movq [r0], xm1
+ vextracti128 xm2, m1, 1
+ movq [r0 + r1], xm2
+ movhps [r0 + 2 * r1], xm1
+ movhps [r0 + r3], xm2
+ lea r0, [r0 + 4 * r1]
+ movq [r0], xm4
+ vextracti128 xm2, m4, 1
+ movq [r0 + r1], xm2
+ movhps [r0 + 2 * r1], xm4
+ movhps [r0 + r3], xm2
+ RET
+
INIT_YMM avx2
cglobal intra_pred_ang8_21, 3, 6, 6
mova m3, [pw_1024]
More information about the x265-devel
mailing list