Mercurial > libavcodec.hg
annotate x86/x86util.asm @ 12009:8c82dfce2f24 libavcodec
vorbis: cosmetics, remove trailing comma for values that will never have
anything added
author | conrad |
---|---|
date | Tue, 29 Jun 2010 06:42:08 +0000 |
parents | 88563eada57f |
children | 2ae70e2c31a4 |
rev | line source |
---|---|
8510 | 1 ;***************************************************************************** |
8804
ba83a0c57e9f
Fix wrong file name in header, noticed by David DeHaven, dave sagetv com.
diego
parents:
8510
diff
changeset
|
2 ;* x86util.asm |
8510 | 3 ;***************************************************************************** |
12005
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
4 ;* Copyright (C) 2008-2010 x264 project |
8510 | 5 ;* |
12005
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
6 ;* Authors: Loren Merritt <lorenm@u.washington.edu> |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
7 ;* Holger Lubitz <holger@lubitz.org> |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
8 ;* |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
9 ;* This file is part of FFmpeg. |
8510 | 10 ;* |
12005
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
11 ;* FFmpeg is free software; you can redistribute it and/or |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
12 ;* modify it under the terms of the GNU Lesser General Public |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
13 ;* License as published by the Free Software Foundation; either |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
14 ;* version 2.1 of the License, or (at your option) any later version. |
8510 | 15 ;* |
12005
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
16 ;* FFmpeg is distributed in the hope that it will be useful, |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
17 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
18 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
19 ;* Lesser General Public License for more details. |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
20 ;* |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
21 ;* You should have received a copy of the GNU Lesser General Public |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
22 ;* License along with FFmpeg; if not, write to the Free Software |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
23 ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
88563eada57f
Make x86util.asm LGPL so we can use it in LGPL asm
darkshikari
parents:
11931
diff
changeset
|
24 ;****************************************************************************** |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
25 |
8510 | 26 %macro SBUTTERFLY 4 |
27 mova m%4, m%2 | |
28 punpckl%1 m%2, m%3 | |
29 punpckh%1 m%4, m%3 | |
30 SWAP %3, %4 | |
31 %endmacro | |
32 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
33 %macro SBUTTERFLY2 4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
34 mova m%4, m%2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
35 punpckh%1 m%2, m%3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
36 punpckl%1 m%4, m%3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
37 SWAP %2, %4, %3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
38 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
39 |
8510 | 40 %macro TRANSPOSE4x4W 5 |
41 SBUTTERFLY wd, %1, %2, %5 | |
42 SBUTTERFLY wd, %3, %4, %5 | |
43 SBUTTERFLY dq, %1, %3, %5 | |
44 SBUTTERFLY dq, %2, %4, %5 | |
45 SWAP %2, %3 | |
46 %endmacro | |
47 | |
48 %macro TRANSPOSE2x4x4W 5 | |
49 SBUTTERFLY wd, %1, %2, %5 | |
50 SBUTTERFLY wd, %3, %4, %5 | |
51 SBUTTERFLY dq, %1, %3, %5 | |
52 SBUTTERFLY dq, %2, %4, %5 | |
53 SBUTTERFLY qdq, %1, %2, %5 | |
54 SBUTTERFLY qdq, %3, %4, %5 | |
55 %endmacro | |
56 | |
57 %macro TRANSPOSE4x4D 5 | |
58 SBUTTERFLY dq, %1, %2, %5 | |
59 SBUTTERFLY dq, %3, %4, %5 | |
60 SBUTTERFLY qdq, %1, %3, %5 | |
61 SBUTTERFLY qdq, %2, %4, %5 | |
62 SWAP %2, %3 | |
63 %endmacro | |
64 | |
65 %macro TRANSPOSE8x8W 9-11 | |
66 %ifdef ARCH_X86_64 | |
67 SBUTTERFLY wd, %1, %2, %9 | |
68 SBUTTERFLY wd, %3, %4, %9 | |
69 SBUTTERFLY wd, %5, %6, %9 | |
70 SBUTTERFLY wd, %7, %8, %9 | |
71 SBUTTERFLY dq, %1, %3, %9 | |
72 SBUTTERFLY dq, %2, %4, %9 | |
73 SBUTTERFLY dq, %5, %7, %9 | |
74 SBUTTERFLY dq, %6, %8, %9 | |
75 SBUTTERFLY qdq, %1, %5, %9 | |
76 SBUTTERFLY qdq, %2, %6, %9 | |
77 SBUTTERFLY qdq, %3, %7, %9 | |
78 SBUTTERFLY qdq, %4, %8, %9 | |
79 SWAP %2, %5 | |
80 SWAP %4, %7 | |
81 %else | |
82 ; in: m0..m7, unless %11 in which case m6 is in %9 | |
83 ; out: m0..m7, unless %11 in which case m4 is in %10 | |
84 ; spills into %9 and %10 | |
85 %if %0<11 | |
86 movdqa %9, m%7 | |
87 %endif | |
88 SBUTTERFLY wd, %1, %2, %7 | |
89 movdqa %10, m%2 | |
90 movdqa m%7, %9 | |
91 SBUTTERFLY wd, %3, %4, %2 | |
92 SBUTTERFLY wd, %5, %6, %2 | |
93 SBUTTERFLY wd, %7, %8, %2 | |
94 SBUTTERFLY dq, %1, %3, %2 | |
95 movdqa %9, m%3 | |
96 movdqa m%2, %10 | |
97 SBUTTERFLY dq, %2, %4, %3 | |
98 SBUTTERFLY dq, %5, %7, %3 | |
99 SBUTTERFLY dq, %6, %8, %3 | |
100 SBUTTERFLY qdq, %1, %5, %3 | |
101 SBUTTERFLY qdq, %2, %6, %3 | |
102 movdqa %10, m%2 | |
103 movdqa m%3, %9 | |
104 SBUTTERFLY qdq, %3, %7, %2 | |
105 SBUTTERFLY qdq, %4, %8, %2 | |
106 SWAP %2, %5 | |
107 SWAP %4, %7 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
108 %if %0<11 |
8510 | 109 movdqa m%5, %10 |
110 %endif | |
111 %endif | |
112 %endmacro | |
113 | |
114 %macro ABS1_MMX 2 ; a, tmp | |
115 pxor %2, %2 | |
116 psubw %2, %1 | |
117 pmaxsw %1, %2 | |
118 %endmacro | |
119 | |
120 %macro ABS2_MMX 4 ; a, b, tmp0, tmp1 | |
121 pxor %3, %3 | |
122 pxor %4, %4 | |
123 psubw %3, %1 | |
124 psubw %4, %2 | |
125 pmaxsw %1, %3 | |
126 pmaxsw %2, %4 | |
127 %endmacro | |
128 | |
129 %macro ABS1_SSSE3 2 | |
130 pabsw %1, %1 | |
131 %endmacro | |
132 | |
133 %macro ABS2_SSSE3 4 | |
134 pabsw %1, %1 | |
135 pabsw %2, %2 | |
136 %endmacro | |
137 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
138 %macro ABSB_MMX 2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
139 pxor %2, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
140 psubb %2, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
141 pminub %1, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
142 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
143 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
144 %macro ABSB2_MMX 4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
145 pxor %3, %3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
146 pxor %4, %4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
147 psubb %3, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
148 psubb %4, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
149 pminub %1, %3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
150 pminub %2, %4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
151 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
152 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
153 %macro ABSB_SSSE3 2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
154 pabsb %1, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
155 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
156 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
157 %macro ABSB2_SSSE3 4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
158 pabsb %1, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
159 pabsb %2, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
160 %endmacro |
8510 | 161 |
162 %macro ABS4 6 | |
163 ABS2 %1, %2, %5, %6 | |
164 ABS2 %3, %4, %5, %6 | |
165 %endmacro | |
166 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
167 %define ABS1 ABS1_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
168 %define ABS2 ABS2_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
169 %define ABSB ABSB_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
170 %define ABSB2 ABSB2_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
171 |
8510 | 172 %macro SPLATB_MMX 3 |
173 movd %1, [%2-3] ;to avoid crossing a cacheline | |
174 punpcklbw %1, %1 | |
175 %if mmsize==16 | |
176 pshuflw %1, %1, 0xff | |
177 punpcklqdq %1, %1 | |
178 %else | |
179 pshufw %1, %1, 0xff | |
180 %endif | |
181 %endmacro | |
182 | |
183 %macro SPLATB_SSSE3 3 | |
184 movd %1, [%2-3] | |
185 pshufb %1, %3 | |
186 %endmacro | |
187 | |
188 %macro PALIGNR_MMX 4 | |
189 %ifnidn %4, %2 | |
190 mova %4, %2 | |
191 %endif | |
192 %if mmsize == 8 | |
193 psllq %1, (8-%3)*8 | |
194 psrlq %4, %3*8 | |
195 %else | |
196 pslldq %1, 16-%3 | |
197 psrldq %4, %3 | |
198 %endif | |
199 por %1, %4 | |
200 %endmacro | |
201 | |
202 %macro PALIGNR_SSSE3 4 | |
203 palignr %1, %2, %3 | |
204 %endmacro | |
205 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
206 %macro DEINTB 5 ; mask, reg1, mask, reg2, optional src to fill masks from |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
207 %ifnum %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
208 mova m%1, m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
209 mova m%3, m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
210 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
211 mova m%1, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
212 mova m%3, m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
213 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
214 pand m%1, m%2 ; dst .. y6 .. y4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
215 pand m%3, m%4 ; src .. y6 .. y4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
216 psrlw m%2, 8 ; dst .. y7 .. y5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
217 psrlw m%4, 8 ; src .. y7 .. y5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
218 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
219 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
220 %macro SUMSUB_BA 2-3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
221 %if %0==2 |
8510 | 222 paddw %1, %2 |
223 paddw %2, %2 | |
224 psubw %2, %1 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
225 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
226 mova %3, %1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
227 paddw %1, %2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
228 psubw %2, %3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
229 %endif |
8510 | 230 %endmacro |
231 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
232 %macro SUMSUB_BADC 4-5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
233 %if %0==5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
234 SUMSUB_BA %1, %2, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
235 SUMSUB_BA %3, %4, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
236 %else |
8510 | 237 paddw %1, %2 |
238 paddw %3, %4 | |
239 paddw %2, %2 | |
240 paddw %4, %4 | |
241 psubw %2, %1 | |
242 psubw %4, %3 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
243 %endif |
8510 | 244 %endmacro |
245 | |
246 %macro SUMSUB2_AB 3 | |
247 mova %3, %1 | |
248 paddw %1, %1 | |
249 paddw %1, %2 | |
250 psubw %3, %2 | |
251 psubw %3, %2 | |
252 %endmacro | |
253 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
254 %macro SUMSUB2_BA 3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
255 mova m%3, m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
256 paddw m%1, m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
257 paddw m%1, m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
258 psubw m%2, m%3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
259 psubw m%2, m%3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
260 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
261 |
8510 | 262 %macro SUMSUBD2_AB 4 |
263 mova %4, %1 | |
264 mova %3, %2 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
265 psraw %2, 1 ; %2: %2>>1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
266 psraw %1, 1 ; %1: %1>>1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
267 paddw %2, %4 ; %2: %2>>1+%1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
268 psubw %1, %3 ; %1: %1>>1-%2 |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
269 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
270 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
271 %macro DCT4_1D 5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
272 %ifnum %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
273 SUMSUB_BADC m%4, m%1, m%3, m%2; m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
274 SUMSUB_BA m%3, m%4, m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
275 SUMSUB2_AB m%1, m%2, m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
276 SWAP %1, %3, %4, %5, %2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
277 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
278 SUMSUB_BADC m%4, m%1, m%3, m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
279 SUMSUB_BA m%3, m%4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
280 mova [%5], m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
281 SUMSUB2_AB m%1, [%5], m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
282 SWAP %1, %3, %4, %2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
283 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
284 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
285 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
286 %macro IDCT4_1D 5-6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
287 %ifnum %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
288 SUMSUBD2_AB m%2, m%4, m%6, m%5 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
289 ; %2: %2>>1-%4 %4: %2+%4>>1 |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
290 SUMSUB_BA m%3, m%1, m%6 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
291 ; %3: %1+%3 %1: %1-%3 |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
292 SUMSUB_BADC m%4, m%3, m%2, m%1, m%6 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
293 ; %4: %1+%3 + (%2+%4>>1) |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
294 ; %3: %1+%3 - (%2+%4>>1) |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
295 ; %2: %1-%3 + (%2>>1-%4) |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
296 ; %1: %1-%3 - (%2>>1-%4) |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
297 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
298 SUMSUBD2_AB m%2, m%4, [%5], [%5+16] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
299 SUMSUB_BA m%3, m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
300 SUMSUB_BADC m%4, m%3, m%2, m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
301 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
302 SWAP %1, %4, %3 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
303 ; %1: %1+%3 + (%2+%4>>1) row0 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
304 ; %2: %1-%3 + (%2>>1-%4) row1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
305 ; %3: %1-%3 - (%2>>1-%4) row2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
306 ; %4: %1+%3 - (%2+%4>>1) row3 |
8510 | 307 %endmacro |
308 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
309 |
8510 | 310 %macro LOAD_DIFF 5 |
311 %ifidn %3, none | |
312 movh %1, %4 | |
313 movh %2, %5 | |
314 punpcklbw %1, %2 | |
315 punpcklbw %2, %2 | |
316 psubw %1, %2 | |
317 %else | |
318 movh %1, %4 | |
319 punpcklbw %1, %3 | |
320 movh %2, %5 | |
321 punpcklbw %2, %3 | |
322 psubw %1, %2 | |
323 %endif | |
324 %endmacro | |
325 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
326 %macro STORE_DCT 6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
327 movq [%5+%6+ 0], m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
328 movq [%5+%6+ 8], m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
329 movq [%5+%6+16], m%3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
330 movq [%5+%6+24], m%4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
331 movhps [%5+%6+32], m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
332 movhps [%5+%6+40], m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
333 movhps [%5+%6+48], m%3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
334 movhps [%5+%6+56], m%4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
335 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
336 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
337 %macro LOAD_DIFF_8x4P 7-10 r0,r2,0 ; 4x dest, 2x temp, 2x pointer, increment? |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
338 LOAD_DIFF m%1, m%5, m%7, [%8], [%9] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
339 LOAD_DIFF m%2, m%6, m%7, [%8+r1], [%9+r3] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
340 LOAD_DIFF m%3, m%5, m%7, [%8+2*r1], [%9+2*r3] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
341 LOAD_DIFF m%4, m%6, m%7, [%8+r4], [%9+r5] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
342 %if %10 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
343 lea %8, [%8+4*r1] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
344 lea %9, [%9+4*r3] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
345 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
346 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
347 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
348 %macro DIFFx2 6-7 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
349 movh %3, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
350 punpcklbw %3, %4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
351 psraw %1, 6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
352 paddsw %1, %3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
353 movh %3, %6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
354 punpcklbw %3, %4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
355 psraw %2, 6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
356 paddsw %2, %3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
357 packuswb %2, %1 |
8510 | 358 %endmacro |
359 | |
360 %macro STORE_DIFF 4 | |
361 movh %2, %4 | |
362 punpcklbw %2, %3 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
363 psraw %1, 6 |
8510 | 364 paddsw %1, %2 |
365 packuswb %1, %1 | |
366 movh %4, %1 | |
367 %endmacro |