Mercurial > libavcodec.hg
annotate x86/h264_deblock_sse2.asm @ 9947:1a345787ba68 libavcodec
Mark iir filter init and free functions av_cold.
author | alexc |
---|---|
date | Fri, 10 Jul 2009 20:55:15 +0000 |
parents | 37ac731fe32c |
children | c08ca946c80a |
rev | line source |
---|---|
9006
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
1 ;***************************************************************************** |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
2 ;* MMX/SSE2-optimized H.264 deblocking code |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
3 ;***************************************************************************** |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
4 ;* Copyright (C) 2005-2008 x264 project |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
5 ;* |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
6 ;* Authors: Loren Merritt <lorenm@u.washington.edu> |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
7 ;* |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
8 ;* This program is free software; you can redistribute it and/or modify |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
9 ;* it under the terms of the GNU General Public License as published by |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
10 ;* the Free Software Foundation; either version 2 of the License, or |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
11 ;* (at your option) any later version. |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
12 ;* |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
13 ;* This program is distributed in the hope that it will be useful, |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
14 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
15 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
16 ;* GNU General Public License for more details. |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
17 ;* |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
18 ;* You should have received a copy of the GNU General Public License |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
19 ;* along with this program; if not, write to the Free Software |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
20 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
21 ;***************************************************************************** |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
22 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
23 %include "x86inc.asm" |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
24 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
25 SECTION_RODATA |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
26 pb_00: times 16 db 0x00 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
27 pb_01: times 16 db 0x01 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
28 pb_03: times 16 db 0x03 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
29 pb_a1: times 16 db 0xa1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
30 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
31 SECTION .text |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
32 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
33 ; expands to [base],...,[base+7*stride] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
34 %define PASS8ROWS(base, base3, stride, stride3) \ |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
35 [base], [base+stride], [base+stride*2], [base3], \ |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
36 [base3+stride], [base3+stride*2], [base3+stride3], [base3+stride*4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
37 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
38 ; in: 8 rows of 4 bytes in %1..%8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
39 ; out: 4 rows of 8 bytes in m0..m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
40 %macro TRANSPOSE4x8_LOAD 8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
41 movd m0, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
42 movd m2, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
43 movd m1, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
44 movd m3, %4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
45 punpcklbw m0, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
46 punpcklbw m1, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
47 movq m2, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
48 punpcklwd m0, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
49 punpckhwd m2, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
50 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
51 movd m4, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
52 movd m6, %6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
53 movd m5, %7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
54 movd m7, %8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
55 punpcklbw m4, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
56 punpcklbw m5, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
57 movq m6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
58 punpcklwd m4, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
59 punpckhwd m6, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
60 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
61 movq m1, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
62 movq m3, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
63 punpckldq m0, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
64 punpckhdq m1, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
65 punpckldq m2, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
66 punpckhdq m3, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
67 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
68 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
69 ; in: 4 rows of 8 bytes in m0..m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
70 ; out: 8 rows of 4 bytes in %1..%8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
71 %macro TRANSPOSE8x4_STORE 8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
72 movq m4, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
73 movq m5, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
74 movq m6, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
75 punpckhdq m4, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
76 punpckhdq m5, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
77 punpckhdq m6, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
78 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
79 punpcklbw m0, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
80 punpcklbw m2, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
81 movq m1, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
82 punpcklwd m0, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
83 punpckhwd m1, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
84 movd %1, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
85 punpckhdq m0, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
86 movd %2, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
87 movd %3, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
88 punpckhdq m1, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
89 movd %4, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
90 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
91 punpckhdq m3, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
92 punpcklbw m4, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
93 punpcklbw m6, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
94 movq m5, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
95 punpcklwd m4, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
96 punpckhwd m5, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
97 movd %5, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
98 punpckhdq m4, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
99 movd %6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
100 movd %7, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
101 punpckhdq m5, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
102 movd %8, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
103 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
104 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
105 %macro SBUTTERFLY 4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
106 movq %4, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
107 punpckl%1 %2, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
108 punpckh%1 %4, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
109 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
110 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
111 ; in: 8 rows of 8 (only the middle 6 pels are used) in %1..%8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
112 ; out: 6 rows of 8 in [%9+0*16] .. [%9+5*16] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
113 %macro TRANSPOSE6x8_MEM 9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
114 movq m0, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
115 movq m1, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
116 movq m2, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
117 movq m3, %4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
118 movq m4, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
119 movq m5, %6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
120 movq m6, %7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
121 SBUTTERFLY bw, m0, m1, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
122 SBUTTERFLY bw, m2, m3, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
123 SBUTTERFLY bw, m4, m5, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
124 movq [%9+0x10], m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
125 SBUTTERFLY bw, m6, %8, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
126 SBUTTERFLY wd, m0, m2, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
127 SBUTTERFLY wd, m4, m6, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
128 punpckhdq m0, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
129 movq [%9+0x00], m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
130 SBUTTERFLY wd, m7, [%9+0x10], m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
131 SBUTTERFLY wd, m3, m5, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
132 SBUTTERFLY dq, m7, m3, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
133 SBUTTERFLY dq, m1, m2, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
134 punpckldq m6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
135 movq [%9+0x10], m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
136 movq [%9+0x20], m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
137 movq [%9+0x30], m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
138 movq [%9+0x40], m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
139 movq [%9+0x50], m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
140 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
141 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
142 ; in: 8 rows of 8 in %1..%8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
143 ; out: 8 rows of 8 in %9..%16 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
144 %macro TRANSPOSE8x8_MEM 16 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
145 movq m0, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
146 movq m1, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
147 movq m2, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
148 movq m3, %4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
149 movq m4, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
150 movq m5, %6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
151 movq m6, %7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
152 SBUTTERFLY bw, m0, m1, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
153 SBUTTERFLY bw, m2, m3, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
154 SBUTTERFLY bw, m4, m5, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
155 SBUTTERFLY bw, m6, %8, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
156 movq %9, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
157 SBUTTERFLY wd, m0, m2, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
158 SBUTTERFLY wd, m4, m6, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
159 SBUTTERFLY wd, m7, m1, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
160 movq %11, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
161 movq m2, %9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
162 SBUTTERFLY wd, m2, m5, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
163 SBUTTERFLY dq, m0, m4, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
164 SBUTTERFLY dq, m7, m2, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
165 movq %9, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
166 movq %10, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
167 movq %13, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
168 movq %14, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
169 SBUTTERFLY dq, m3, %11, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
170 SBUTTERFLY dq, m6, m1, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
171 movq %11, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
172 movq %12, m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
173 movq %15, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
174 movq %16, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
175 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
176 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
177 ; out: %4 = |%1-%2|>%3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
178 ; clobbers: %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
179 %macro DIFF_GT 5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
180 mova %5, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
181 mova %4, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
182 psubusb %5, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
183 psubusb %4, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
184 por %4, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
185 psubusb %4, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
186 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
187 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
188 ; out: %4 = |%1-%2|>%3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
189 ; clobbers: %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
190 %macro DIFF_GT2 5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
191 mova %5, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
192 mova %4, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
193 psubusb %5, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
194 psubusb %4, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
195 psubusb %5, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
196 psubusb %4, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
197 pcmpeqb %4, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
198 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
199 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
200 %macro SPLATW 1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
201 %ifidn m0, xmm0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
202 pshuflw %1, %1, 0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
203 punpcklqdq %1, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
204 %else |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
205 pshufw %1, %1, 0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
206 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
207 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
208 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
209 ; in: m0=p1 m1=p0 m2=q0 m3=q1 %1=alpha-1 %2=beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
210 ; out: m5=beta-1, m7=mask, %3=alpha-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
211 ; clobbers: m4,m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
212 %macro LOAD_MASK 2-3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
213 movd m4, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
214 movd m5, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
215 SPLATW m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
216 SPLATW m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
217 packuswb m4, m4 ; 16x alpha-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
218 packuswb m5, m5 ; 16x beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
219 %if %0>2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
220 mova %3, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
221 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
222 DIFF_GT m1, m2, m4, m7, m6 ; |p0-q0| > alpha-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
223 DIFF_GT m0, m1, m5, m4, m6 ; |p1-p0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
224 por m7, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
225 DIFF_GT m3, m2, m5, m4, m6 ; |q1-q0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
226 por m7, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
227 pxor m6, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
228 pcmpeqb m7, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
229 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
230 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
231 ; in: m0=p1 m1=p0 m2=q0 m3=q1 m7=(tc&mask) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
232 ; out: m1=p0' m2=q0' |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
233 ; clobbers: m0,3-6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
234 %macro DEBLOCK_P0_Q0 0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
235 mova m5, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
236 pxor m5, m2 ; p0^q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
237 pand m5, [pb_01 GLOBAL] ; (p0^q0)&1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
238 pcmpeqb m4, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
239 pxor m3, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
240 pavgb m3, m0 ; (p1 - q1 + 256)>>1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
241 pavgb m3, [pb_03 GLOBAL] ; (((p1 - q1 + 256)>>1)+4)>>1 = 64+2+(p1-q1)>>2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
242 pxor m4, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
243 pavgb m4, m2 ; (q0 - p0 + 256)>>1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
244 pavgb m3, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
245 paddusb m3, m4 ; d+128+33 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
246 mova m6, [pb_a1 GLOBAL] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
247 psubusb m6, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
248 psubusb m3, [pb_a1 GLOBAL] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
249 pminub m6, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
250 pminub m3, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
251 psubusb m1, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
252 psubusb m2, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
253 paddusb m1, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
254 paddusb m2, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
255 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
256 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
257 ; in: m1=p0 m2=q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
258 ; %1=p1 %2=q2 %3=[q2] %4=[q1] %5=tc0 %6=tmp |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
259 ; out: [q1] = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
260 ; clobbers: q2, tmp, tc0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
261 %macro LUMA_Q1 6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
262 mova %6, m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
263 pavgb %6, m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
264 pavgb %2, %6 ; avg(p2,avg(p0,q0)) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
265 pxor %6, %3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
266 pand %6, [pb_01 GLOBAL] ; (p2^avg(p0,q0))&1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
267 psubusb %2, %6 ; (p2+((p0+q0+1)>>1))>>1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
268 mova %6, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
269 psubusb %6, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
270 paddusb %5, %1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
271 pmaxub %2, %6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
272 pminub %2, %5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
273 mova %4, %2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
274 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
275 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
276 %ifdef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
277 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
278 ; void x264_deblock_v_luma_sse2( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
279 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
280 INIT_XMM |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
281 cglobal x264_deblock_v_luma_sse2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
282 movd m8, [r4] ; tc0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
283 lea r4, [r1*3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
284 dec r2d ; alpha-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
285 neg r4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
286 dec r3d ; beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
287 add r4, r0 ; pix-3*stride |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
288 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
289 mova m0, [r4+r1] ; p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
290 mova m1, [r4+2*r1] ; p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
291 mova m2, [r0] ; q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
292 mova m3, [r0+r1] ; q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
293 LOAD_MASK r2d, r3d |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
294 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
295 punpcklbw m8, m8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
296 punpcklbw m8, m8 ; tc = 4x tc0[3], 4x tc0[2], 4x tc0[1], 4x tc0[0] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
297 pcmpeqb m9, m9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
298 pcmpeqb m9, m8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
299 pandn m9, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
300 pand m8, m9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
301 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
302 movdqa m3, [r4] ; p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
303 DIFF_GT2 m1, m3, m5, m6, m7 ; |p2-p0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
304 pand m6, m9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
305 mova m7, m8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
306 psubb m7, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
307 pand m6, m8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
308 LUMA_Q1 m0, m3, [r4], [r4+r1], m6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
309 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
310 movdqa m4, [r0+2*r1] ; q2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
311 DIFF_GT2 m2, m4, m5, m6, m3 ; |q2-q0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
312 pand m6, m9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
313 pand m8, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
314 psubb m7, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
315 mova m3, [r0+r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
316 LUMA_Q1 m3, m4, [r0+2*r1], [r0+r1], m8, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
317 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
318 DEBLOCK_P0_Q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
319 mova [r4+2*r1], m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
320 mova [r0], m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
321 ret |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
322 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
323 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
324 ; void x264_deblock_h_luma_sse2( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
325 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
326 INIT_MMX |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
327 cglobal x264_deblock_h_luma_sse2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
328 movsxd r10, esi |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
329 lea r11, [r10+r10*2] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
330 lea rax, [r0-4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
331 lea r9, [r0-4+r11] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
332 sub rsp, 0x68 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
333 %define pix_tmp rsp |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
334 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
335 ; transpose 6x16 -> tmp space |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
336 TRANSPOSE6x8_MEM PASS8ROWS(rax, r9, r10, r11), pix_tmp |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
337 lea rax, [rax+r10*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
338 lea r9, [r9 +r10*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
339 TRANSPOSE6x8_MEM PASS8ROWS(rax, r9, r10, r11), pix_tmp+8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
340 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
341 ; vertical filter |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
342 ; alpha, beta, tc0 are still in r2d, r3d, r4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
343 ; don't backup rax, r9, r10, r11 because x264_deblock_v_luma_sse2 doesn't use them |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
344 lea r0, [pix_tmp+0x30] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
345 mov esi, 0x10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
346 call x264_deblock_v_luma_sse2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
347 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
348 ; transpose 16x4 -> original space (only the middle 4 rows were changed by the filter) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
349 add rax, 2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
350 add r9, 2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
351 movq m0, [pix_tmp+0x18] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
352 movq m1, [pix_tmp+0x28] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
353 movq m2, [pix_tmp+0x38] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
354 movq m3, [pix_tmp+0x48] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
355 TRANSPOSE8x4_STORE PASS8ROWS(rax, r9, r10, r11) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
356 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
357 shl r10, 3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
358 sub rax, r10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
359 sub r9, r10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
360 shr r10, 3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
361 movq m0, [pix_tmp+0x10] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
362 movq m1, [pix_tmp+0x20] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
363 movq m2, [pix_tmp+0x30] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
364 movq m3, [pix_tmp+0x40] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
365 TRANSPOSE8x4_STORE PASS8ROWS(rax, r9, r10, r11) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
366 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
367 add rsp, 0x68 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
368 ret |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
369 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
370 %else |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
371 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
372 %macro DEBLOCK_LUMA 3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
373 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
374 ; void x264_deblock_v8_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
375 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
376 cglobal x264_deblock_%2_luma_%1, 5,5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
377 lea r4, [r1*3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
378 dec r2 ; alpha-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
379 neg r4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
380 dec r3 ; beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
381 add r4, r0 ; pix-3*stride |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
382 %assign pad 2*%3+12-(stack_offset&15) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
383 SUB esp, pad |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
384 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
385 mova m0, [r4+r1] ; p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
386 mova m1, [r4+2*r1] ; p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
387 mova m2, [r0] ; q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
388 mova m3, [r0+r1] ; q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
389 LOAD_MASK r2, r3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
390 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
391 mov r3, r4m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
392 movd m4, [r3] ; tc0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
393 punpcklbw m4, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
394 punpcklbw m4, m4 ; tc = 4x tc0[3], 4x tc0[2], 4x tc0[1], 4x tc0[0] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
395 mova [esp+%3], m4 ; tc |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
396 pcmpeqb m3, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
397 pcmpgtb m4, m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
398 pand m4, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
399 mova [esp], m4 ; mask |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
400 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
401 mova m3, [r4] ; p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
402 DIFF_GT2 m1, m3, m5, m6, m7 ; |p2-p0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
403 pand m6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
404 pand m4, [esp+%3] ; tc |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
405 mova m7, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
406 psubb m7, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
407 pand m6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
408 LUMA_Q1 m0, m3, [r4], [r4+r1], m6, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
409 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
410 mova m4, [r0+2*r1] ; q2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
411 DIFF_GT2 m2, m4, m5, m6, m3 ; |q2-q0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
412 mova m5, [esp] ; mask |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
413 pand m6, m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
414 mova m5, [esp+%3] ; tc |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
415 pand m5, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
416 psubb m7, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
417 mova m3, [r0+r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
418 LUMA_Q1 m3, m4, [r0+2*r1], [r0+r1], m5, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
419 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
420 DEBLOCK_P0_Q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
421 mova [r4+2*r1], m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
422 mova [r0], m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
423 ADD esp, pad |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
424 RET |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
425 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
426 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
427 ; void x264_deblock_h_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
428 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
429 INIT_MMX |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
430 cglobal x264_deblock_h_luma_%1, 0,5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
431 mov r0, r0m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
432 mov r3, r1m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
433 lea r4, [r3*3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
434 sub r0, 4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
435 lea r1, [r0+r4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
436 %assign pad 0x78-(stack_offset&15) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
437 SUB esp, pad |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
438 %define pix_tmp esp+12 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
439 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
440 ; transpose 6x16 -> tmp space |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
441 TRANSPOSE6x8_MEM PASS8ROWS(r0, r1, r3, r4), pix_tmp |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
442 lea r0, [r0+r3*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
443 lea r1, [r1+r3*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
444 TRANSPOSE6x8_MEM PASS8ROWS(r0, r1, r3, r4), pix_tmp+8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
445 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
446 ; vertical filter |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
447 lea r0, [pix_tmp+0x30] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
448 PUSH dword r4m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
449 PUSH dword r3m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
450 PUSH dword r2m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
451 PUSH dword 16 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
452 PUSH dword r0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
453 call x264_deblock_%2_luma_%1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
454 %ifidn %2, v8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
455 add dword [esp ], 8 ; pix_tmp+0x38 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
456 add dword [esp+16], 2 ; tc0+2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
457 call x264_deblock_%2_luma_%1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
458 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
459 ADD esp, 20 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
460 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
461 ; transpose 16x4 -> original space (only the middle 4 rows were changed by the filter) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
462 mov r0, r0m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
463 sub r0, 2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
464 lea r1, [r0+r4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
465 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
466 movq m0, [pix_tmp+0x10] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
467 movq m1, [pix_tmp+0x20] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
468 movq m2, [pix_tmp+0x30] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
469 movq m3, [pix_tmp+0x40] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
470 TRANSPOSE8x4_STORE PASS8ROWS(r0, r1, r3, r4) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
471 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
472 lea r0, [r0+r3*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
473 lea r1, [r1+r3*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
474 movq m0, [pix_tmp+0x18] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
475 movq m1, [pix_tmp+0x28] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
476 movq m2, [pix_tmp+0x38] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
477 movq m3, [pix_tmp+0x48] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
478 TRANSPOSE8x4_STORE PASS8ROWS(r0, r1, r3, r4) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
479 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
480 ADD esp, pad |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
481 RET |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
482 %endmacro ; DEBLOCK_LUMA |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
483 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
484 INIT_XMM |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
485 DEBLOCK_LUMA sse2, v, 16 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
486 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
487 %endif ; ARCH |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
488 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
489 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
490 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
491 %macro LUMA_INTRA_P012 4 ; p0..p3 in memory |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
492 mova t0, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
493 mova t1, p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
494 pavgb t0, p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
495 pavgb t1, q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
496 pavgb t0, t1 ; ((p2+p1+1)/2 + (p0+q0+1)/2 + 1)/2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
497 mova t5, t1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
498 mova t2, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
499 mova t3, p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
500 paddb t2, p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
501 paddb t3, q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
502 paddb t2, t3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
503 mova t3, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
504 mova t4, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
505 psrlw t2, 1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
506 pavgb t2, mpb_00 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
507 pxor t2, t0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
508 pand t2, mpb_01 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
509 psubb t0, t2 ; p1' = (p2+p1+p0+q0+2)/4; |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
510 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
511 mova t1, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
512 mova t2, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
513 pavgb t1, q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
514 psubb t2, q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
515 paddb t3, t3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
516 psubb t3, t2 ; p2+2*p1+2*p0+2*q0+q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
517 pand t2, mpb_01 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
518 psubb t1, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
519 pavgb t1, p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
520 pavgb t1, t5 ; (((p2+q1)/2 + p1+1)/2 + (p0+q0+1)/2 + 1)/2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
521 psrlw t3, 2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
522 pavgb t3, mpb_00 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
523 pxor t3, t1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
524 pand t3, mpb_01 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
525 psubb t1, t3 ; p0'a = (p2+2*p1+2*p0+2*q0+q1+4)/8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
526 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
527 mova t3, p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
528 mova t2, p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
529 pxor t3, q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
530 pavgb t2, q1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
531 pand t3, mpb_01 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
532 psubb t2, t3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
533 pavgb t2, p1 ; p0'b = (2*p1+p0+q0+2)/4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
534 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
535 pxor t1, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
536 pxor t2, p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
537 pand t1, mask1p |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
538 pand t2, mask0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
539 pxor t1, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
540 pxor t1, p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
541 mova %1, t1 ; store p0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
542 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
543 mova t1, %4 ; p3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
544 mova t2, t1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
545 pavgb t1, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
546 paddb t2, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
547 pavgb t1, t0 ; (p3+p2+1)/2 + (p2+p1+p0+q0+2)/4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
548 paddb t2, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
549 paddb t2, t4 ; 2*p3+3*p2+p1+p0+q0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
550 psrlw t2, 2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
551 pavgb t2, mpb_00 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
552 pxor t2, t1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
553 pand t2, mpb_01 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
554 psubb t1, t2 ; p2' = (2*p3+3*p2+p1+p0+q0+4)/8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
555 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
556 pxor t0, p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
557 pxor t1, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
558 pand t0, mask1p |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
559 pand t1, mask1p |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
560 pxor t0, p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
561 pxor t1, p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
562 mova %2, t0 ; store p1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
563 mova %3, t1 ; store p2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
564 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
565 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
566 %macro LUMA_INTRA_SWAP_PQ 0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
567 %define q1 m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
568 %define q0 m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
569 %define p0 m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
570 %define p1 m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
571 %define p2 q2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
572 %define mask1p mask1q |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
573 %endmacro |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
574 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
575 %macro DEBLOCK_LUMA_INTRA 2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
576 %define p1 m0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
577 %define p0 m1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
578 %define q0 m2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
579 %define q1 m3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
580 %define t0 m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
581 %define t1 m5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
582 %define t2 m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
583 %define t3 m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
584 %ifdef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
585 %define p2 m8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
586 %define q2 m9 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
587 %define t4 m10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
588 %define t5 m11 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
589 %define mask0 m12 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
590 %define mask1p m13 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
591 %define mask1q [rsp-24] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
592 %define mpb_00 m14 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
593 %define mpb_01 m15 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
594 %else |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
595 %define spill(x) [esp+16*x+((stack_offset+4)&15)] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
596 %define p2 [r4+r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
597 %define q2 [r0+2*r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
598 %define t4 spill(0) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
599 %define t5 spill(1) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
600 %define mask0 spill(2) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
601 %define mask1p spill(3) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
602 %define mask1q spill(4) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
603 %define mpb_00 [pb_00 GLOBAL] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
604 %define mpb_01 [pb_01 GLOBAL] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
605 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
606 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
607 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
608 ; void x264_deblock_v_luma_intra_sse2( uint8_t *pix, int stride, int alpha, int beta ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
609 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
610 cglobal x264_deblock_%2_luma_intra_%1, 4,6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
611 %ifndef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
612 sub esp, 0x60 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
613 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
614 lea r4, [r1*4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
615 lea r5, [r1*3] ; 3*stride |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
616 dec r2d ; alpha-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
617 jl .end |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
618 neg r4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
619 dec r3d ; beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
620 jl .end |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
621 add r4, r0 ; pix-4*stride |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
622 mova p1, [r4+2*r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
623 mova p0, [r4+r5] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
624 mova q0, [r0] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
625 mova q1, [r0+r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
626 %ifdef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
627 pxor mpb_00, mpb_00 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
628 mova mpb_01, [pb_01 GLOBAL] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
629 LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
630 SWAP 7, 12 ; m12=mask0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
631 pavgb t5, mpb_00 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
632 pavgb t5, mpb_01 ; alpha/4+1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
633 movdqa p2, [r4+r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
634 movdqa q2, [r0+2*r1] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
635 DIFF_GT2 p0, q0, t5, t0, t3 ; t0 = |p0-q0| > alpha/4+1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
636 DIFF_GT2 p0, p2, m5, t2, t5 ; mask1 = |p2-p0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
637 DIFF_GT2 q0, q2, m5, t4, t5 ; t4 = |q2-q0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
638 pand t0, mask0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
639 pand t4, t0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
640 pand t2, t0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
641 mova mask1q, t4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
642 mova mask1p, t2 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
643 %else |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
644 LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
645 mova m4, t5 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
646 mova mask0, m7 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
647 pavgb m4, [pb_00 GLOBAL] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
648 pavgb m4, [pb_01 GLOBAL] ; alpha/4+1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
649 DIFF_GT2 p0, q0, m4, m6, m7 ; m6 = |p0-q0| > alpha/4+1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
650 pand m6, mask0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
651 DIFF_GT2 p0, p2, m5, m4, m7 ; m4 = |p2-p0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
652 pand m4, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
653 mova mask1p, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
654 DIFF_GT2 q0, q2, m5, m4, m7 ; m4 = |q2-q0| > beta-1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
655 pand m4, m6 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
656 mova mask1q, m4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
657 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
658 LUMA_INTRA_P012 [r4+r5], [r4+2*r1], [r4+r1], [r4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
659 LUMA_INTRA_SWAP_PQ |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
660 LUMA_INTRA_P012 [r0], [r0+r1], [r0+2*r1], [r0+r5] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
661 .end: |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
662 %ifndef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
663 add esp, 0x60 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
664 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
665 RET |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
666 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
667 INIT_MMX |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
668 %ifdef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
669 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
670 ; void x264_deblock_h_luma_intra_sse2( uint8_t *pix, int stride, int alpha, int beta ) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
671 ;----------------------------------------------------------------------------- |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
672 cglobal x264_deblock_h_luma_intra_%1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
673 movsxd r10, r1d |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
674 lea r11, [r10*3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
675 lea rax, [r0-4] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
676 lea r9, [r0-4+r11] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
677 sub rsp, 0x88 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
678 %define pix_tmp rsp |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
679 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
680 ; transpose 8x16 -> tmp space |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
681 TRANSPOSE8x8_MEM PASS8ROWS(rax, r9, r10, r11), PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
682 lea rax, [rax+r10*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
683 lea r9, [r9+r10*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
684 TRANSPOSE8x8_MEM PASS8ROWS(rax, r9, r10, r11), PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
685 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
686 lea r0, [pix_tmp+0x40] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
687 mov r1, 0x10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
688 call x264_deblock_v_luma_intra_%1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
689 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
690 ; transpose 16x6 -> original space (but we can't write only 6 pixels, so really 16x8) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
691 lea r9, [rax+r11] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
692 TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30), PASS8ROWS(rax, r9, r10, r11) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
693 shl r10, 3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
694 sub rax, r10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
695 sub r9, r10 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
696 shr r10, 3 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
697 TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30), PASS8ROWS(rax, r9, r10, r11) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
698 add rsp, 0x88 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
699 ret |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
700 %else |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
701 cglobal x264_deblock_h_luma_intra_%1, 2,4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
702 lea r3, [r1*3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
703 sub r0, 4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
704 lea r2, [r0+r3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
705 %assign pad 0x8c-(stack_offset&15) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
706 SUB rsp, pad |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
707 %define pix_tmp rsp |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
708 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
709 ; transpose 8x16 -> tmp space |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
710 TRANSPOSE8x8_MEM PASS8ROWS(r0, r2, r1, r3), PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
711 lea r0, [r0+r1*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
712 lea r2, [r2+r1*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
713 TRANSPOSE8x8_MEM PASS8ROWS(r0, r2, r1, r3), PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
714 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
715 lea r0, [pix_tmp+0x40] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
716 PUSH dword r3m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
717 PUSH dword r2m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
718 PUSH dword 16 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
719 PUSH r0 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
720 call x264_deblock_%2_luma_intra_%1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
721 %ifidn %2, v8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
722 add dword [rsp], 8 ; pix_tmp+8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
723 call x264_deblock_%2_luma_intra_%1 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
724 %endif |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
725 ADD esp, 16 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
726 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
727 mov r1, r1m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
728 mov r0, r0m |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
729 lea r3, [r1*3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
730 sub r0, 4 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
731 lea r2, [r0+r3] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
732 ; transpose 16x6 -> original space (but we can't write only 6 pixels, so really 16x8) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
733 TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp, pix_tmp+0x30, 0x10, 0x30), PASS8ROWS(r0, r2, r1, r3) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
734 lea r0, [r0+r1*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
735 lea r2, [r2+r1*8] |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
736 TRANSPOSE8x8_MEM PASS8ROWS(pix_tmp+8, pix_tmp+0x38, 0x10, 0x30), PASS8ROWS(r0, r2, r1, r3) |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
737 ADD rsp, pad |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
738 RET |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
739 %endif ; ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
740 %endmacro ; DEBLOCK_LUMA_INTRA |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
741 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
742 INIT_XMM |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
743 DEBLOCK_LUMA_INTRA sse2, v |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
744 %ifndef ARCH_X86_64 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
745 INIT_MMX |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
746 DEBLOCK_LUMA_INTRA mmxext, v8 |
37ac731fe32c
Convert x264 asm files to proper unix line breaks
darkshikari
parents:
9005
diff
changeset
|
747 %endif |