[x265] [PATCH] asm: intra_pred_ang8 asm code for all modes
yuvaraj at multicorewareinc.com
yuvaraj at multicorewareinc.com
Tue Feb 4 10:44:11 CET 2014
# HG changeset patch
# User Yuvaraj Venkatesh <yuvaraj at multicorewareinc.com>
# Date 1391506867 -19800
# Tue Feb 04 15:11:07 2014 +0530
# Node ID dfd99758ba3bca5ab88d04a621bb8694e97931e9
# Parent ff430d39d4280f01dbcd57cfbe3f6f45f4fbe6a1
asm: intra_pred_ang8 asm code for all modes
diff -r ff430d39d428 -r dfd99758ba3b source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Mon Feb 03 23:59:51 2014 -0600
+++ b/source/common/x86/asm-primitives.cpp Tue Feb 04 15:11:07 2014 +0530
@@ -1080,6 +1080,31 @@
SETUP_INTRA_ANG8(3, 3, sse4);
SETUP_INTRA_ANG8(4, 4, sse4);
SETUP_INTRA_ANG8(5, 5, sse4);
+ SETUP_INTRA_ANG8(6, 6, sse4);
+ SETUP_INTRA_ANG8(7, 7, sse4);
+ SETUP_INTRA_ANG8(8, 8, sse4);
+ SETUP_INTRA_ANG8(9, 9, sse4);
+ SETUP_INTRA_ANG8(10, 10, sse4);
+ SETUP_INTRA_ANG8(11, 11, sse4);
+ SETUP_INTRA_ANG8(12, 12, sse4);
+ SETUP_INTRA_ANG8(13, 13, sse4);
+ SETUP_INTRA_ANG8(14, 14, sse4);
+ SETUP_INTRA_ANG8(15, 15, sse4);
+ SETUP_INTRA_ANG8(16, 16, sse4);
+ SETUP_INTRA_ANG8(17, 17, sse4);
+ SETUP_INTRA_ANG8(18, 18, sse4);
+ SETUP_INTRA_ANG8(19, 17, sse4);
+ SETUP_INTRA_ANG8(20, 16, sse4);
+ SETUP_INTRA_ANG8(21, 15, sse4);
+ SETUP_INTRA_ANG8(22, 14, sse4);
+ SETUP_INTRA_ANG8(23, 13, sse4);
+ SETUP_INTRA_ANG8(24, 12, sse4);
+ SETUP_INTRA_ANG8(25, 11, sse4);
+ SETUP_INTRA_ANG8(26, 26, sse4);
+ SETUP_INTRA_ANG8(27, 9, sse4);
+ SETUP_INTRA_ANG8(28, 8, sse4);
+ SETUP_INTRA_ANG8(29, 7, sse4);
+ SETUP_INTRA_ANG8(30, 6, sse4);
SETUP_INTRA_ANG8(31, 5, sse4);
SETUP_INTRA_ANG8(32, 4, sse4);
SETUP_INTRA_ANG8(33, 3, sse4);
diff -r ff430d39d428 -r dfd99758ba3b source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm Mon Feb 03 23:59:51 2014 -0600
+++ b/source/common/x86/intrapred8.asm Tue Feb 04 15:11:07 2014 +0530
@@ -34,6 +34,11 @@
c_mode32_17_0: db 15, 14, 12, 11, 10, 9, 7, 6, 5, 4, 2, 1, 0, 0, 0, 0
c_shuf8_0: db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8
c_deinterval8: db 0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15
+pb_unpackbq: db 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1
+c_mode16_15: db 0, 0, 0, 0, 0, 0, 0, 0, 15,13, 11, 9, 8, 6, 4, 2
+c_mode16_16: db 8, 6, 5, 3, 2, 0, 15, 14, 12, 11, 9, 8, 6, 5, 3, 2
+c_mode16_17: db 4, 2, 1, 0, 15, 14, 12, 11, 10, 9, 7, 6, 5, 4, 2, 1
+pb_swap8: times 2 db 7, 6, 5, 4, 3, 2, 1, 0
const ang_table
%assign x 0
@@ -1137,11 +1142,11 @@
RET
INIT_XMM sse4
-cglobal intra_pred_ang8_3, 3,5,8
+cglobal intra_pred_ang8_3, 3,5,7
cmp r4m, byte 33
cmove r2, r3mp
lea r3, [ang_table + 14 * 16]
- mova m7, [pw_1024]
+ mova m3, [pw_1024]
movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
@@ -1150,50 +1155,41 @@
punpcklbw m0, m1 ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
palignr m1, m2, m0, 2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
- movu m3, [r3 + 12 * 16] ; [26]
- movu m6, [r3 + 6 * 16] ; [20]
-
- pmaddubsw m4, m0, m3
- pmulhrsw m4, m7
- pmaddubsw m1, m6
- pmulhrsw m1, m7
+ pmaddubsw m4, m0, [r3 + 12 * 16] ; [26]
+ pmulhrsw m4, m3
+ pmaddubsw m1, [r3 + 6 * 16] ; [20]
+ pmulhrsw m1, m3
packuswb m4, m1
palignr m5, m2, m0, 4 ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
- movu m3, [r3] ; [14]
- pmaddubsw m5, m3
- pmulhrsw m5, m7
+ pmaddubsw m5, [r3] ; [14]
+ pmulhrsw m5, m3
palignr m6, m2, m0, 6 ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
- movu m3, [r3 - 6 * 16] ; [ 8]
- pmaddubsw m6, m3
- pmulhrsw m6, m7
+ pmaddubsw m6, [r3 - 6 * 16] ; [ 8]
+ pmulhrsw m6, m3
packuswb m5, m6
palignr m1, m2, m0, 8 ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
- movu m3, [r3 - 12 * 16] ; [ 2]
- pmaddubsw m6, m1, m3
- pmulhrsw m6, m7
-
- movu m3, [r3 + 14 * 16] ; [28]
- pmaddubsw m1, m3
- pmulhrsw m1, m7
+ pmaddubsw m6, m1, [r3 - 12 * 16] ; [ 2]
+ pmulhrsw m6, m3
+
+ pmaddubsw m1, [r3 + 14 * 16] ; [28]
+ pmulhrsw m1, m3
packuswb m6, m1
palignr m1, m2, m0, 10 ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 6]
- movu m3, [r3 + 8 * 16] ; [22]
- pmaddubsw m1, m3
- pmulhrsw m1, m7
+ pmaddubsw m1, [r3 + 8 * 16] ; [22]
+ pmulhrsw m1, m3
palignr m2, m0, 12 ; [15 14 14 13 13 12 12 11 11 10 10 9 9 8 8 7]
- movu m3, [r3 + 2 * 16] ; [16]
- pmaddubsw m2, m3
- pmulhrsw m2, m7
+ pmaddubsw m2, [r3 + 2 * 16] ; [16]
+ pmulhrsw m2, m3
packuswb m1, m2
.transpose8x8:
@@ -1230,11 +1226,11 @@
RET
-cglobal intra_pred_ang8_4, 3,5,8
+cglobal intra_pred_ang8_4, 3,5,7
cmp r4m, byte 32
cmove r2, r3mp
lea r3, [ang_table + 19 * 16]
- mova m7, [pw_1024]
+ mova m3, [pw_1024]
movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
@@ -1244,48 +1240,39 @@
palignr m1, m2, m0, 2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
mova m5, m1
- movu m3, [r3 + 2 * 16] ; [21]
- movu m6, [r3 - 9 * 16] ; [10]
-
- pmaddubsw m4, m0, m3
- pmulhrsw m4, m7
- pmaddubsw m1, m6
- pmulhrsw m1, m7
+ pmaddubsw m4, m0, [r3 + 2 * 16] ; [21]
+ pmulhrsw m4, m3
+ pmaddubsw m1, [r3 - 9 * 16] ; [10]
+ pmulhrsw m1, m3
packuswb m4, m1
- movu m3, [r3 + 12 * 16] ; [31]
- pmaddubsw m5, m3
- pmulhrsw m5, m7
+ pmaddubsw m5, [r3 + 12 * 16] ; [31]
+ pmulhrsw m5, m3
palignr m6, m2, m0, 4 ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
- movu m3, [r3 + 1 * 16] ; [ 20]
- pmaddubsw m6, m3
- pmulhrsw m6, m7
+ pmaddubsw m6, [r3 + 1 * 16] ; [ 20]
+ pmulhrsw m6, m3
packuswb m5, m6
palignr m1, m2, m0, 6 ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
- movu m3, [r3 - 10 * 16] ; [ 9]
- pmaddubsw m6, m1, m3
- pmulhrsw m6, m7
-
- movu m3, [r3 + 11 * 16] ; [30]
- pmaddubsw m1, m3
- pmulhrsw m1, m7
+ pmaddubsw m6, m1, [r3 - 10 * 16] ; [ 9]
+ pmulhrsw m6, m3
+
+ pmaddubsw m1, [r3 + 11 * 16] ; [30]
+ pmulhrsw m1, m3
packuswb m6, m1
palignr m1, m2, m0, 8 ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
- movu m3, [r3] ; [19]
- pmaddubsw m1, m3
- pmulhrsw m1, m7
+ pmaddubsw m1, [r3] ; [19]
+ pmulhrsw m1, m3
palignr m2, m0, 10 ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 8]
- movu m3, [r3 - 11 * 16] ; [8]
- pmaddubsw m2, m3
- pmulhrsw m2, m7
+ pmaddubsw m2, [r3 - 11 * 16] ; [8]
+ pmulhrsw m2, m3
packuswb m1, m2
jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
@@ -1293,7 +1280,7 @@
cmp r4m, byte 31
cmove r2, r3mp
lea r3, [ang_table + 13 * 16]
- mova m7, [pw_1024]
+ mova m3, [pw_1024]
movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
@@ -1303,50 +1290,658 @@
palignr m1, m2, m0, 2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
mova m5, m1
- movu m3, [r3 + 4 * 16] ; [17]
- movu m6, [r3 - 11 * 16] ; [2]
-
- pmaddubsw m4, m0, m3
- pmulhrsw m4, m7
- pmaddubsw m1, m6
- pmulhrsw m1, m7
+ pmaddubsw m4, m0, [r3 + 4 * 16] ; [17]
+ pmulhrsw m4, m3
+ pmaddubsw m1, [r3 - 11 * 16] ; [2]
+ pmulhrsw m1, m3
packuswb m4, m1
- movu m3, [r3 + 6 * 16] ; [19]
- pmaddubsw m5, m3
- pmulhrsw m5, m7
+ pmaddubsw m5, [r3 + 6 * 16] ; [19]
+ pmulhrsw m5, m3
palignr m6, m2, m0, 4 ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
mova m1, m6
- movu m3, [r3 - 9 * 16] ; [4]
- pmaddubsw m1, m3
- pmulhrsw m1, m7
+ pmaddubsw m1, [r3 - 9 * 16] ; [4]
+ pmulhrsw m1, m3
packuswb m5, m1
- movu m3, [r3 + 8 * 16] ; [21]
- pmaddubsw m6, m3
- pmulhrsw m6, m7
+ pmaddubsw m6, [r3 + 8 * 16] ; [21]
+ pmulhrsw m6, m3
palignr m1, m2, m0, 6 ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
- mova m3, m1
- pmaddubsw m3, [r3 - 7 * 16] ; [6]
- pmulhrsw m3, m7
- packuswb m6, m3
-
- movu m3, [r3 + 10 * 16] ; [23]
- pmaddubsw m1, m3
- pmulhrsw m1, m7
+ mova m7, m1
+ pmaddubsw m7, [r3 - 7 * 16] ; [6]
+ pmulhrsw m7, m3
+ packuswb m6, m7
+
+ pmaddubsw m1, [r3 + 10 * 16] ; [23]
+ pmulhrsw m1, m3
palignr m2, m0, 8 ; [13 12 12 11 11 10 10 9 9 8 8 7 7 8 8 9]
- movu m3, [r3 - 5 * 16] ; [8]
- pmaddubsw m2, m3
- pmulhrsw m2, m7
+ pmaddubsw m2, [r3 - 5 * 16] ; [8]
+ pmulhrsw m2, m3
packuswb m1, m2
jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+cglobal intra_pred_ang8_6, 3,5,8
+ cmp r4m, byte 30
+ cmove r2, r3mp
+ lea r3, [ang_table + 14 * 16]
+ mova m7, [pw_1024]
+
+ movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+ palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
+
+ punpckhbw m2, m0, m1 ; [x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
+ punpcklbw m0, m1 ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
+ mova m1, m0
+
+ pmaddubsw m4, m0, [r3 - 1 * 16] ; [13]
+ pmulhrsw m4, m7
+ pmaddubsw m1, [r3 + 12 * 16] ; [26]
+ pmulhrsw m1, m7
+ packuswb m4, m1
+
+ palignr m6, m2, m0, 2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
+
+ pmaddubsw m5, m6, [r3 - 7 * 16] ; [7]
+ pmulhrsw m5, m7
+
+ pmaddubsw m6, [r3 + 6 * 16] ; [20]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ palignr m1, m2, m0, 4 ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
+
+ pmaddubsw m6, m1, [r3 - 13 * 16] ; [1]
+ pmulhrsw m6, m7
+
+ mova m3, m1
+ pmaddubsw m3, [r3] ; [14]
+ pmulhrsw m3, m7
+ packuswb m6, m3
+
+ pmaddubsw m1, [r3 + 13 * 16] ; [27]
+ pmulhrsw m1, m7
+
+ palignr m2, m0, 6 ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
+
+ pmaddubsw m2, [r3 - 6 * 16] ; [8]
+ pmulhrsw m2, m7
+ packuswb m1, m2
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_7, 3,5,8
+ cmp r4m, byte 29
+ cmove r2, r3mp
+ lea r3, [ang_table + 18 * 16]
+ mova m7, [pw_1024]
+
+ movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+ palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
+
+ punpckhbw m2, m0, m1 ; [x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
+ punpcklbw m0, m1 ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
+
+ pmaddubsw m4, m0, [r3 - 9 * 16] ; [9]
+ pmulhrsw m4, m7
+ pmaddubsw m3, m0, [r3] ; [18]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, m0, [r3 + 9 * 16] ; [27]
+ pmulhrsw m5, m7
+
+ palignr m1, m2, m0, 2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
+
+ pmaddubsw m6, m1, [r3 - 14 * 16] ; [4]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ pmaddubsw m6, m1, [r3 - 5 * 16] ; [13]
+ pmulhrsw m6, m7
+
+ mova m3, m1
+ pmaddubsw m3, [r3 + 4 * 16] ; [22]
+ pmulhrsw m3, m7
+ packuswb m6, m3
+
+ pmaddubsw m1, [r3 + 13 * 16] ; [31]
+ pmulhrsw m1, m7
+
+ palignr m2, m0, 4 ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
+
+ pmaddubsw m2, [r3 - 10 * 16] ; [8]
+ pmulhrsw m2, m7
+ packuswb m1, m2
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_8, 3,5,8
+ cmp r4m, byte 28
+ cmove r2, r3mp
+ lea r3, [ang_table + 17 * 16]
+ mova m7, [pw_1024]
+
+ movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+ palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
+
+ punpckhbw m2, m0, m1 ; [x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
+ punpcklbw m0, m1 ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
+ palignr m2, m0, 2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
+
+ pmaddubsw m4, m0, [r3 - 12 * 16] ; [5]
+ pmulhrsw m4, m7
+ pmaddubsw m3, m0, [r3 - 7 * 16] ; [10]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, m0, [r3 - 2 * 16] ; [15]
+ pmulhrsw m5, m7
+
+ pmaddubsw m6, m0, [r3 + 3 * 16] ; [20]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ pmaddubsw m6, m0, [r3 + 8 * 16] ; [25]
+ pmulhrsw m6, m7
+
+ pmaddubsw m0, [r3 + 13 * 16] ; [30]
+ pmulhrsw m0, m7
+ packuswb m6, m0
+
+ pmaddubsw m1, m2, [r3 - 14 * 16] ; [3]
+ pmulhrsw m1, m7
+
+ pmaddubsw m2, [r3 - 9 * 16] ; [8]
+ pmulhrsw m2, m7
+ packuswb m1, m2
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_9, 3,5,8
+ cmp r4m, byte 27
+ cmove r2, r3mp
+ lea r3, [ang_table + 9 * 16]
+ mova m7, [pw_1024]
+
+ movu m0, [r2 + 1] ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+ palignr m1, m0, 1 ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
+
+ punpcklbw m0, m1 ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
+
+ pmaddubsw m4, m0, [r3 - 7 * 16] ; [2]
+ pmulhrsw m4, m7
+ pmaddubsw m3, m0, [r3 - 5 * 16] ; [4]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, m0, [r3 - 3 * 16] ; [6]
+ pmulhrsw m5, m7
+
+ pmaddubsw m6, m0, [r3 - 1 * 16] ; [8]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ pmaddubsw m6, m0, [r3 + 1 * 16] ; [10]
+ pmulhrsw m6, m7
+
+ pmaddubsw m2, m0, [r3 + 3 * 16] ; [12]
+ pmulhrsw m2, m7
+ packuswb m6, m2
+
+ pmaddubsw m1, m0, [r3 + 5 * 16] ; [14]
+ pmulhrsw m1, m7
+
+ pmaddubsw m0, [r3 + 7 * 16] ; [16]
+ pmulhrsw m0, m7
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_10, 4,5,5
+ movh m0, [r2 + 1]
+ mova m4, [pb_unpackbq]
+ palignr m1, m0, 2
+ pshufb m1, m4
+ palignr m2, m0, 4
+ pshufb m2, m4
+ palignr m3, m0, 6
+ pshufb m3, m4
+ pshufb m0, m4
+
+ lea r4, [r1 * 3]
+ movhps [r0 + r1], m0
+ movh [r0 + r1 * 2], m1
+ movhps [r0 + r4], m1
+ lea r2, [r0 + r1 * 4]
+ movh [r2], m2
+ movhps [r2 + r1], m2
+ movh [r2 + r1 * 2], m3
+ movhps [r2 + r4], m3
+
+; filter
+ cmp r5m, byte 0
+ jz .quit
+
+ pmovzxbw m0, m0
+ movu m1, [r3]
+ palignr m2, m1, 1
+ pshufb m1, m4
+ pmovzxbw m1, m1
+ pmovzxbw m2, m2
+ psubw m2, m1
+ psraw m2, 1
+ paddw m0, m2
+ packuswb m0, m0
+
+.quit:
+ movh [r0], m0
+ RET
+
+cglobal intra_pred_ang8_26, 4,5,3
+ movh m0, [r3 + 1]
+
+ lea r4, [r1 * 3]
+ movh [r0], m0
+ movh [r0 + r1], m0
+ movh [r0 + r1 * 2], m0
+ movh [r0 + r4], m0
+ lea r3, [r0 + r1 * 4]
+ movh [r3], m0
+ movh [r3 + r1], m0
+ movh [r3 + r1 * 2], m0
+ movh [r3 + r4], m0
+
+; filter
+ cmp r5m, byte 0
+ jz .quit
+
+ pshufb m0, [pb_unpackbq]
+ pmovzxbw m0, m0
+ movu m1, [r2]
+ palignr m2, m1, 1
+ pshufb m1, [pb_unpackbq]
+ pmovzxbw m1, m1
+ pmovzxbw m2, m2
+ psubw m2, m1
+ psraw m2, 1
+ paddw m0, m2
+ packuswb m0, m0
+ pextrb [r0], m0, 0
+ pextrb [r0 + r1], m0, 1
+ pextrb [r0 + r1 * 2], m0, 2
+ pextrb [r0 + r4], m0, 3
+ pextrb [r3], m0, 4
+ pextrb [r3 + r1], m0, 5
+ pextrb [r3 + r1 * 2], m0, 6
+ pextrb [r3 + r4], m0, 7
+
+.quit:
+ RET
+
+cglobal intra_pred_ang8_11, 3,5,8
+ cmp r4m, byte 25
+ cmove r2, r3mp
+ lea r3, [ang_table + 23 * 16]
+ mova m7, [pw_1024]
+
+ movu m0, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ palignr m1, m0, 1 ; [x 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+
+ punpcklbw m0, m1 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, m0, [r3 + 7 * 16] ; [30]
+ pmulhrsw m4, m7
+ pmaddubsw m3, m0, [r3 + 5 * 16] ; [28]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, m0, [r3 + 3 * 16] ; [26]
+ pmulhrsw m5, m7
+
+ pmaddubsw m6, m0, [r3 + 1 * 16] ; [24]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ pmaddubsw m6, m0, [r3 - 1 * 16] ; [22]
+ pmulhrsw m6, m7
+
+ pmaddubsw m2, m0, [r3 - 3 * 16] ; [20]
+ pmulhrsw m2, m7
+ packuswb m6, m2
+
+ pmaddubsw m1, m0, [r3 - 5 * 16] ; [18]
+ pmulhrsw m1, m7
+
+ pmaddubsw m0, [r3 - 7 * 16] ; [16]
+ pmulhrsw m0, m7
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_12, 4,5,8
+ cmp r4m, byte 24
+ jnz .skip
+ xchg r2, r3
+
+.skip:
+ lea r4, [ang_table + 16 * 16]
+ mova m7, [pw_1024]
+
+ movu m1, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ pslldq m0, m1, 1 ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
+ pinsrb m0, [r3 + 6], 0
+ punpckhbw m2, m0, m1 ; [15 14 14 13 13 12 12 11 11 10 10 9 9 8 8 7]
+ punpcklbw m0, m1 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
+ palignr m2, m0, 2 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, m2, [r4 + 11 * 16] ; [27]
+ pmulhrsw m4, m7
+ pmaddubsw m3, m2, [r4 + 6 * 16] ; [22]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, m2, [r4 + 1 * 16] ; [17]
+ pmulhrsw m5, m7
+
+ pmaddubsw m6, m2, [r4 - 4 * 16] ; [12]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ pmaddubsw m6, m2, [r4 - 9 * 16] ; [7]
+ pmulhrsw m6, m7
+
+ pmaddubsw m2, [r4 - 14 * 16] ; [2]
+ pmulhrsw m2, m7
+ packuswb m6, m2
+
+ pmaddubsw m1, m0, [r4 + 13 * 16] ; [29]
+ pmulhrsw m1, m7
+
+ pmaddubsw m0, [r4 + 8 * 16] ; [24]
+ pmulhrsw m0, m7
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_13, 4,5,8
+ cmp r4m, byte 23
+ jnz .skip
+ xchg r2, r3
+
+.skip:
+ lea r4, [ang_table + 14 * 16]
+ mova m7, [pw_1024]
+
+ movu m1, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ pslldq m1, 1 ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
+ pinsrb m1, [r3 + 4], 0
+ pslldq m0, m1, 1 ; [13 12 11 10 9 8 7 6 5 4 3 2 1 0 a b]
+ pinsrb m0, [r3 + 7], 0
+ punpckhbw m5, m0, m1 ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 6]
+ punpcklbw m0, m1 ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
+ palignr m1, m5, m0, 2 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
+ palignr m5, m0, 4 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, m5, [r4 + 9 * 16] ; [23]
+ pmulhrsw m4, m7
+ pmaddubsw m3, m5, [r4] ; [14]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, [r4 - 9 * 16] ; [5]
+ pmulhrsw m5, m7
+
+ pmaddubsw m6, m1, [r4 + 14 * 16] ; [28]
+ pmulhrsw m6, m7
+ packuswb m5, m6
+
+ pmaddubsw m6, m1, [r4 + 5 * 16] ; [19]
+ pmulhrsw m6, m7
+
+ pmaddubsw m2, m1, [r4 - 4 * 16] ; [10]
+ pmulhrsw m2, m7
+ packuswb m6, m2
+
+ pmaddubsw m1, [r4 - 13 * 16] ; [1]
+ pmulhrsw m1, m7
+
+ pmaddubsw m0, [r4 + 10 * 16] ; [24]
+ pmulhrsw m0, m7
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_14, 4,5,7
+ cmp r4m, byte 22
+ jnz .skip
+ xchg r2, r3
+
+.skip:
+ lea r4, [ang_table + 18 * 16]
+ mova m3, [pw_1024]
+
+ movu m1, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ pslldq m1, 2 ; [13 12 11 10 9 8 7 6 5 4 3 2 1 0 a b]
+ pinsrb m1, [r3 + 2], 1
+ pinsrb m1, [r3 + 5], 0
+ pslldq m0, m1, 1 ; [12 11 10 9 8 7 6 5 4 3 2 1 0 a b c]
+ pinsrb m0, [r3 + 7], 0
+ punpckhbw m2, m0, m1 ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
+ punpcklbw m0, m1 ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
+ palignr m1, m2, m0, 2 ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
+ palignr m6, m2, m0, 4 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
+ palignr m2, m0, 6 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, m2, [r4 + 1 * 16] ; [19]
+ pmulhrsw m4, m3
+ pmaddubsw m2, [r4 - 12 * 16] ; [6]
+ pmulhrsw m2, m3
+ packuswb m4, m2
+
+ pmaddubsw m5, m6, [r4 + 7 * 16] ; [25]
+ pmulhrsw m5, m3
+
+ pmaddubsw m6, [r4 - 6 * 16] ; [12]
+ pmulhrsw m6, m3
+ packuswb m5, m6
+
+ pmaddubsw m6, m1, [r4 + 13 * 16] ; [31]
+ pmulhrsw m6, m3
+
+ pmaddubsw m2, m1, [r4] ; [18]
+ pmulhrsw m2, m3
+ packuswb m6, m2
+
+ pmaddubsw m1, [r4 - 13 * 16] ; [5]
+ pmulhrsw m1, m3
+
+ pmaddubsw m0, [r4 + 6 * 16] ; [24]
+ pmulhrsw m0, m3
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_15, 4,5,7
+ cmp r4m, byte 21
+ jnz .skip
+ xchg r2, r3
+
+.skip:
+ lea r4, [ang_table + 20 * 16]
+ mova m3, [pw_1024]
+
+ movu m1, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ movu m2, [r3]
+ pshufb m2, [c_mode16_15]
+ palignr m1, m2, 13 ; [12 11 10 9 8 7 6 5 4 3 2 1 0 a b c]
+ pslldq m0, m1, 1 ; [11 10 9 8 7 6 5 4 3 2 1 0 a b c d]
+ pinsrb m0, [r3 + 8], 0
+ punpckhbw m4, m0, m1 ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
+ punpcklbw m0, m1 ; [4 3 3 2 2 1 1 0 0 a a b b c c d]
+ palignr m1, m4, m0, 2 ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
+ palignr m6, m4, m0, 4 ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
+ palignr m5, m4, m0, 6 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
+ palignr m4, m0, 8 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, [r4 - 5 * 16] ; [15]
+ pmulhrsw m4, m3
+
+ pmaddubsw m2, m5, [r4 + 10 * 16] ; [30]
+ pmulhrsw m2, m3
+ packuswb m4, m2
+
+ pmaddubsw m5, [r4 - 7 * 16] ; [13]
+ pmulhrsw m5, m3
+
+ pmaddubsw m2, m6, [r4 + 8 * 16] ; [28]
+ pmulhrsw m2, m3
+ packuswb m5, m2
+
+ pmaddubsw m6, [r4 - 9 * 16] ; [11]
+ pmulhrsw m6, m3
+
+ pmaddubsw m2, m1, [r4 + 6 * 16] ; [26]
+ pmulhrsw m2, m3
+ packuswb m6, m2
+
+ pmaddubsw m1, [r4 - 11 * 16] ; [9]
+ pmulhrsw m1, m3
+
+ pmaddubsw m0, [r4 + 4 * 16] ; [24]
+ pmulhrsw m0, m3
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_16, 4,5,8
+ cmp r4m, byte 20
+ jnz .skip
+ xchg r2, r3
+
+.skip:
+ lea r4, [ang_table + 13 * 16]
+ mova m7, [pw_1024]
+
+ movu m1, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ movu m2, [r3]
+ pshufb m2, [c_mode16_16]
+ palignr m1, m2, 12 ; [11 10 9 8 7 6 5 4 3 2 1 0 a b c d]
+ pslldq m0, m1, 1 ; [10 9 8 7 6 5 4 3 2 1 0 a b c d e]
+ pinsrb m0, [r3 + 8], 0
+ punpckhbw m4, m0, m1 ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
+ punpcklbw m0, m1 ; [3 2 2 1 1 0 0 a a b b c c d d e]
+ palignr m1, m4, m0, 2 ; [4 3 3 2 2 1 1 0 0 a a b b c c d]
+ palignr m6, m4, m0, 4 ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
+ palignr m2, m4, m0, 6 ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
+ palignr m5, m4, m0, 8 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
+ palignr m4, m0, 10 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, [r4 - 2 * 16] ; [11]
+ pmulhrsw m4, m7
+
+ pmaddubsw m3, m5, [r4 + 9 * 16] ; [22]
+ pmulhrsw m3, m7
+ packuswb m4, m3
+
+ pmaddubsw m5, [r4 - 12 * 16] ; [1]
+ pmulhrsw m5, m7
+
+ pmaddubsw m2, [r4 - 1 * 16] ; [12]
+ pmulhrsw m2, m7
+ packuswb m5, m2
+
+ mova m2, m6
+ pmaddubsw m6, [r4 + 10 * 16] ; [23]
+ pmulhrsw m6, m7
+
+ pmaddubsw m2, [r4 - 11 * 16] ; [2]
+ pmulhrsw m2, m7
+ packuswb m6, m2
+
+ pmaddubsw m1, [r4] ; [13]
+ pmulhrsw m1, m7
+
+ pmaddubsw m0, [r4 + 11 * 16] ; [24]
+ pmulhrsw m0, m7
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_17, 4,5,7
+ cmp r4m, byte 19
+ jnz .skip
+ xchg r2, r3
+
+.skip:
+ lea r4, [ang_table + 17 * 16]
+ mova m3, [pw_1024]
+
+ movu m2, [r2] ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+ movu m1, [r3]
+ pshufb m1, [c_mode16_17]
+ palignr m2, m1, 11 ; [10 9 8 7 6 5 4 3 2 1 0 a b c d e]
+ pslldq m0, m2, 1 ; [9 8 7 6 5 4 3 2 1 0 a b c d e f]
+ pinsrb m0, [r3 + 7], 0
+ punpckhbw m1, m0, m2 ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
+ punpcklbw m0, m2 ; [2 1 1 0 0 a a b b c c d d e e f]
+
+ palignr m5, m1, m0, 8 ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
+ palignr m2, m1, m0, 10 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
+ palignr m4, m1, m0, 12 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
+
+ pmaddubsw m4, [r4 - 11 * 16] ; [6]
+ pmulhrsw m4, m3
+
+ pmaddubsw m2, [r4 - 5 * 16] ; [12]
+ pmulhrsw m2, m3
+ packuswb m4, m2
+
+ pmaddubsw m5, [r4 + 1 * 16] ; [18]
+ pmulhrsw m5, m3
+
+ palignr m2, m1, m0, 6 ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
+ pmaddubsw m2, [r4 + 7 * 16] ; [24]
+ pmulhrsw m2, m3
+ packuswb m5, m2
+
+ palignr m6, m1, m0, 4 ; [4 3 3 2 2 1 1 0 0 a a b b c c d]
+ mova m2, m6
+ pmaddubsw m6, [r4 + 13 * 16] ; [30]
+ pmulhrsw m6, m3
+
+ pmaddubsw m2, [r4 - 13 * 16] ; [4]
+ pmulhrsw m2, m3
+ packuswb m6, m2
+
+ palignr m1, m0, 2 ; [3 2 2 1 1 0 0 a a b b c c d d e]
+ pmaddubsw m1, [r4 - 7 * 16] ; [10]
+ pmulhrsw m1, m3
+
+ pmaddubsw m0, [r4 - 1 * 16] ; [16]
+ pmulhrsw m0, m3
+ packuswb m1, m0
+ jmp mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
+
+cglobal intra_pred_ang8_18, 4,4,1
+ movu m0, [r2]
+ pshufb m0, [pb_swap8]
+ movhps m0, [r3 + 1]
+ lea r2, [r0 + r1 * 4]
+ lea r3, [r1 * 3]
+ movh [r2 + r3], m0
+ psrldq m0, 1
+ movh [r2 + r1 * 2], m0
+ psrldq m0, 1
+ movh [r2 + r1], m0
+ psrldq m0, 1
+ movh [r2], m0
+ psrldq m0, 1
+ movh [r0 + r3], m0
+ psrldq m0, 1
+ movh [r0 + r1 * 2], m0
+ psrldq m0, 1
+ movh [r0 + r1], m0
+ psrldq m0, 1
+ movh [r0], m0
+ RET
+
+
;-----------------------------------------------------------------------------
; void intraPredAng16(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
;-----------------------------------------------------------------------------
More information about the x265-devel
mailing list