Parent Directory
|
Revision Log
Revision 1104 - (view) (download)
1 : | chl | 432 | ;/***************************************************************************** |
2 : | ; * | ||
3 : | ; * XVID MPEG-4 VIDEO CODEC | ||
4 : | chl | 460 | ; * mmx version - fast discrete cosine transformation |
5 : | chl | 432 | ; * |
6 : | chl | 460 | ; * Initial version provided by Intel at AppNote AP-922 |
7 : | chl | 432 | ; * Copyright (C) 1999 Intel Corporation, |
8 : | chl | 460 | ; * |
9 : | ; * completed and corrected | ||
10 : | chl | 432 | ; * Copyright (C) 2000 - Royce Shih-Wea Liao <liaor@iname.com>, |
11 : | chl | 460 | ; * |
12 : | chl | 432 | ; * ported to NASM and some minor changes |
13 : | ; * Copyright (C) 2001 - Michael Militzer <isibaar@xvid.org> | ||
14 : | chl | 460 | ; * |
15 : | edgomez | 649 | ; * This file is part of XviD, a free MPEG-4 video encoder/decoder |
16 : | chl | 432 | ; * |
17 : | edgomez | 649 | ; * XviD is free software; you can redistribute it and/or modify it |
18 : | ; * under the terms of the GNU General Public License as published by | ||
19 : | chl | 432 | ; * the Free Software Foundation; either version 2 of the License, or |
20 : | ; * (at your option) any later version. | ||
21 : | ; * | ||
22 : | ; * This program is distributed in the hope that it will be useful, | ||
23 : | ; * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 : | ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 : | ; * GNU General Public License for more details. | ||
26 : | ; * | ||
27 : | ; * You should have received a copy of the GNU General Public License | ||
28 : | ; * along with this program; if not, write to the Free Software | ||
29 : | ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
30 : | ; * | ||
31 : | edgomez | 649 | ; * Under section 8 of the GNU General Public License, the copyright |
32 : | ; * holders of XVID explicitly forbid distribution in the following | ||
33 : | ; * countries: | ||
34 : | ; * | ||
35 : | ; * - Japan | ||
36 : | ; * - United States of America | ||
37 : | ; * | ||
38 : | ; * Linking XviD statically or dynamically with other modules is making a | ||
39 : | ; * combined work based on XviD. Thus, the terms and conditions of the | ||
40 : | ; * GNU General Public License cover the whole combination. | ||
41 : | ; * | ||
42 : | ; * As a special exception, the copyright holders of XviD give you | ||
43 : | ; * permission to link XviD with independent modules that communicate with | ||
44 : | ; * XviD solely through the VFW1.1 and DShow interfaces, regardless of the | ||
45 : | ; * license terms of these independent modules, and to copy and distribute | ||
46 : | ; * the resulting combined work under terms of your choice, provided that | ||
47 : | ; * every copy of the combined work is accompanied by a complete copy of | ||
48 : | ; * the source code of XviD (the version of XviD used to produce the | ||
49 : | ; * combined work), being distributed under the terms of the GNU General | ||
50 : | ; * Public License plus this exception. An independent module is a module | ||
51 : | ; * which is not derived from or based on XviD. | ||
52 : | ; * | ||
53 : | ; * Note that people who make modified versions of XviD are not obligated | ||
54 : | ; * to grant this special exception for their modified versions; it is | ||
55 : | ; * their choice whether to do so. The GNU General Public License gives | ||
56 : | ; * permission to release a modified version without this exception; this | ||
57 : | ; * exception also makes it possible to release a modified version which | ||
58 : | ; * carries forward this exception. | ||
59 : | ; * | ||
60 : | ; * $Id: fdct_mmx.asm,v 1.6 2002-11-16 23:51:58 edgomez Exp $ | ||
61 : | ; * | ||
62 : | chl | 460 | ; *************************************************************************/ |
63 : | Isibaar | 154 | |
64 : | BITS 32 | ||
65 : | |||
66 : | %macro cglobal 1 | ||
67 : | %ifdef PREFIX | ||
68 : | global _%1 | ||
69 : | %define %1 _%1 | ||
70 : | %else | ||
71 : | global %1 | ||
72 : | %endif | ||
73 : | %endmacro | ||
74 : | |||
75 : | %define INP eax | ||
76 : | %define TABLE ebx | ||
77 : | %define TABLEF ebx | ||
78 : | %define OUT ecx | ||
79 : | %define round_frw_row edx | ||
80 : | |||
81 : | %define INP_1 eax + 16 | ||
82 : | %define INP_2 eax + 32 | ||
83 : | %define INP_3 eax + 48 | ||
84 : | %define INP_4 eax + 64 | ||
85 : | %define INP_5 eax + 80 | ||
86 : | %define INP_6 eax + 96 | ||
87 : | %define INP_7 eax + 112 | ||
88 : | |||
89 : | %define OUT_1 ecx + 16 | ||
90 : | %define OUT_2 ecx + 32 | ||
91 : | %define OUT_3 ecx + 48 | ||
92 : | %define OUT_4 ecx + 64 | ||
93 : | %define OUT_5 ecx + 80 | ||
94 : | %define OUT_6 ecx + 96 | ||
95 : | %define OUT_7 ecx + 112 | ||
96 : | %define OUT_8 ecx + 128 | ||
97 : | |||
98 : | %define TABLE_1 ebx + 64 | ||
99 : | %define TABLE_2 ebx + 128 | ||
100 : | %define TABLE_3 ebx + 192 | ||
101 : | %define TABLE_4 ebx + 256 | ||
102 : | %define TABLE_5 ebx + 320 | ||
103 : | %define TABLE_6 ebx + 384 | ||
104 : | %define TABLE_7 ebx + 448 | ||
105 : | |||
106 : | %define x0 INP + 0*16 | ||
107 : | %define x1 INP + 1*16 | ||
108 : | %define x2 INP + 2*16 | ||
109 : | %define x3 INP + 3*16 | ||
110 : | %define x4 INP + 4*16 | ||
111 : | %define x5 INP + 5*16 | ||
112 : | %define x6 INP + 6*16 | ||
113 : | %define x7 INP + 7*16 | ||
114 : | %define y0 OUT + 0*16 | ||
115 : | %define y1 OUT + 1*16 | ||
116 : | %define y2 OUT + 2*16 | ||
117 : | %define y3 OUT + 3*16 | ||
118 : | %define y4 OUT + 4*16 | ||
119 : | %define y5 OUT + 5*16 | ||
120 : | %define y6 OUT + 6*16 | ||
121 : | %define y7 OUT + 7*16 | ||
122 : | |||
123 : | %define tg_1_16 (TABLEF + 0) | ||
124 : | %define tg_2_16 (TABLEF + 8) | ||
125 : | %define tg_3_16 (TABLEF + 16) | ||
126 : | %define cos_4_16 (TABLEF + 24) | ||
127 : | %define ocos_4_16 (TABLEF + 32) | ||
128 : | |||
129 : | ;---added for sse2 | ||
130 : | %define tg_1_16_2 (TABLEF + 0) | ||
131 : | %define tg_2_16_2 (TABLEF + 16) | ||
132 : | %define tg_3_16_2 (TABLEF + 32) | ||
133 : | %define cos_4_16_2 (TABLEF + 48) | ||
134 : | %define ocos_4_16_2 (TABLEF + 64) | ||
135 : | ;--- | ||
136 : | |||
137 : | %ifdef FORMAT_COFF | ||
138 : | SECTION .data data | ||
139 : | %else | ||
140 : | SECTION .data data align=64 | ||
141 : | %endif | ||
142 : | |||
143 : | |||
144 : | ALIGN 16 | ||
145 : | |||
146 : | suxen_drol | 207 | BITS_FRW_ACC equ 3 ; 2 or 3 for accuracy |
147 : | SHIFT_FRW_COL equ BITS_FRW_ACC | ||
148 : | SHIFT_FRW_ROW equ (BITS_FRW_ACC + 17) | ||
149 : | Isibaar | 154 | RND_FRW_ROW equ (1 << (SHIFT_FRW_ROW-1)) |
150 : | suxen_drol | 207 | |
151 : | SHIFT_FRW_ROW_CLIP2 equ (4) | ||
152 : | Isibaar | 154 | SHIFT_FRW_ROW_CLIP1 equ (SHIFT_FRW_ROW - SHIFT_FRW_ROW_CLIP2) |
153 : | |||
154 : | PASS1_BITS equ (2) | ||
155 : | CONST_BITS equ (13) | ||
156 : | |||
157 : | one_corr dw 1, 1, 1, 1 | ||
158 : | |||
159 : | ;---added for sse2 | ||
160 : | align 16 | ||
161 : | one_corr_2 dw 1, 1, 1, 1, | ||
162 : | dw 1, 1, 1, 1 | ||
163 : | ;--- | ||
164 : | |||
165 : | r_frw_row dd RND_FRW_ROW, RND_FRW_ROW | ||
166 : | |||
167 : | |||
168 : | tg_all_16 dw 13036, 13036, 13036, 13036, ; tg * (2<<16) + 0.5 | ||
169 : | dw 27146, 27146, 27146, 27146, ; tg * (2<<16) + 0.5 | ||
170 : | dw -21746, -21746, -21746, -21746, ; tg * (2<<16) + 0.5 | ||
171 : | dw -19195, -19195, -19195, -19195, ; cos * (2<<16) + 0.5 | ||
172 : | dw 23170, 23170, 23170, 23170 ; cos * (2<<15) + 0.5 | ||
173 : | |||
174 : | ;---added for sse2 | ||
175 : | align 16 | ||
176 : | tg_all_16_2 dw 13036, 13036, 13036, 13036, ; tg * (2<<16) + 0.5 | ||
177 : | dw 13036, 13036, 13036, 13036, | ||
178 : | dw 27146, 27146, 27146, 27146, ; tg * (2<<16) + 0.5 | ||
179 : | dw 27146, 27146, 27146, 27146, | ||
180 : | dw -21746, -21746, -21746, -21746, ; tg * (2<<16) + 0.5 | ||
181 : | dw -21746, -21746, -21746, -21746, | ||
182 : | dw -19195, -19195, -19195, -19195, ; cos * (2<<16) + 0.5 | ||
183 : | dw -19195, -19195, -19195, -19195, | ||
184 : | dw 23170, 23170, 23170, 23170 ; cos * (2<<15) + 0.5 | ||
185 : | dw 23170, 23170, 23170, 23170 | ||
186 : | ;--- | ||
187 : | |||
188 : | tab_frw_01234567 | ||
189 : | ; row0 | ||
190 : | dw 16384, 16384, 21407, -8867, ; w09 w01 w08 w00 | ||
191 : | dw 16384, 16384, 8867, -21407, ; w13 w05 w12 w04 | ||
192 : | dw 16384, -16384, 8867, 21407, ; w11 w03 w10 w02 | ||
193 : | dw -16384, 16384, -21407, -8867, ; w15 w07 w14 w06 | ||
194 : | dw 22725, 12873, 19266, -22725, ; w22 w20 w18 w16 | ||
195 : | dw 19266, 4520, -4520, -12873, ; w23 w21 w19 w17 | ||
196 : | dw 12873, 4520, 4520, 19266, ; w30 w28 w26 w24 | ||
197 : | dw -22725, 19266, -12873, -22725, ; w31 w29 w27 w25 | ||
198 : | |||
199 : | ; row1 | ||
200 : | dw 22725, 22725, 29692, -12299, ; w09 w01 w08 w00 | ||
201 : | dw 22725, 22725, 12299, -29692, ; w13 w05 w12 w04 | ||
202 : | dw 22725, -22725, 12299, 29692, ; w11 w03 w10 w02 | ||
203 : | dw -22725, 22725, -29692, -12299, ; w15 w07 w14 w06 | ||
204 : | dw 31521, 17855, 26722, -31521, ; w22 w20 w18 w16 | ||
205 : | dw 26722, 6270, -6270, -17855, ; w23 w21 w19 w17 | ||
206 : | dw 17855, 6270, 6270, 26722, ; w30 w28 w26 w24 | ||
207 : | dw -31521, 26722, -17855, -31521, ; w31 w29 w27 w25 | ||
208 : | |||
209 : | ; row2 | ||
210 : | dw 21407, 21407, 27969, -11585, ; w09 w01 w08 w00 | ||
211 : | dw 21407, 21407, 11585, -27969, ; w13 w05 w12 w04 | ||
212 : | dw 21407, -21407, 11585, 27969, ; w11 w03 w10 w02 | ||
213 : | dw -21407, 21407, -27969, -11585, ; w15 w07 w14 w06 | ||
214 : | dw 29692, 16819, 25172, -29692, ; w22 w20 w18 w16 | ||
215 : | dw 25172, 5906, -5906, -16819, ; w23 w21 w19 w17 | ||
216 : | dw 16819, 5906, 5906, 25172, ; w30 w28 w26 w24 | ||
217 : | dw -29692, 25172, -16819, -29692, ; w31 w29 w27 w25 | ||
218 : | |||
219 : | ; row3 | ||
220 : | dw 19266, 19266, 25172, -10426, ; w09 w01 w08 w00 | ||
221 : | dw 19266, 19266, 10426, -25172, ; w13 w05 w12 w04 | ||
222 : | dw 19266, -19266, 10426, 25172, ; w11 w03 w10 w02 | ||
223 : | dw -19266, 19266, -25172, -10426, ; w15 w07 w14 w06 | ||
224 : | dw 26722, 15137, 22654, -26722, ; w22 w20 w18 w16 | ||
225 : | dw 22654, 5315, -5315, -15137, ; w23 w21 w19 w17 | ||
226 : | dw 15137, 5315, 5315, 22654, ; w30 w28 w26 w24 | ||
227 : | dw -26722, 22654, -15137, -26722, ; w31 w29 w27 w25 | ||
228 : | |||
229 : | ; row4 | ||
230 : | dw 16384, 16384, 21407, -8867, ; w09 w01 w08 w00 | ||
231 : | dw 16384, 16384, 8867, -21407, ; w13 w05 w12 w04 | ||
232 : | dw 16384, -16384, 8867, 21407, ; w11 w03 w10 w02 | ||
233 : | dw -16384, 16384, -21407, -8867, ; w15 w07 w14 w06 | ||
234 : | dw 22725, 12873, 19266, -22725, ; w22 w20 w18 w16 | ||
235 : | dw 19266, 4520, -4520, -12873, ; w23 w21 w19 w17 | ||
236 : | dw 12873, 4520, 4520, 19266, ; w30 w28 w26 w24 | ||
237 : | dw -22725, 19266, -12873, -22725, ; w31 w29 w27 w25 | ||
238 : | |||
239 : | ; row5 | ||
240 : | dw 19266, 19266, 25172, -10426, ; w09 w01 w08 w00 | ||
241 : | dw 19266, 19266, 10426, -25172, ; w13 w05 w12 w04 | ||
242 : | dw 19266, -19266, 10426, 25172, ; w11 w03 w10 w02 | ||
243 : | dw -19266, 19266, -25172, -10426, ; w15 w07 w14 w06 | ||
244 : | dw 26722, 15137, 22654, -26722, ; w22 w20 w18 w16 | ||
245 : | dw 22654, 5315, -5315, -15137, ; w23 w21 w19 w17 | ||
246 : | dw 15137, 5315, 5315, 22654, ; w30 w28 w26 w24 | ||
247 : | dw -26722, 22654, -15137, -26722, ; w31 w29 w27 w25 | ||
248 : | |||
249 : | ; row6 | ||
250 : | dw 21407, 21407, 27969, -11585, ; w09 w01 w08 w00 | ||
251 : | dw 21407, 21407, 11585, -27969, ; w13 w05 w12 w04 | ||
252 : | dw 21407, -21407, 11585, 27969, ; w11 w03 w10 w02 | ||
253 : | dw -21407, 21407, -27969, -11585, ; w15 w07 w14 w06 | ||
254 : | dw 29692, 16819, 25172, -29692, ; w22 w20 w18 w16 | ||
255 : | dw 25172, 5906, -5906, -16819, ; w23 w21 w19 w17 | ||
256 : | dw 16819, 5906, 5906, 25172, ; w30 w28 w26 w24 | ||
257 : | dw -29692, 25172, -16819, -29692, ; w31 w29 w27 w25 | ||
258 : | |||
259 : | ; row7 | ||
260 : | dw 22725, 22725, 29692, -12299, ; w09 w01 w08 w00 | ||
261 : | dw 22725, 22725, 12299, -29692, ; w13 w05 w12 w04 | ||
262 : | dw 22725, -22725, 12299, 29692, ; w11 w03 w10 w02 | ||
263 : | dw -22725, 22725, -29692, -12299, ; w15 w07 w14 w06 | ||
264 : | dw 31521, 17855, 26722, -31521, ; w22 w20 w18 w16 | ||
265 : | dw 26722, 6270, -6270, -17855, ; w23 w21 w19 w17 | ||
266 : | dw 17855, 6270, 6270, 26722, ; w30 w28 w26 w24 | ||
267 : | dw -31521, 26722, -17855, -31521 ; w31 w29 w27 w25 | ||
268 : | |||
269 : | align 128 | ||
270 : | |||
271 : | FIX_1 dw 10703, 4433, 10703, 4433 | ||
272 : | dw 10703, 4433, 10703, 4433 | ||
273 : | |||
274 : | FIX_2 dw 4433, -10704, 4433, -10704 | ||
275 : | dw 4433, -10704, 4433, -10704 | ||
276 : | |||
277 : | rounder_5 dw 2+16,2+16,2+16,2+16,2+16,2+16,2+16,2+16 | ||
278 : | rounder_11 dd 1024,1024,1024,1024 | ||
279 : | rounder_18 dd 16384+131072,16384+131072,16384+131072,16384+131072 | ||
280 : | |||
281 : | align 128 | ||
282 : | |||
283 : | FIX_3 dw 6437, 2260, 6437, 2260 | ||
284 : | dw 6437, 2260, 6437, 2260 | ||
285 : | dw 11363, 9633, 11363, 9633 | ||
286 : | dw 11363, 9633, 11363, 9633 | ||
287 : | |||
288 : | FIX_4 dw -11362, -6436, -11362, -6436 | ||
289 : | dw -11362, -6436, -11362, -6436 | ||
290 : | dw 9633, -2259, 9633, -2259 | ||
291 : | dw 9633, -2259, 9633, -2259 | ||
292 : | |||
293 : | FIX_5 dw 2261, 9633, 2261, 9633 | ||
294 : | dw 2261, 9633, 2261, 9633 | ||
295 : | dw 6437, -11362, 6437, -11362 | ||
296 : | dw 6437, -11362, 6437, -11362 | ||
297 : | |||
298 : | FIX_6 dw 9633, -11363, 9633, -11363 | ||
299 : | dw 9633, -11363, 9633, -11363 | ||
300 : | dw 2260, -6436, 2260, -6436 | ||
301 : | dw 2260, -6436, 2260, -6436 | ||
302 : | |||
303 : | align 128 | ||
304 : | buffer dw 0,0,0,0,0,0,0,0 | ||
305 : | dw 0,0,0,0,0,0,0,0 | ||
306 : | dw 0,0,0,0,0,0,0,0 | ||
307 : | dw 0,0,0,0,0,0,0,0 | ||
308 : | dw 0,0,0,0,0,0,0,0 | ||
309 : | dw 0,0,0,0,0,0,0,0 | ||
310 : | dw 0,0,0,0,0,0,0,0 | ||
311 : | dw 0,0,0,0,0,0,0,0 | ||
312 : | |||
313 : | SECTION .text | ||
314 : | |||
315 : | ALIGN 16 | ||
316 : | |||
317 : | |||
318 : | cglobal fdct_mmx | ||
319 : | ;;void fdct_mmx(short *block); | ||
320 : | fdct_mmx: | ||
321 : | |||
322 : | push ebx | ||
323 : | |||
324 : | mov INP, dword [esp + 8] ; block | ||
325 : | |||
326 : | mov TABLEF, tg_all_16 | ||
327 : | mov OUT, INP | ||
328 : | |||
329 : | movq mm0, [x1] ; 0 ; x1 | ||
330 : | |||
331 : | movq mm1, [x6] ; 1 ; x6 | ||
332 : | movq mm2, mm0 ; 2 ; x1 | ||
333 : | |||
334 : | movq mm3, [x2] ; 3 ; x2 | ||
335 : | paddsw mm0, mm1 ; t1 = x[1] + x[6] | ||
336 : | |||
337 : | movq mm4, [x5] ; 4 ; x5 | ||
338 : | psllw mm0, SHIFT_FRW_COL ; t1 | ||
339 : | |||
340 : | movq mm5, [x0] ; 5 ; x0 | ||
341 : | paddsw mm4, mm3 ; t2 = x[2] + x[5] | ||
342 : | |||
343 : | paddsw mm5, [x7] ; t0 = x[0] + x[7] | ||
344 : | psllw mm4, SHIFT_FRW_COL ; t2 | ||
345 : | |||
346 : | movq mm6, mm0 ; 6 ; t1 | ||
347 : | psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] | ||
348 : | |||
349 : | movq mm1, [tg_2_16] ; 1 ; tg_2_16 | ||
350 : | psubsw mm0, mm4 ; tm12 = t1 - t2 | ||
351 : | |||
352 : | movq mm7, [x3] ; 7 ; x3 | ||
353 : | pmulhw mm1, mm0 ; tm12*tg_2_16 | ||
354 : | |||
355 : | paddsw mm7, [x4] ; t3 = x[3] + x[4] | ||
356 : | psllw mm5, SHIFT_FRW_COL ; t0 | ||
357 : | |||
358 : | paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 | ||
359 : | psllw mm7, SHIFT_FRW_COL ; t3 | ||
360 : | |||
361 : | movq mm4, mm5 ; 4 ; t0 | ||
362 : | psubsw mm5, mm7 ; tm03 = t0 - t3 | ||
363 : | |||
364 : | paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 | ||
365 : | paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 | ||
366 : | |||
367 : | por mm1, qword [one_corr] ; correction y2 +0.5 | ||
368 : | psllw mm2, SHIFT_FRW_COL+1 ; t6 | ||
369 : | |||
370 : | pmulhw mm5, [tg_2_16] ; tm03*tg_2_16 | ||
371 : | movq mm7, mm4 ; 7 ; tp03 | ||
372 : | |||
373 : | psubsw mm3, [x5] ; t5 = x[2] - x[5] | ||
374 : | psubsw mm4, mm6 ; y4 = tp03 - tp12 | ||
375 : | |||
376 : | movq [y2], mm1 ; 1 ; save y2 | ||
377 : | paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 | ||
378 : | |||
379 : | movq mm1, [x3] ; 1 ; x3 | ||
380 : | psllw mm3, SHIFT_FRW_COL+1 ; t5 | ||
381 : | |||
382 : | psubsw mm1, [x4] ; t4 = x[3] - x[4] | ||
383 : | movq mm6, mm2 ; 6 ; t6 | ||
384 : | |||
385 : | movq [y4], mm4 ; 4 ; save y4 | ||
386 : | paddsw mm2, mm3 ; t6 + t5 | ||
387 : | |||
388 : | pmulhw mm2, [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 | ||
389 : | psubsw mm6, mm3 ; 3 ; t6 - t5 | ||
390 : | |||
391 : | pmulhw mm6, [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 | ||
392 : | psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 | ||
393 : | |||
394 : | por mm5, qword [one_corr] ; correction y6 +0.5 | ||
395 : | psllw mm1, SHIFT_FRW_COL ; t4 | ||
396 : | |||
397 : | por mm2, qword [one_corr] ; correction tp65 +0.5 | ||
398 : | movq mm4, mm1 ; 4 ; t4 | ||
399 : | |||
400 : | movq mm3, [x0] ; 3 ; x0 | ||
401 : | paddsw mm1, mm6 ; tp465 = t4 + tm65 | ||
402 : | |||
403 : | psubsw mm3, [x7] ; t7 = x[0] - x[7] | ||
404 : | psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 | ||
405 : | |||
406 : | movq mm0, [tg_1_16] ; 0 ; tg_1_16 | ||
407 : | psllw mm3, SHIFT_FRW_COL ; t7 | ||
408 : | |||
409 : | movq mm6, [tg_3_16] ; 6 ; tg_3_16 | ||
410 : | pmulhw mm0, mm1 ; tp465*tg_1_16 | ||
411 : | |||
412 : | movq [y0], mm7 ; 7 ; save y0 | ||
413 : | pmulhw mm6, mm4 ; tm465*tg_3_16 | ||
414 : | |||
415 : | movq [y6], mm5 ; 5 ; save y6 | ||
416 : | movq mm7, mm3 ; 7 ; t7 | ||
417 : | |||
418 : | movq mm5, [tg_3_16] ; 5 ; tg_3_16 | ||
419 : | psubsw mm7, mm2 ; tm765 = t7 - tp65 | ||
420 : | |||
421 : | paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 | ||
422 : | pmulhw mm5, mm7 ; tm765*tg_3_16 | ||
423 : | |||
424 : | paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 | ||
425 : | paddsw mm6, mm4 ; tm465*tg_3_16 | ||
426 : | |||
427 : | pmulhw mm3, [tg_1_16] ; tp765*tg_1_16 | ||
428 : | |||
429 : | por mm0, qword [one_corr] ; correction y1 +0.5 | ||
430 : | paddsw mm5, mm7 ; tm765*tg_3_16 | ||
431 : | |||
432 : | psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 | ||
433 : | add INP, 0x08 | ||
434 : | |||
435 : | movq [y1], mm0 ; 0 ; save y1 | ||
436 : | paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 | ||
437 : | |||
438 : | movq [y3], mm7 ; 7 ; save y3 | ||
439 : | psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 | ||
440 : | |||
441 : | movq [y5], mm5 ; 5 ; save y5 | ||
442 : | |||
443 : | movq mm0, [x1] ; 0 ; x1 | ||
444 : | |||
445 : | movq [y7], mm3 ; 3 ; save y7 (columns 0-4) | ||
446 : | |||
447 : | movq mm1, [x6] ; 1 ; x6 | ||
448 : | movq mm2, mm0 ; 2 ; x1 | ||
449 : | |||
450 : | movq mm3, [x2] ; 3 ; x2 | ||
451 : | paddsw mm0, mm1 ; t1 = x[1] + x[6] | ||
452 : | |||
453 : | movq mm4, [x5] ; 4 ; x5 | ||
454 : | psllw mm0, SHIFT_FRW_COL ; t1 | ||
455 : | |||
456 : | movq mm5, [x0] ; 5 ; x0 | ||
457 : | paddsw mm4, mm3 ; t2 = x[2] + x[5] | ||
458 : | |||
459 : | paddsw mm5, [x7] ; t0 = x[0] + x[7] | ||
460 : | psllw mm4, SHIFT_FRW_COL ; t2 | ||
461 : | |||
462 : | movq mm6, mm0 ; 6 ; t1 | ||
463 : | psubsw mm2, mm1 ; 1 ; t6 = x[1] - x[6] | ||
464 : | |||
465 : | movq mm1, [tg_2_16] ; 1 ; tg_2_16 | ||
466 : | psubsw mm0, mm4 ; tm12 = t1 - t2 | ||
467 : | |||
468 : | movq mm7, [x3] ; 7 ; x3 | ||
469 : | pmulhw mm1, mm0 ; tm12*tg_2_16 | ||
470 : | |||
471 : | paddsw mm7, [x4] ; t3 = x[3] + x[4] | ||
472 : | psllw mm5, SHIFT_FRW_COL ; t0 | ||
473 : | |||
474 : | paddsw mm6, mm4 ; 4 ; tp12 = t1 + t2 | ||
475 : | psllw mm7, SHIFT_FRW_COL ; t3 | ||
476 : | |||
477 : | movq mm4, mm5 ; 4 ; t0 | ||
478 : | psubsw mm5, mm7 ; tm03 = t0 - t3 | ||
479 : | |||
480 : | paddsw mm1, mm5 ; y2 = tm03 + tm12*tg_2_16 | ||
481 : | paddsw mm4, mm7 ; 7 ; tp03 = t0 + t3 | ||
482 : | |||
483 : | por mm1, qword [one_corr] ; correction y2 +0.5 | ||
484 : | psllw mm2, SHIFT_FRW_COL+1 ; t6 | ||
485 : | |||
486 : | pmulhw mm5, [tg_2_16] ; tm03*tg_2_16 | ||
487 : | movq mm7, mm4 ; 7 ; tp03 | ||
488 : | |||
489 : | psubsw mm3, [x5] ; t5 = x[2] - x[5] | ||
490 : | psubsw mm4, mm6 ; y4 = tp03 - tp12 | ||
491 : | |||
492 : | movq [y2+8], mm1 ; 1 ; save y2 | ||
493 : | paddsw mm7, mm6 ; 6 ; y0 = tp03 + tp12 | ||
494 : | |||
495 : | movq mm1, [x3] ; 1 ; x3 | ||
496 : | psllw mm3, SHIFT_FRW_COL+1 ; t5 | ||
497 : | |||
498 : | psubsw mm1, [x4] ; t4 = x[3] - x[4] | ||
499 : | movq mm6, mm2 ; 6 ; t6 | ||
500 : | |||
501 : | movq [y4+8], mm4 ; 4 ; save y4 | ||
502 : | paddsw mm2, mm3 ; t6 + t5 | ||
503 : | |||
504 : | pmulhw mm2, [ocos_4_16] ; tp65 = (t6 + t5)*cos_4_16 | ||
505 : | psubsw mm6, mm3 ; 3 ; t6 - t5 | ||
506 : | |||
507 : | pmulhw mm6, [ocos_4_16] ; tm65 = (t6 - t5)*cos_4_16 | ||
508 : | psubsw mm5, mm0 ; 0 ; y6 = tm03*tg_2_16 - tm12 | ||
509 : | |||
510 : | por mm5, qword [one_corr] ; correction y6 +0.5 | ||
511 : | psllw mm1, SHIFT_FRW_COL ; t4 | ||
512 : | |||
513 : | por mm2, qword [one_corr] ; correction tp65 +0.5 | ||
514 : | movq mm4, mm1 ; 4 ; t4 | ||
515 : | |||
516 : | movq mm3, [x0] ; 3 ; x0 | ||
517 : | paddsw mm1, mm6 ; tp465 = t4 + tm65 | ||
518 : | |||
519 : | psubsw mm3, [x7] ; t7 = x[0] - x[7] | ||
520 : | psubsw mm4, mm6 ; 6 ; tm465 = t4 - tm65 | ||
521 : | |||
522 : | movq mm0, [tg_1_16] ; 0 ; tg_1_16 | ||
523 : | psllw mm3, SHIFT_FRW_COL ; t7 | ||
524 : | |||
525 : | movq mm6, [tg_3_16] ; 6 ; tg_3_16 | ||
526 : | pmulhw mm0, mm1 ; tp465*tg_1_16 | ||
527 : | |||
528 : | movq [y0+8], mm7 ; 7 ; save y0 | ||
529 : | pmulhw mm6, mm4 ; tm465*tg_3_16 | ||
530 : | |||
531 : | movq [y6+8], mm5 ; 5 ; save y6 | ||
532 : | movq mm7, mm3 ; 7 ; t7 | ||
533 : | |||
534 : | movq mm5, [tg_3_16] ; 5 ; tg_3_16 | ||
535 : | psubsw mm7, mm2 ; tm765 = t7 - tp65 | ||
536 : | |||
537 : | paddsw mm3, mm2 ; 2 ; tp765 = t7 + tp65 | ||
538 : | pmulhw mm5, mm7 ; tm765*tg_3_16 | ||
539 : | |||
540 : | paddsw mm0, mm3 ; y1 = tp765 + tp465*tg_1_16 | ||
541 : | paddsw mm6, mm4 ; tm465*tg_3_16 | ||
542 : | |||
543 : | pmulhw mm3, [tg_1_16] ; tp765*tg_1_16 | ||
544 : | |||
545 : | por mm0, qword [one_corr] ; correction y1 +0.5 | ||
546 : | paddsw mm5, mm7 ; tm765*tg_3_16 | ||
547 : | |||
548 : | psubsw mm7, mm6 ; 6 ; y3 = tm765 - tm465*tg_3_16 | ||
549 : | |||
550 : | movq [y1+8], mm0 ; 0 ; save y1 | ||
551 : | paddsw mm5, mm4 ; 4 ; y5 = tm765*tg_3_16 + tm465 | ||
552 : | |||
553 : | movq [y3+8], mm7 ; 7 ; save y3 | ||
554 : | psubsw mm3, mm1 ; 1 ; y7 = tp765*tg_1_16 - tp465 | ||
555 : | |||
556 : | movq [y5+8], mm5 ; 5 ; save y5 | ||
557 : | |||
558 : | movq [y7+8], mm3 ; 3 ; save y7 | ||
559 : | |||
560 : | |||
561 : | ;--------------------- columns | ||
562 : | |||
563 : | mov INP, [esp + 8] ; row 0 | ||
564 : | |||
565 : | mov TABLEF, tab_frw_01234567 ; row 0 | ||
566 : | mov OUT, INP | ||
567 : | |||
568 : | mov round_frw_row, r_frw_row | ||
569 : | |||
570 : | movd mm5, [INP+12] ; mm5 = 7 6 | ||
571 : | |||
572 : | punpcklwd mm5, [INP+8] | ||
573 : | |||
574 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
575 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
576 : | |||
577 : | movq mm0, [INP] ; mm0 = 3 2 1 0 | ||
578 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
579 : | |||
580 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
581 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
582 : | |||
583 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
584 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
585 : | |||
586 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
587 : | |||
588 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
589 : | movq mm1, mm2 ; mm1 | ||
590 : | |||
591 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
592 : | |||
593 : | movq mm3, [TABLE] ; 3 ; w06 w04 w02 w00 | ||
594 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
595 : | |||
596 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
597 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
598 : | |||
599 : | movq mm4, [TABLE+8] ; 4 ; w07 w05 w03 w01 | ||
600 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
601 : | |||
602 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
603 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
604 : | |||
605 : | movq mm1, [TABLE+32] ; 1 ; w22 w20 w18 w16 | ||
606 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
607 : | |||
608 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
609 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
610 : | |||
611 : | pmaddwd mm0, [TABLE+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
612 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
613 : | |||
614 : | movq mm7, [TABLE+40] ; 7 ; w23 w21 w19 w17 | ||
615 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
616 : | |||
617 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
618 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
619 : | |||
620 : | pmaddwd mm2, [TABLE+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
621 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
622 : | |||
623 : | pmaddwd mm5, [TABLE+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
624 : | |||
625 : | pmaddwd mm6, [TABLE+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
626 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
627 : | |||
628 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
629 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
630 : | |||
631 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
632 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
633 : | |||
634 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
635 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
636 : | |||
637 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
638 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
639 : | |||
640 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
641 : | |||
642 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
643 : | |||
644 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
645 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
646 : | |||
647 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
648 : | |||
649 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
650 : | |||
651 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
652 : | |||
653 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
654 : | |||
655 : | movq [OUT_1-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
656 : | |||
657 : | movq [OUT_1-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
658 : | |||
659 : | movd mm5, [INP_1+12] ; mm5 = 7 6 | ||
660 : | |||
661 : | punpcklwd mm5, [INP_1+8] | ||
662 : | |||
663 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
664 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
665 : | |||
666 : | movq mm0, [INP_1] ; mm0 = 3 2 1 0 | ||
667 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
668 : | |||
669 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
670 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
671 : | |||
672 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
673 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
674 : | |||
675 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
676 : | |||
677 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
678 : | movq mm1, mm2 ; mm1 | ||
679 : | |||
680 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
681 : | |||
682 : | movq mm3, [TABLE_1] ; 3 ; w06 w04 w02 w00 | ||
683 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
684 : | |||
685 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
686 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
687 : | |||
688 : | movq mm4, [TABLE_1+8] ; 4 ; w07 w05 w03 w01 | ||
689 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
690 : | |||
691 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
692 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
693 : | |||
694 : | movq mm1, [TABLE_1+32] ; 1 ; w22 w20 w18 w16 | ||
695 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
696 : | |||
697 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
698 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
699 : | |||
700 : | pmaddwd mm0, [TABLE_1+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
701 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
702 : | |||
703 : | movq mm7, [TABLE_1+40] ; 7 ; w23 w21 w19 w17 | ||
704 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
705 : | |||
706 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
707 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
708 : | |||
709 : | pmaddwd mm2, [TABLE_1+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
710 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
711 : | |||
712 : | pmaddwd mm5, [TABLE_1+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
713 : | |||
714 : | pmaddwd mm6, [TABLE_1+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
715 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
716 : | |||
717 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
718 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
719 : | |||
720 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
721 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
722 : | |||
723 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
724 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
725 : | |||
726 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
727 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
728 : | |||
729 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
730 : | |||
731 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
732 : | |||
733 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
734 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
735 : | |||
736 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
737 : | |||
738 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
739 : | |||
740 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
741 : | |||
742 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
743 : | |||
744 : | movq [OUT_2-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
745 : | |||
746 : | movq [OUT_2-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
747 : | |||
748 : | movd mm5, [INP_2+12] ; mm5 = 7 6 | ||
749 : | |||
750 : | punpcklwd mm5, [INP_2+8] | ||
751 : | |||
752 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
753 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
754 : | |||
755 : | movq mm0, [INP_2] ; mm0 = 3 2 1 0 | ||
756 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
757 : | |||
758 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
759 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
760 : | |||
761 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
762 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
763 : | |||
764 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
765 : | |||
766 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
767 : | movq mm1, mm2 ; mm1 | ||
768 : | |||
769 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
770 : | |||
771 : | movq mm3, [TABLE_2] ; 3 ; w06 w04 w02 w00 | ||
772 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
773 : | |||
774 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
775 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
776 : | |||
777 : | movq mm4, [TABLE_2+8] ; 4 ; w07 w05 w03 w01 | ||
778 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
779 : | |||
780 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
781 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
782 : | |||
783 : | movq mm1, [TABLE_2+32] ; 1 ; w22 w20 w18 w16 | ||
784 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
785 : | |||
786 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
787 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
788 : | |||
789 : | pmaddwd mm0, [TABLE_2+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
790 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
791 : | |||
792 : | movq mm7, [TABLE_2+40] ; 7 ; w23 w21 w19 w17 | ||
793 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
794 : | |||
795 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
796 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
797 : | |||
798 : | pmaddwd mm2, [TABLE_2+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
799 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
800 : | |||
801 : | pmaddwd mm5, [TABLE_2+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
802 : | |||
803 : | pmaddwd mm6, [TABLE_2+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
804 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
805 : | |||
806 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
807 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
808 : | |||
809 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
810 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
811 : | |||
812 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
813 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
814 : | |||
815 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
816 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
817 : | |||
818 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
819 : | |||
820 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
821 : | |||
822 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
823 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
824 : | |||
825 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
826 : | |||
827 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
828 : | |||
829 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
830 : | |||
831 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
832 : | |||
833 : | movq [OUT_3-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
834 : | |||
835 : | movq [OUT_3-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
836 : | |||
837 : | movd mm5, [INP_3+12] ; mm5 = 7 6 | ||
838 : | |||
839 : | punpcklwd mm5, [INP_3+8] | ||
840 : | |||
841 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
842 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
843 : | |||
844 : | movq mm0, [INP_3] ; mm0 = 3 2 1 0 | ||
845 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
846 : | |||
847 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
848 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
849 : | |||
850 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
851 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
852 : | |||
853 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
854 : | |||
855 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
856 : | movq mm1, mm2 ; mm1 | ||
857 : | |||
858 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
859 : | |||
860 : | movq mm3, [TABLE_3] ; 3 ; w06 w04 w02 w00 | ||
861 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
862 : | |||
863 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
864 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
865 : | |||
866 : | movq mm4, [TABLE_3+8] ; 4 ; w07 w05 w03 w01 | ||
867 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
868 : | |||
869 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
870 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
871 : | |||
872 : | movq mm1, [TABLE_3+32] ; 1 ; w22 w20 w18 w16 | ||
873 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
874 : | |||
875 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
876 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
877 : | |||
878 : | pmaddwd mm0, [TABLE_3+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
879 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
880 : | |||
881 : | movq mm7, [TABLE_3+40] ; 7 ; w23 w21 w19 w17 | ||
882 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
883 : | |||
884 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
885 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
886 : | |||
887 : | pmaddwd mm2, [TABLE_3+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
888 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
889 : | |||
890 : | pmaddwd mm5, [TABLE_3+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
891 : | |||
892 : | pmaddwd mm6, [TABLE_3+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
893 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
894 : | |||
895 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
896 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
897 : | |||
898 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
899 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
900 : | |||
901 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
902 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
903 : | |||
904 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
905 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
906 : | |||
907 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
908 : | |||
909 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
910 : | |||
911 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
912 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
913 : | |||
914 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
915 : | |||
916 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
917 : | |||
918 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
919 : | |||
920 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
921 : | |||
922 : | movq [OUT_4-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
923 : | |||
924 : | movq [OUT_4-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
925 : | |||
926 : | movd mm5, [INP_4+12] ; mm5 = 7 6 | ||
927 : | |||
928 : | punpcklwd mm5, [INP_4+8] | ||
929 : | |||
930 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
931 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
932 : | |||
933 : | movq mm0, [INP_4] ; mm0 = 3 2 1 0 | ||
934 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
935 : | |||
936 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
937 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
938 : | |||
939 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
940 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
941 : | |||
942 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
943 : | |||
944 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
945 : | movq mm1, mm2 ; mm1 | ||
946 : | |||
947 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
948 : | |||
949 : | movq mm3, [TABLE_4] ; 3 ; w06 w04 w02 w00 | ||
950 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
951 : | |||
952 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
953 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
954 : | |||
955 : | movq mm4, [TABLE_4+8] ; 4 ; w07 w05 w03 w01 | ||
956 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
957 : | |||
958 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
959 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
960 : | |||
961 : | movq mm1, [TABLE_4+32] ; 1 ; w22 w20 w18 w16 | ||
962 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
963 : | |||
964 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
965 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
966 : | |||
967 : | pmaddwd mm0, [TABLE_4+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
968 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
969 : | |||
970 : | movq mm7, [TABLE_4+40] ; 7 ; w23 w21 w19 w17 | ||
971 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
972 : | |||
973 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
974 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
975 : | |||
976 : | pmaddwd mm2, [TABLE_4+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
977 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
978 : | |||
979 : | pmaddwd mm5, [TABLE_4+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
980 : | |||
981 : | pmaddwd mm6, [TABLE_4+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
982 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
983 : | |||
984 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
985 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
986 : | |||
987 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
988 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
989 : | |||
990 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
991 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
992 : | |||
993 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
994 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
995 : | |||
996 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
997 : | |||
998 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
999 : | |||
1000 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
1001 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
1002 : | |||
1003 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
1004 : | |||
1005 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
1006 : | |||
1007 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
1008 : | |||
1009 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
1010 : | |||
1011 : | movq [OUT_5-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
1012 : | |||
1013 : | movq [OUT_5-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
1014 : | |||
1015 : | movd mm5, [INP_5+12] ; mm5 = 7 6 | ||
1016 : | |||
1017 : | punpcklwd mm5, [INP_5+8] | ||
1018 : | |||
1019 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
1020 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
1021 : | |||
1022 : | movq mm0, [INP_5] ; mm0 = 3 2 1 0 | ||
1023 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
1024 : | |||
1025 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
1026 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
1027 : | |||
1028 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
1029 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
1030 : | |||
1031 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
1032 : | |||
1033 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
1034 : | movq mm1, mm2 ; mm1 | ||
1035 : | |||
1036 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
1037 : | |||
1038 : | movq mm3, [TABLE_5] ; 3 ; w06 w04 w02 w00 | ||
1039 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
1040 : | |||
1041 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
1042 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
1043 : | |||
1044 : | movq mm4, [TABLE_5+8] ; 4 ; w07 w05 w03 w01 | ||
1045 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
1046 : | |||
1047 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
1048 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
1049 : | |||
1050 : | movq mm1, [TABLE_5+32] ; 1 ; w22 w20 w18 w16 | ||
1051 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
1052 : | |||
1053 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
1054 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
1055 : | |||
1056 : | pmaddwd mm0, [TABLE_5+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
1057 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
1058 : | |||
1059 : | movq mm7, [TABLE_5+40] ; 7 ; w23 w21 w19 w17 | ||
1060 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
1061 : | |||
1062 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
1063 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
1064 : | |||
1065 : | pmaddwd mm2, [TABLE_5+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
1066 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
1067 : | |||
1068 : | pmaddwd mm5, [TABLE_5+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
1069 : | |||
1070 : | pmaddwd mm6, [TABLE_5+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
1071 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
1072 : | |||
1073 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
1074 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
1075 : | |||
1076 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
1077 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
1078 : | |||
1079 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
1080 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
1081 : | |||
1082 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
1083 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
1084 : | |||
1085 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
1086 : | |||
1087 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
1088 : | |||
1089 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
1090 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
1091 : | |||
1092 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
1093 : | |||
1094 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
1095 : | |||
1096 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
1097 : | |||
1098 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
1099 : | |||
1100 : | movq [OUT_6-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
1101 : | |||
1102 : | movq [OUT_6-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
1103 : | |||
1104 : | movd mm5, [INP_6+12] ; mm5 = 7 6 | ||
1105 : | |||
1106 : | punpcklwd mm5, [INP_6+8] | ||
1107 : | |||
1108 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
1109 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
1110 : | |||
1111 : | movq mm0, [INP_6] ; mm0 = 3 2 1 0 | ||
1112 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
1113 : | |||
1114 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
1115 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
1116 : | |||
1117 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
1118 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
1119 : | |||
1120 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
1121 : | |||
1122 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
1123 : | movq mm1, mm2 ; mm1 | ||
1124 : | |||
1125 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
1126 : | |||
1127 : | movq mm3, [TABLE_6] ; 3 ; w06 w04 w02 w00 | ||
1128 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
1129 : | |||
1130 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
1131 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
1132 : | |||
1133 : | movq mm4, [TABLE_6+8] ; 4 ; w07 w05 w03 w01 | ||
1134 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
1135 : | |||
1136 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
1137 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
1138 : | |||
1139 : | movq mm1, [TABLE_6+32] ; 1 ; w22 w20 w18 w16 | ||
1140 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
1141 : | |||
1142 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
1143 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
1144 : | |||
1145 : | pmaddwd mm0, [TABLE_6+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
1146 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
1147 : | |||
1148 : | movq mm7, [TABLE_6+40] ; 7 ; w23 w21 w19 w17 | ||
1149 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
1150 : | |||
1151 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
1152 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
1153 : | |||
1154 : | pmaddwd mm2, [TABLE_6+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
1155 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
1156 : | |||
1157 : | pmaddwd mm5, [TABLE_6+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
1158 : | |||
1159 : | pmaddwd mm6, [TABLE_6+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
1160 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
1161 : | |||
1162 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
1163 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
1164 : | |||
1165 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
1166 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
1167 : | |||
1168 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
1169 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
1170 : | |||
1171 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
1172 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
1173 : | |||
1174 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
1175 : | |||
1176 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
1177 : | |||
1178 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
1179 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
1180 : | |||
1181 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
1182 : | |||
1183 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
1184 : | |||
1185 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
1186 : | |||
1187 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
1188 : | |||
1189 : | movq [OUT_7-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
1190 : | |||
1191 : | movq [OUT_7-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
1192 : | |||
1193 : | movd mm5, [INP_7+12] ; mm5 = 7 6 | ||
1194 : | |||
1195 : | punpcklwd mm5, [INP_7+8] | ||
1196 : | |||
1197 : | movq mm2, mm5 ; mm2 = 5 7 4 6 | ||
1198 : | psrlq mm5, 32 ; mm5 = _ _ 5 7 | ||
1199 : | |||
1200 : | movq mm0, [INP_7] ; mm0 = 3 2 1 0 | ||
1201 : | punpcklwd mm5, mm2 ; mm5 = 4 5 6 7 | ||
1202 : | |||
1203 : | movq mm1, mm0 ; mm1 = 3 2 1 0 | ||
1204 : | paddsw mm0, mm5 ; mm0 = [3+4, 2+5, 1+6, 0+7] (xt3, xt2, xt1, xt0) | ||
1205 : | |||
1206 : | psubsw mm1, mm5 ; mm1 = [3-4, 2-5, 1-6, 0-7] (xt7, xt6, xt5, xt4) | ||
1207 : | movq mm2, mm0 ; mm2 = [ xt3 xt2 xt1 xt0 ] | ||
1208 : | |||
1209 : | punpcklwd mm0, mm1 ; mm0 = [ xt5 xt1 xt4 xt0 ] | ||
1210 : | |||
1211 : | punpckhwd mm2, mm1 ; mm2 = [ xt7 xt3 xt6 xt2 ] | ||
1212 : | movq mm1, mm2 ; mm1 | ||
1213 : | |||
1214 : | movq mm2, mm0 ; 2 ; x3 x2 x1 x0 | ||
1215 : | |||
1216 : | movq mm3, [TABLE_7] ; 3 ; w06 w04 w02 w00 | ||
1217 : | punpcklwd mm0, mm1 ; x5 x1 x4 x0 | ||
1218 : | |||
1219 : | movq mm5, mm0 ; 5 ; x5 x1 x4 x0 | ||
1220 : | punpckldq mm0, mm0 ; x4 x0 x4 x0 [ xt2 xt0 xt2 xt0 ] | ||
1221 : | |||
1222 : | movq mm4, [TABLE_7+8] ; 4 ; w07 w05 w03 w01 | ||
1223 : | punpckhwd mm2, mm1 ; 1 ; x7 x3 x6 x2 | ||
1224 : | |||
1225 : | pmaddwd mm3, mm0 ; x4*w06+x0*w04 x4*w02+x0*w00 | ||
1226 : | movq mm6, mm2 ; 6 ; x7 x3 x6 x2 | ||
1227 : | |||
1228 : | movq mm1, [TABLE_7+32] ; 1 ; w22 w20 w18 w16 | ||
1229 : | punpckldq mm2, mm2 ; x6 x2 x6 x2 [ xt3 xt1 xt3 xt1 ] | ||
1230 : | |||
1231 : | pmaddwd mm4, mm2 ; x6*w07+x2*w05 x6*w03+x2*w01 | ||
1232 : | punpckhdq mm5, mm5 ; x5 x1 x5 x1 [ xt6 xt4 xt6 xt4 ] | ||
1233 : | |||
1234 : | pmaddwd mm0, [TABLE_7+16] ; x4*w14+x0*w12 x4*w10+x0*w08 | ||
1235 : | punpckhdq mm6, mm6 ; x7 x3 x7 x3 [ xt7 xt5 xt7 xt5 ] | ||
1236 : | |||
1237 : | movq mm7, [TABLE_7+40] ; 7 ; w23 w21 w19 w17 | ||
1238 : | pmaddwd mm1, mm5 ; x5*w22+x1*w20 x5*w18+x1*w16 | ||
1239 : | |||
1240 : | paddd mm3, [round_frw_row] ; +rounder (y2,y0) | ||
1241 : | pmaddwd mm7, mm6 ; x7*w23+x3*w21 x7*w19+x3*w17 | ||
1242 : | |||
1243 : | pmaddwd mm2, [TABLE_7+24] ; x6*w15+x2*w13 x6*w11+x2*w09 | ||
1244 : | paddd mm3, mm4 ; 4 ; a1=sum(even1) a0=sum(even0) | ||
1245 : | |||
1246 : | pmaddwd mm5, [TABLE_7+48] ; x5*w30+x1*w28 x5*w26+x1*w24 | ||
1247 : | |||
1248 : | pmaddwd mm6, [TABLE_7+56] ; x7*w31+x3*w29 x7*w27+x3*w25 | ||
1249 : | paddd mm1, mm7 ; 7 ; b1=sum(odd1) b0=sum(odd0) | ||
1250 : | |||
1251 : | paddd mm0, [round_frw_row] ; +rounder (y6,y4) | ||
1252 : | psrad mm3, SHIFT_FRW_ROW_CLIP1 ; (y2, y0) | ||
1253 : | |||
1254 : | paddd mm1, [round_frw_row] ; +rounder (y3,y1) | ||
1255 : | paddd mm0, mm2 ; 2 ; a3=sum(even3) a2=sum(even2) | ||
1256 : | |||
1257 : | paddd mm5, [round_frw_row] ; +rounder (y7,y5) | ||
1258 : | psrad mm1, SHIFT_FRW_ROW_CLIP1 ; y1=a1+b1 y0=a0+b0 | ||
1259 : | |||
1260 : | paddd mm5, mm6 ; 6 ; b3=sum(odd3) b2=sum(odd2) | ||
1261 : | psrad mm0, SHIFT_FRW_ROW_CLIP1 ; y3=a3+b3 y2=a2+b2 | ||
1262 : | |||
1263 : | psrad mm5, SHIFT_FRW_ROW_CLIP1 ; y4=a3-b3 y5=a2-b2 | ||
1264 : | |||
1265 : | packssdw mm3, mm0 ; 0 ; y6 y4 y2 y0, saturate {-32768,+32767} | ||
1266 : | |||
1267 : | packssdw mm1, mm5 ; 3 ; y7 y5 y3 y1, saturate {-32768,+32767} | ||
1268 : | movq mm6, mm3 ; mm0 = y6 y4 y2 y0 | ||
1269 : | |||
1270 : | punpcklwd mm3, mm1 ; y3 y2 y1 y0 | ||
1271 : | |||
1272 : | punpckhwd mm6, mm1 ; y7 y6 y5 y4 | ||
1273 : | |||
1274 : | psraw mm3, SHIFT_FRW_ROW_CLIP2 ; descale [y3 y2 y1 y0] to {-2048,+2047} | ||
1275 : | |||
1276 : | psraw mm6, SHIFT_FRW_ROW_CLIP2 ; descale [y7 y6 y5 y4] to {-2048,+2047} | ||
1277 : | |||
1278 : | movq [OUT_8-16], mm3 ; 1 ; save y3 y2 y1 y0 | ||
1279 : | |||
1280 : | movq [OUT_8-8], mm6 ; 7 ; save y7 y6 y5 y4 | ||
1281 : | |||
1282 : | pop ebx | ||
1283 : | emms | ||
1284 : | |||
1285 : | ret | ||
1286 : | |||
1287 : | |||
1288 : | ;******************************************************************* | ||
1289 : | ; This SSE2 code of the FDCT algoruthm coded by | ||
1290 : | ; Dmitry Rozhdestvensky and checked by Vladimir G. Ivanov | ||
1291 : | ;******************************************************************* | ||
1292 : | |||
1293 : | %macro transpose8x8sse2 3 ; source,dest,{0=first part, 1=second part} | ||
1294 : | ;I found this smart transposing algo at www.x86.org | ||
1295 : | |||
1296 : | movdqa xmm0,[%1+0*16] ; 07 06 05 04 03 02 01 00 | ||
1297 : | movdqa xmm6,[%1+2*16] ; 27 26 25 24 23 22 21 20 | ||
1298 : | movdqa xmm4,[%1+4*16] ; 47 46 45 44 43 42 41 40 | ||
1299 : | movdqa xmm7,[%1+6*16] ; 67 66 65 64 63 62 61 60 | ||
1300 : | |||
1301 : | %if %3=0 | ||
1302 : | punpcklwd xmm0,[%1+1*16] ; 13 03 12 02 11 01 10 00 | ||
1303 : | movdqa xmm2,xmm0 | ||
1304 : | punpcklwd xmm6,[%1+3*16] ; 33 23 32 22 31 21 30 20 | ||
1305 : | punpcklwd xmm4,[%1+5*16] ; 53 43 52 42 51 41 50 40 | ||
1306 : | movdqa xmm5,xmm4 | ||
1307 : | punpcklwd xmm7,[%1+7*16] ; 73 63 72 62 71 61 70 60 | ||
1308 : | %else | ||
1309 : | punpckhwd xmm0,[%1+1*16] ; | ||
1310 : | movdqa xmm2,xmm0 | ||
1311 : | punpckhwd xmm6,[%1+3*16] ; | ||
1312 : | punpckhwd xmm4,[%1+5*16] ; | ||
1313 : | movdqa xmm5,xmm4 | ||
1314 : | punpckhwd xmm7,[%1+7*16] ; | ||
1315 : | %endif | ||
1316 : | |||
1317 : | punpckldq xmm0,xmm6 ; 31 21 11 01 30 20 10 00 | ||
1318 : | movdqa xmm1,xmm0 | ||
1319 : | punpckldq xmm4,xmm7 ; 71 61 51 41 70 60 50 40 | ||
1320 : | punpckhdq xmm2,xmm6 ; 33 23 13 03 32 22 12 02 | ||
1321 : | movdqa xmm3,xmm2 | ||
1322 : | punpckhdq xmm5,xmm7 ; 73 63 53 43 72 62 52 42 | ||
1323 : | |||
1324 : | punpcklqdq xmm0,xmm4 ; 70 60 50 40 30 20 10 00 | ||
1325 : | punpcklqdq xmm2,xmm5 ; 72 62 52 42 32 22 21 02 | ||
1326 : | punpckhqdq xmm1,xmm4 ; 71 61 51 41 31 21 11 01 | ||
1327 : | punpckhqdq xmm3,xmm5 ; 73 63 53 43 33 23 13 03 | ||
1328 : | |||
1329 : | movdqa [%2+(0+%3*4)*16],xmm0 | ||
1330 : | movdqa [%2+(1+%3*4)*16],xmm1 | ||
1331 : | movdqa [%2+(2+%3*4)*16],xmm2 | ||
1332 : | movdqa [%2+(3+%3*4)*16],xmm3 | ||
1333 : | |||
1334 : | %endmacro | ||
1335 : | |||
1336 : | |||
1337 : | %macro makeoddpart 3 ; output, table, shift | ||
1338 : | |||
1339 : | |||
1340 : | movdqa xmm1,[%2+0 ] ;45l | ||
1341 : | movdqa xmm5,[%2+16] ;67l | ||
1342 : | movdqa xmm3,xmm1 ;45h | ||
1343 : | movdqa xmm7,xmm5 ;67h | ||
1344 : | |||
1345 : | pmaddwd xmm1,xmm2 ;[%2+0 ] | ||
1346 : | pmaddwd xmm5,xmm0 ;[%2+16] | ||
1347 : | paddd xmm1,xmm5 | ||
1348 : | %if %3=11 | ||
1349 : | movdqa xmm5,[rounder_11] | ||
1350 : | %else | ||
1351 : | movdqa xmm5,[rounder_18] | ||
1352 : | %endif | ||
1353 : | |||
1354 : | pmaddwd xmm3,xmm6 ;[%2+0 ] | ||
1355 : | pmaddwd xmm7,xmm4 ;[%2+16] | ||
1356 : | paddd xmm3,xmm7 | ||
1357 : | |||
1358 : | paddd xmm1,xmm5 ;rounder | ||
1359 : | paddd xmm3,xmm5 ;rounder | ||
1360 : | psrad xmm1,%3 | ||
1361 : | psrad xmm3,%3 | ||
1362 : | |||
1363 : | packssdw xmm1,xmm3 | ||
1364 : | movdqa [%1],xmm1 | ||
1365 : | |||
1366 : | %endmacro | ||
1367 : | |||
1368 : | %macro makeoddpartlast 3 ; output, table, shift | ||
1369 : | |||
1370 : | pmaddwd xmm2,[%2+0 ] | ||
1371 : | pmaddwd xmm0,[%2+16] | ||
1372 : | paddd xmm2,xmm0 | ||
1373 : | |||
1374 : | pmaddwd xmm6,[%2+0 ] | ||
1375 : | pmaddwd xmm4,[%2+16] | ||
1376 : | paddd xmm6,xmm4 | ||
1377 : | |||
1378 : | paddd xmm2,xmm5 ;rounder | ||
1379 : | paddd xmm6,xmm5 ;rounder | ||
1380 : | psrad xmm2,%3 | ||
1381 : | psrad xmm6,%3 | ||
1382 : | |||
1383 : | packssdw xmm2,xmm6 | ||
1384 : | movdqa [%1],xmm2 | ||
1385 : | |||
1386 : | %endmacro | ||
1387 : | |||
1388 : | |||
1389 : | %macro FDCT_1D 4 ; INP,OUTP,{0=first pass, 1=second pass}, shift={11,18} | ||
1390 : | |||
1391 : | ;movdqa xmm0,[%1+16*0] ;We do not load 0-3 values here for they | ||
1392 : | ;movdqa xmm1,[%1+16*1] ;stayed from transposition | ||
1393 : | ;movdqa xmm2,[%1+16*2] | ||
1394 : | ;movdqa xmm3,[%1+16*3] | ||
1395 : | %if %3<>0 | ||
1396 : | movdqa xmm7,[rounder_5] | ||
1397 : | %endif | ||
1398 : | |||
1399 : | paddsw xmm0,[%1+16*7] ;tmp0 | ||
1400 : | movdqa xmm4,xmm0 | ||
1401 : | paddsw xmm1,[%1+16*6] ;tmp1 | ||
1402 : | movdqa xmm5,xmm1 | ||
1403 : | paddsw xmm2,[%1+16*5] ;tmp2 | ||
1404 : | paddsw xmm3,[%1+16*4] ;tmp3 | ||
1405 : | |||
1406 : | paddsw xmm0,xmm3 ;tmp10 | ||
1407 : | %if %3<>0 ; In the second pass we must round and shift before | ||
1408 : | ; the tmp10+tmp11 and tmp10-tmp11 calculation | ||
1409 : | ; or the overflow will happen. | ||
1410 : | paddsw xmm0,xmm7 ;[rounder_5] | ||
1411 : | psraw xmm0,PASS1_BITS+3 | ||
1412 : | %endif | ||
1413 : | movdqa xmm6,xmm0 ;tmp10 | ||
1414 : | paddsw xmm1,xmm2 ;tmp11 | ||
1415 : | psubsw xmm4,xmm3 ;tmp13 | ||
1416 : | psubsw xmm5,xmm2 ;tmp12 | ||
1417 : | |||
1418 : | %if %3=0 | ||
1419 : | paddsw xmm0,xmm1 | ||
1420 : | psubsw xmm6,xmm1 | ||
1421 : | |||
1422 : | psllw xmm0,PASS1_BITS | ||
1423 : | psllw xmm6,PASS1_BITS | ||
1424 : | %else | ||
1425 : | paddsw xmm1,xmm7 ;[rounder_5] | ||
1426 : | psraw xmm1,PASS1_BITS+3 | ||
1427 : | |||
1428 : | paddsw xmm0,xmm1 | ||
1429 : | psubsw xmm6,xmm1 | ||
1430 : | %endif | ||
1431 : | |||
1432 : | movdqa xmm1,xmm4 | ||
1433 : | movdqa xmm2,xmm4 | ||
1434 : | |||
1435 : | movdqa [%2+16*0],xmm0 | ||
1436 : | movdqa [%2+16*4],xmm6 | ||
1437 : | |||
1438 : | movdqa xmm7,[FIX_1] | ||
1439 : | |||
1440 : | punpckhwd xmm1,xmm5 ; 12 13 12 13 12 13 12 13 high part | ||
1441 : | movdqa xmm6,xmm1 ;high | ||
1442 : | punpcklwd xmm2,xmm5 ; 12 13 12 13 12 13 12 13 low part | ||
1443 : | movdqa xmm0,xmm2 ;low | ||
1444 : | |||
1445 : | movdqa xmm4,[FIX_2] | ||
1446 : | |||
1447 : | %if %4=11 | ||
1448 : | movdqa xmm5,[rounder_11] | ||
1449 : | %else | ||
1450 : | movdqa xmm5,[rounder_18] | ||
1451 : | %endif | ||
1452 : | |||
1453 : | pmaddwd xmm2,xmm7 ;[FIX_1] | ||
1454 : | pmaddwd xmm1,xmm7 ;[FIX_1] | ||
1455 : | pmaddwd xmm0,xmm4 ;[FIX_2] | ||
1456 : | pmaddwd xmm6,xmm4 ;[FIX_2] | ||
1457 : | |||
1458 : | paddd xmm2,xmm5 ;rounder | ||
1459 : | paddd xmm1,xmm5 ;rounder | ||
1460 : | psrad xmm2,%4 | ||
1461 : | psrad xmm1,%4 | ||
1462 : | |||
1463 : | packssdw xmm2,xmm1 | ||
1464 : | movdqa [%2+16*2],xmm2 | ||
1465 : | |||
1466 : | paddd xmm0,xmm5 ;rounder | ||
1467 : | paddd xmm6,xmm5 ;rounder | ||
1468 : | psrad xmm0,%4 | ||
1469 : | psrad xmm6,%4 | ||
1470 : | |||
1471 : | packssdw xmm0,xmm6 | ||
1472 : | movdqa [%2+16*6],xmm0 | ||
1473 : | |||
1474 : | movdqa xmm0,[%1+16*0] | ||
1475 : | movdqa xmm1,[%1+16*1] | ||
1476 : | movdqa xmm2,[%1+16*2] | ||
1477 : | movdqa xmm3,[%1+16*3] | ||
1478 : | |||
1479 : | psubsw xmm0,[%1+16*7] ;tmp7 | ||
1480 : | movdqa xmm4,xmm0 | ||
1481 : | psubsw xmm1,[%1+16*6] ;tmp6 | ||
1482 : | psubsw xmm2,[%1+16*5] ;tmp5 | ||
1483 : | movdqa xmm6,xmm2 | ||
1484 : | psubsw xmm3,[%1+16*4] ;tmp4 | ||
1485 : | |||
1486 : | punpckhwd xmm4,xmm1 ; 6 7 6 7 6 7 6 7 high part | ||
1487 : | punpcklwd xmm0,xmm1 ; 6 7 6 7 6 7 6 7 low part | ||
1488 : | punpckhwd xmm6,xmm3 ; 4 5 4 5 4 5 4 5 high part | ||
1489 : | punpcklwd xmm2,xmm3 ; 4 5 4 5 4 5 4 5 low part | ||
1490 : | |||
1491 : | makeoddpart %2+16*1,FIX_3,%4 | ||
1492 : | makeoddpart %2+16*3,FIX_4,%4 | ||
1493 : | makeoddpart %2+16*5,FIX_5,%4 | ||
1494 : | makeoddpartlast %2+16*7,FIX_6,%4 | ||
1495 : | |||
1496 : | %endmacro | ||
1497 : | |||
1498 : | cglobal fdct_sse2 | ||
1499 : | ;;void f dct_sse2(short *block); | ||
1500 : | fdct_sse2: | ||
1501 : | |||
1502 : | push eax | ||
1503 : | push ebx | ||
1504 : | |||
1505 : | mov eax,[esp+4+2*4] | ||
1506 : | mov ebx,buffer | ||
1507 : | |||
1508 : | prefetchnta [FIX_1] | ||
1509 : | prefetchnta [FIX_3] | ||
1510 : | prefetchnta [FIX_5] | ||
1511 : | |||
1512 : | transpose8x8sse2 eax,ebx,1 ; First we transpose last 4 lines | ||
1513 : | transpose8x8sse2 eax,ebx,0 ; Then the firts 4 lines | ||
1514 : | |||
1515 : | ;processing columns (became rows after transposition) | ||
1516 : | |||
1517 : | FDCT_1D ebx,eax,0,CONST_BITS - PASS1_BITS | ||
1518 : | |||
1519 : | transpose8x8sse2 eax,ebx,1 | ||
1520 : | transpose8x8sse2 eax,ebx,0 | ||
1521 : | |||
1522 : | ;now processing rows | ||
1523 : | |||
1524 : | FDCT_1D ebx,eax,1,CONST_BITS + PASS1_BITS + 3 | ||
1525 : | |||
1526 : | pop ebx | ||
1527 : | pop eax | ||
1528 : | |||
1529 : | ret |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |