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