Mercurial > libavcodec.hg
annotate x86/x86util.asm @ 12130:917a70cf7681 libavcodec
Document that and why subtitle decoders do not support direct-rendering.
author | reimar |
---|---|
date | Sat, 10 Jul 2010 23:35:15 +0000 |
parents | d780ae746855 |
children | 846779f6b164 |
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 |
12086
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
40 %macro TRANSPOSE4x4B 5 |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
41 SBUTTERFLY bw, %1, %2, %5 |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
42 SBUTTERFLY bw, %3, %4, %5 |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
43 SBUTTERFLY wd, %1, %3, %5 |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
44 SBUTTERFLY wd, %2, %4, %5 |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
45 SWAP %2, %3 |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
46 %endmacro |
d780ae746855
Simple H/V loopfilter for VP8 in MMX, MMX2 and SSE2 (yay for yasm macros).
rbultje
parents:
12013
diff
changeset
|
47 |
8510 | 48 %macro TRANSPOSE4x4W 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 SWAP %2, %3 | |
54 %endmacro | |
55 | |
56 %macro TRANSPOSE2x4x4W 5 | |
57 SBUTTERFLY wd, %1, %2, %5 | |
58 SBUTTERFLY wd, %3, %4, %5 | |
59 SBUTTERFLY dq, %1, %3, %5 | |
60 SBUTTERFLY dq, %2, %4, %5 | |
61 SBUTTERFLY qdq, %1, %2, %5 | |
62 SBUTTERFLY qdq, %3, %4, %5 | |
63 %endmacro | |
64 | |
65 %macro TRANSPOSE4x4D 5 | |
66 SBUTTERFLY dq, %1, %2, %5 | |
67 SBUTTERFLY dq, %3, %4, %5 | |
68 SBUTTERFLY qdq, %1, %3, %5 | |
69 SBUTTERFLY qdq, %2, %4, %5 | |
70 SWAP %2, %3 | |
71 %endmacro | |
72 | |
73 %macro TRANSPOSE8x8W 9-11 | |
74 %ifdef ARCH_X86_64 | |
75 SBUTTERFLY wd, %1, %2, %9 | |
76 SBUTTERFLY wd, %3, %4, %9 | |
77 SBUTTERFLY wd, %5, %6, %9 | |
78 SBUTTERFLY wd, %7, %8, %9 | |
79 SBUTTERFLY dq, %1, %3, %9 | |
80 SBUTTERFLY dq, %2, %4, %9 | |
81 SBUTTERFLY dq, %5, %7, %9 | |
82 SBUTTERFLY dq, %6, %8, %9 | |
83 SBUTTERFLY qdq, %1, %5, %9 | |
84 SBUTTERFLY qdq, %2, %6, %9 | |
85 SBUTTERFLY qdq, %3, %7, %9 | |
86 SBUTTERFLY qdq, %4, %8, %9 | |
87 SWAP %2, %5 | |
88 SWAP %4, %7 | |
89 %else | |
90 ; in: m0..m7, unless %11 in which case m6 is in %9 | |
91 ; out: m0..m7, unless %11 in which case m4 is in %10 | |
92 ; spills into %9 and %10 | |
93 %if %0<11 | |
94 movdqa %9, m%7 | |
95 %endif | |
96 SBUTTERFLY wd, %1, %2, %7 | |
97 movdqa %10, m%2 | |
98 movdqa m%7, %9 | |
99 SBUTTERFLY wd, %3, %4, %2 | |
100 SBUTTERFLY wd, %5, %6, %2 | |
101 SBUTTERFLY wd, %7, %8, %2 | |
102 SBUTTERFLY dq, %1, %3, %2 | |
103 movdqa %9, m%3 | |
104 movdqa m%2, %10 | |
105 SBUTTERFLY dq, %2, %4, %3 | |
106 SBUTTERFLY dq, %5, %7, %3 | |
107 SBUTTERFLY dq, %6, %8, %3 | |
108 SBUTTERFLY qdq, %1, %5, %3 | |
109 SBUTTERFLY qdq, %2, %6, %3 | |
110 movdqa %10, m%2 | |
111 movdqa m%3, %9 | |
112 SBUTTERFLY qdq, %3, %7, %2 | |
113 SBUTTERFLY qdq, %4, %8, %2 | |
114 SWAP %2, %5 | |
115 SWAP %4, %7 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
116 %if %0<11 |
8510 | 117 movdqa m%5, %10 |
118 %endif | |
119 %endif | |
120 %endmacro | |
121 | |
122 %macro ABS1_MMX 2 ; a, tmp | |
123 pxor %2, %2 | |
124 psubw %2, %1 | |
125 pmaxsw %1, %2 | |
126 %endmacro | |
127 | |
128 %macro ABS2_MMX 4 ; a, b, tmp0, tmp1 | |
129 pxor %3, %3 | |
130 pxor %4, %4 | |
131 psubw %3, %1 | |
132 psubw %4, %2 | |
133 pmaxsw %1, %3 | |
134 pmaxsw %2, %4 | |
135 %endmacro | |
136 | |
137 %macro ABS1_SSSE3 2 | |
138 pabsw %1, %1 | |
139 %endmacro | |
140 | |
141 %macro ABS2_SSSE3 4 | |
142 pabsw %1, %1 | |
143 pabsw %2, %2 | |
144 %endmacro | |
145 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
146 %macro ABSB_MMX 2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
147 pxor %2, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
148 psubb %2, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
149 pminub %1, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
150 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
151 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
152 %macro ABSB2_MMX 4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
153 pxor %3, %3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
154 pxor %4, %4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
155 psubb %3, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
156 psubb %4, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
157 pminub %1, %3 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
158 pminub %2, %4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
159 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
160 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
161 %macro ABSB_SSSE3 2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
162 pabsb %1, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
163 %endmacro |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
164 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
165 %macro ABSB2_SSSE3 4 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
166 pabsb %1, %1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
167 pabsb %2, %2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
168 %endmacro |
8510 | 169 |
170 %macro ABS4 6 | |
171 ABS2 %1, %2, %5, %6 | |
172 ABS2 %3, %4, %5, %6 | |
173 %endmacro | |
174 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
175 %define ABS1 ABS1_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
176 %define ABS2 ABS2_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
177 %define ABSB ABSB_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
178 %define ABSB2 ABSB2_MMX |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
179 |
8510 | 180 %macro SPLATB_MMX 3 |
181 movd %1, [%2-3] ;to avoid crossing a cacheline | |
182 punpcklbw %1, %1 | |
183 %if mmsize==16 | |
184 pshuflw %1, %1, 0xff | |
185 punpcklqdq %1, %1 | |
186 %else | |
187 pshufw %1, %1, 0xff | |
188 %endif | |
189 %endmacro | |
190 | |
191 %macro SPLATB_SSSE3 3 | |
192 movd %1, [%2-3] | |
193 pshufb %1, %3 | |
194 %endmacro | |
195 | |
196 %macro PALIGNR_MMX 4 | |
197 %ifnidn %4, %2 | |
198 mova %4, %2 | |
199 %endif | |
200 %if mmsize == 8 | |
201 psllq %1, (8-%3)*8 | |
202 psrlq %4, %3*8 | |
203 %else | |
204 pslldq %1, 16-%3 | |
205 psrldq %4, %3 | |
206 %endif | |
207 por %1, %4 | |
208 %endmacro | |
209 | |
210 %macro PALIGNR_SSSE3 4 | |
211 palignr %1, %2, %3 | |
212 %endmacro | |
213 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
214 %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
|
215 %ifnum %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
216 mova m%1, m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
217 mova m%3, m%5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
218 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
219 mova m%1, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
220 mova m%3, m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
221 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
222 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
|
223 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
|
224 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
|
225 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
|
226 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
227 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
228 %macro SUMSUB_BA 2-3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
229 %if %0==2 |
8510 | 230 paddw %1, %2 |
231 paddw %2, %2 | |
232 psubw %2, %1 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
233 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
234 mova %3, %1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
235 paddw %1, %2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
236 psubw %2, %3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
237 %endif |
8510 | 238 %endmacro |
239 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
240 %macro SUMSUB_BADC 4-5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
241 %if %0==5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
242 SUMSUB_BA %1, %2, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
243 SUMSUB_BA %3, %4, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
244 %else |
8510 | 245 paddw %1, %2 |
246 paddw %3, %4 | |
247 paddw %2, %2 | |
248 paddw %4, %4 | |
249 psubw %2, %1 | |
250 psubw %4, %3 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
251 %endif |
8510 | 252 %endmacro |
253 | |
254 %macro SUMSUB2_AB 3 | |
255 mova %3, %1 | |
256 paddw %1, %1 | |
257 paddw %1, %2 | |
258 psubw %3, %2 | |
259 psubw %3, %2 | |
260 %endmacro | |
261 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
262 %macro SUMSUB2_BA 3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
263 mova m%3, m%1 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
264 paddw m%1, m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
265 paddw m%1, m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
266 psubw m%2, m%3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
267 psubw m%2, m%3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
268 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
269 |
8510 | 270 %macro SUMSUBD2_AB 4 |
271 mova %4, %1 | |
272 mova %3, %2 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
273 psraw %2, 1 ; %2: %2>>1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
274 psraw %1, 1 ; %1: %1>>1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
275 paddw %2, %4 ; %2: %2>>1+%1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
276 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
|
277 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
278 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
279 %macro DCT4_1D 5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
280 %ifnum %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
281 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
|
282 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
|
283 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
|
284 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
|
285 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
286 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
|
287 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
|
288 mova [%5], m%2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
289 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
|
290 SWAP %1, %3, %4, %2 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
291 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
292 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
293 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
294 %macro IDCT4_1D 5-6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
295 %ifnum %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
296 SUMSUBD2_AB m%2, m%4, m%6, m%5 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
297 ; %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
|
298 SUMSUB_BA m%3, m%1, m%6 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
299 ; %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
|
300 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
|
301 ; %4: %1+%3 + (%2+%4>>1) |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
302 ; %3: %1+%3 - (%2+%4>>1) |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
303 ; %2: %1-%3 + (%2>>1-%4) |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
304 ; %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
|
305 %else |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
306 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
|
307 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
|
308 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
|
309 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
310 SWAP %1, %4, %3 |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
311 ; %1: %1+%3 + (%2+%4>>1) row0 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
312 ; %2: %1-%3 + (%2>>1-%4) row1 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
313 ; %3: %1-%3 - (%2>>1-%4) row2 |
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
314 ; %4: %1+%3 - (%2+%4>>1) row3 |
8510 | 315 %endmacro |
316 | |
11931
980030a3e315
Update x264asm header files to latest versions.
darkshikari
parents:
10019
diff
changeset
|
317 |
8510 | 318 %macro LOAD_DIFF 5 |
319 %ifidn %3, none | |
320 movh %1, %4 | |
321 movh %2, %5 | |
322 punpcklbw %1, %2 | |
323 punpcklbw %2, %2 | |
324 psubw %1, %2 | |
325 %else | |
326 movh %1, %4 | |
327 punpcklbw %1, %3 | |
328 movh %2, %5 | |
329 punpcklbw %2, %3 | |
330 psubw %1, %2 | |
331 %endif | |
332 %endmacro | |
333 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
334 %macro STORE_DCT 6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
335 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
|
336 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
|
337 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
|
338 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
|
339 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
|
340 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
|
341 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
|
342 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
|
343 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
344 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
345 %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
|
346 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
|
347 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
|
348 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
|
349 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
|
350 %if %10 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
351 lea %8, [%8+4*r1] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
352 lea %9, [%9+4*r3] |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
353 %endif |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
354 %endmacro |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
355 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
356 %macro DIFFx2 6-7 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
357 movh %3, %5 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
358 punpcklbw %3, %4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
359 psraw %1, 6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
360 paddsw %1, %3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
361 movh %3, %6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
362 punpcklbw %3, %4 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
363 psraw %2, 6 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
364 paddsw %2, %3 |
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
365 packuswb %2, %1 |
8510 | 366 %endmacro |
367 | |
368 %macro STORE_DIFF 4 | |
369 movh %2, %4 | |
370 punpcklbw %2, %3 | |
10019
c08ca946c80a
Update x264 asm code to latest to add support for 64-bit Windows.
darkshikari
parents:
8804
diff
changeset
|
371 psraw %1, 6 |
8510 | 372 paddsw %1, %2 |
373 packuswb %1, %1 | |
374 movh %4, %1 | |
375 %endmacro | |
12013 | 376 |
377 %macro STORE_DIFFx2 8 ; add1, add2, reg1, reg2, zero, shift, source, stride | |
378 movh %3, [%7] | |
379 movh %4, [%7+%8] | |
380 punpcklbw %3, %5 | |
381 punpcklbw %4, %5 | |
382 psraw %1, %6 | |
383 psraw %2, %6 | |
384 paddw %3, %1 | |
385 paddw %4, %2 | |
386 packuswb %3, %5 | |
387 packuswb %4, %5 | |
388 movh [%7], %3 | |
389 movh [%7+%8], %4 | |
390 %endmacro |