[x265] [PATCH 4 of 9] asm: intra_pred_ang8_13 improved by ~16% over SSE4
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Thu Apr 9 15:20:12 CEST 2015
# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1428575027 -19800
# Thu Apr 09 15:53:47 2015 +0530
# Node ID 79c8c583603a8dda7fe22973b55b18d9ff08cc64
# Parent 6f9c3e9aec5218f89389c6f1f363b86181fc20cf
asm: intra_pred_ang8_13 improved by ~16% over SSE4
AVX2:
intra_ang_8x8[13] 10.68x 297.95 3183.33
SSE4:
intra_ang_8x8[13] 9.16x 352.32 3225.62
diff -r 6f9c3e9aec52 -r 79c8c583603a source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Thu Apr 09 13:28:56 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp Thu Apr 09 15:53:47 2015 +0530
@@ -1764,6 +1764,7 @@
p.cu[BLOCK_8x8].intra_pred[12] = x265_intra_pred_ang8_12_avx2;
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_16x16].intra_pred[3] = x265_intra_pred_ang16_3_avx2;
p.cu[BLOCK_16x16].intra_pred[4] = x265_intra_pred_ang16_4_avx2;
p.cu[BLOCK_16x16].intra_pred[5] = x265_intra_pred_ang16_5_avx2;
diff -r 6f9c3e9aec52 -r 79c8c583603a source/common/x86/intrapred.h
--- a/source/common/x86/intrapred.h Thu Apr 09 13:28:56 2015 +0530
+++ b/source/common/x86/intrapred.h Thu Apr 09 15:53:47 2015 +0530
@@ -233,6 +233,7 @@
void x265_intra_pred_ang8_12_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_24_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang8_11_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
+void x265_intra_pred_ang8_13_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang16_3_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang16_4_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
void x265_intra_pred_ang16_5_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
diff -r 6f9c3e9aec52 -r 79c8c583603a source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm Thu Apr 09 13:28:56 2015 +0530
+++ b/source/common/x86/intrapred8.asm Thu Apr 09 15:53:47 2015 +0530
@@ -672,6 +672,11 @@
pw_planar32_L: dw 31, 30, 29, 28, 27, 26, 25, 24
pw_planar32_H: dw 23, 22, 21, 20, 19, 18, 17, 16
+ALIGN 32
+c_ang8_mode_13: db 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 9, 23, 18, 14, 18, 14, 18, 14, 18, 14, 18, 14, 18, 14, 18, 14, 18, 14
+ db 27, 5, 27, 5, 27, 5, 27, 5, 27, 5, 27, 5, 27, 5, 27, 5, 4, 28, 4, 28, 4, 28, 4, 28, 4, 28, 4, 28, 4, 28, 4, 28
+ db 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 13, 19, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10, 22, 10
+ db 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24
const ang_table
%assign x 0
@@ -11866,6 +11871,61 @@
RET
+
+INIT_YMM avx2
+cglobal intra_pred_ang8_13, 3, 6, 6
+ mova m3, [pw_1024]
+ movu xm5, [r2 + 16]
+ pinsrb xm5, [r2], 0
+ lea r5, [intra_pred_shuff_0_8]
+ vinserti128 m0, m5, xm5, 1
+ pshufb m0, [r5]
+
+ lea r4, [c_ang8_mode_13]
+ pmaddubsw m1, m0, [r4]
+ pmulhrsw m1, m3
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 4], 0
+ pshufb xm4, xm5, [r5]
+ vinserti128 m0, m0, xm4, 1
+ pmaddubsw m2, m0, [r4 + mmsize]
+ pmulhrsw m2, m3
+ vinserti128 m0, m0, xm4, 0
+ pmaddubsw m4, m0, [r4 + 2 * mmsize]
+ pmulhrsw m4, m3
+ pslldq xm5, 1
+ pinsrb xm5, [r2 + 7], 0
+ pshufb xm5, [r5]
+ vinserti128 m0, m0, xm5, 1
+ pmaddubsw m0, [r4 + 3 * mmsize]
+ pmulhrsw m0, m3
+ packuswb m1, m2
+ packuswb m4, m0
+
+ vperm2i128 m2, m1, m4, 00100000b
+ vperm2i128 m1, m1, m4, 00110001b
+ punpcklbw m4, m2, m1
+ punpckhbw m2, m1
+ punpcklwd m1, m4, m2
+ punpckhwd m4, m2
+ mova m0, [trans8_shuf]
+ vpermd m1, m0, m1
+ vpermd m4, m0, m4
+
+ lea r3, [3 * r1]
+ movq [r0], xm1
+ movhps [r0 + r1], xm1
+ vextracti128 xm2, m1, 1
+ movq [r0 + 2 * r1], xm2
+ movhps [r0 + r3], xm2
+ lea r0, [r0 + 4 * r1]
+ movq [r0], xm4
+ movhps [r0 + r1], xm4
+ vextracti128 xm2, m4, 1
+ movq [r0 + 2 * r1], xm2
+ movhps [r0 + r3], xm2
+ RET
+
INIT_YMM avx2
cglobal intra_pred_ang8_12, 3, 5, 5
mova m3, [pw_1024]
More information about the x265-devel
mailing list