39 #define C0 23170 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
40 #define C1 22725 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
41 #define C2 21407 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
42 #define C3 19266 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
43 #define C4 16383 //cos(i*M_PI/16)*sqrt(2)*(1<<14) - 0.5
44 #define C5 12873 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
45 #define C6 8867 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
46 #define C7 4520 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
49 #define COL_SHIFT 20 // 6
85 int16_t *
const temp= (int16_t*)align_tmp;
88 #if 0 //Alternative, simpler variant
90 #define ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
91 "movq " #src0 ", %%mm0 \n\t" \
92 "movq " #src4 ", %%mm1 \n\t" \
93 "movq " #src1 ", %%mm2 \n\t" \
94 "movq " #src5 ", %%mm3 \n\t" \
95 "movq 16(%2), %%mm4 \n\t" \
96 "pmaddwd %%mm0, %%mm4 \n\t" \
97 "movq 24(%2), %%mm5 \n\t" \
98 "pmaddwd %%mm5, %%mm0 \n\t" \
99 "movq 32(%2), %%mm5 \n\t" \
100 "pmaddwd %%mm1, %%mm5 \n\t" \
101 "movq 40(%2), %%mm6 \n\t" \
102 "pmaddwd %%mm6, %%mm1 \n\t" \
103 "movq 48(%2), %%mm7 \n\t" \
104 "pmaddwd %%mm2, %%mm7 \n\t" \
105 #rounder ", %%mm4 \n\t"\
106 "movq %%mm4, %%mm6 \n\t" \
107 "paddd %%mm5, %%mm4 \n\t" \
108 "psubd %%mm5, %%mm6 \n\t" \
109 "movq 56(%2), %%mm5 \n\t" \
110 "pmaddwd %%mm3, %%mm5 \n\t" \
111 #rounder ", %%mm0 \n\t"\
112 "paddd %%mm0, %%mm1 \n\t" \
113 "paddd %%mm0, %%mm0 \n\t" \
114 "psubd %%mm1, %%mm0 \n\t" \
115 "pmaddwd 64(%2), %%mm2 \n\t" \
116 "paddd %%mm5, %%mm7 \n\t" \
117 "movq 72(%2), %%mm5 \n\t" \
118 "pmaddwd %%mm3, %%mm5 \n\t" \
119 "paddd %%mm4, %%mm7 \n\t" \
120 "paddd %%mm4, %%mm4 \n\t" \
121 "psubd %%mm7, %%mm4 \n\t" \
122 "paddd %%mm2, %%mm5 \n\t" \
123 "psrad $" #shift ", %%mm7 \n\t"\
124 "psrad $" #shift ", %%mm4 \n\t"\
125 "movq %%mm1, %%mm2 \n\t" \
126 "paddd %%mm5, %%mm1 \n\t" \
127 "psubd %%mm5, %%mm2 \n\t" \
128 "psrad $" #shift ", %%mm1 \n\t"\
129 "psrad $" #shift ", %%mm2 \n\t"\
130 "packssdw %%mm1, %%mm7 \n\t" \
131 "packssdw %%mm4, %%mm2 \n\t" \
132 "movq %%mm7, " #dst " \n\t"\
133 "movq " #src1 ", %%mm1 \n\t" \
134 "movq 80(%2), %%mm4 \n\t" \
135 "movq %%mm2, 24+" #dst " \n\t"\
136 "pmaddwd %%mm1, %%mm4 \n\t" \
137 "movq 88(%2), %%mm7 \n\t" \
138 "pmaddwd 96(%2), %%mm1 \n\t" \
139 "pmaddwd %%mm3, %%mm7 \n\t" \
140 "movq %%mm0, %%mm2 \n\t" \
141 "pmaddwd 104(%2), %%mm3 \n\t" \
142 "paddd %%mm7, %%mm4 \n\t" \
143 "paddd %%mm4, %%mm2 \n\t" \
144 "psubd %%mm4, %%mm0 \n\t" \
145 "psrad $" #shift ", %%mm2 \n\t"\
146 "psrad $" #shift ", %%mm0 \n\t"\
147 "movq %%mm6, %%mm4 \n\t" \
148 "paddd %%mm1, %%mm3 \n\t" \
149 "paddd %%mm3, %%mm6 \n\t" \
150 "psubd %%mm3, %%mm4 \n\t" \
151 "psrad $" #shift ", %%mm6 \n\t"\
152 "packssdw %%mm6, %%mm2 \n\t" \
153 "movq %%mm2, 8+" #dst " \n\t"\
154 "psrad $" #shift ", %%mm4 \n\t"\
155 "packssdw %%mm0, %%mm4 \n\t" \
156 "movq %%mm4, 16+" #dst " \n\t"\
158 #define COL_IDCT(src0, src4, src1, src5, dst, shift) \
159 "movq " #src0 ", %%mm0 \n\t" \
160 "movq " #src4 ", %%mm1 \n\t" \
161 "movq " #src1 ", %%mm2 \n\t" \
162 "movq " #src5 ", %%mm3 \n\t" \
163 "movq 16(%2), %%mm4 \n\t" \
164 "pmaddwd %%mm0, %%mm4 \n\t" \
165 "movq 24(%2), %%mm5 \n\t" \
166 "pmaddwd %%mm5, %%mm0 \n\t" \
167 "movq 32(%2), %%mm5 \n\t" \
168 "pmaddwd %%mm1, %%mm5 \n\t" \
169 "movq 40(%2), %%mm6 \n\t" \
170 "pmaddwd %%mm6, %%mm1 \n\t" \
171 "movq %%mm4, %%mm6 \n\t" \
172 "movq 48(%2), %%mm7 \n\t" \
173 "pmaddwd %%mm2, %%mm7 \n\t" \
174 "paddd %%mm5, %%mm4 \n\t" \
175 "psubd %%mm5, %%mm6 \n\t" \
176 "movq %%mm0, %%mm5 \n\t" \
177 "paddd %%mm1, %%mm0 \n\t" \
178 "psubd %%mm1, %%mm5 \n\t" \
179 "movq 56(%2), %%mm1 \n\t" \
180 "pmaddwd %%mm3, %%mm1 \n\t" \
181 "pmaddwd 64(%2), %%mm2 \n\t" \
182 "paddd %%mm1, %%mm7 \n\t" \
183 "movq 72(%2), %%mm1 \n\t" \
184 "pmaddwd %%mm3, %%mm1 \n\t" \
185 "paddd %%mm4, %%mm7 \n\t" \
186 "paddd %%mm4, %%mm4 \n\t" \
187 "psubd %%mm7, %%mm4 \n\t" \
188 "paddd %%mm2, %%mm1 \n\t" \
189 "psrad $" #shift ", %%mm7 \n\t"\
190 "psrad $" #shift ", %%mm4 \n\t"\
191 "movq %%mm0, %%mm2 \n\t" \
192 "paddd %%mm1, %%mm0 \n\t" \
193 "psubd %%mm1, %%mm2 \n\t" \
194 "psrad $" #shift ", %%mm0 \n\t"\
195 "psrad $" #shift ", %%mm2 \n\t"\
196 "packssdw %%mm7, %%mm7 \n\t" \
197 "movd %%mm7, " #dst " \n\t"\
198 "packssdw %%mm0, %%mm0 \n\t" \
199 "movd %%mm0, 16+" #dst " \n\t"\
200 "packssdw %%mm2, %%mm2 \n\t" \
201 "movd %%mm2, 96+" #dst " \n\t"\
202 "packssdw %%mm4, %%mm4 \n\t" \
203 "movd %%mm4, 112+" #dst " \n\t"\
204 "movq " #src1 ", %%mm0 \n\t" \
205 "movq 80(%2), %%mm4 \n\t" \
206 "pmaddwd %%mm0, %%mm4 \n\t" \
207 "movq 88(%2), %%mm7 \n\t" \
208 "pmaddwd 96(%2), %%mm0 \n\t" \
209 "pmaddwd %%mm3, %%mm7 \n\t" \
210 "movq %%mm5, %%mm2 \n\t" \
211 "pmaddwd 104(%2), %%mm3 \n\t" \
212 "paddd %%mm7, %%mm4 \n\t" \
213 "paddd %%mm4, %%mm2 \n\t" \
214 "psubd %%mm4, %%mm5 \n\t" \
215 "psrad $" #shift ", %%mm2 \n\t"\
216 "psrad $" #shift ", %%mm5 \n\t"\
217 "movq %%mm6, %%mm4 \n\t" \
218 "paddd %%mm0, %%mm3 \n\t" \
219 "paddd %%mm3, %%mm6 \n\t" \
220 "psubd %%mm3, %%mm4 \n\t" \
221 "psrad $" #shift ", %%mm6 \n\t"\
222 "psrad $" #shift ", %%mm4 \n\t"\
223 "packssdw %%mm2, %%mm2 \n\t" \
224 "packssdw %%mm6, %%mm6 \n\t" \
225 "movd %%mm2, 32+" #dst " \n\t"\
226 "packssdw %%mm4, %%mm4 \n\t" \
227 "packssdw %%mm5, %%mm5 \n\t" \
228 "movd %%mm6, 48+" #dst " \n\t"\
229 "movd %%mm4, 64+" #dst " \n\t"\
230 "movd %%mm5, 80+" #dst " \n\t"\
233 #define DC_COND_ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
234 "movq " #src0 ", %%mm0 \n\t" \
235 "movq " #src4 ", %%mm1 \n\t" \
236 "movq " #src1 ", %%mm2 \n\t" \
237 "movq " #src5 ", %%mm3 \n\t" \
238 "movq "MANGLE(wm1010)", %%mm4 \n\t"\
239 "pand %%mm0, %%mm4 \n\t"\
240 "por %%mm1, %%mm4 \n\t"\
241 "por %%mm2, %%mm4 \n\t"\
242 "por %%mm3, %%mm4 \n\t"\
243 "packssdw %%mm4,%%mm4 \n\t"\
244 "movd %%mm4, %%eax \n\t"\
245 "orl %%eax, %%eax \n\t"\
247 "movq 16(%2), %%mm4 \n\t" \
248 "pmaddwd %%mm0, %%mm4 \n\t" \
249 "movq 24(%2), %%mm5 \n\t" \
250 "pmaddwd %%mm5, %%mm0 \n\t" \
251 "movq 32(%2), %%mm5 \n\t" \
252 "pmaddwd %%mm1, %%mm5 \n\t" \
253 "movq 40(%2), %%mm6 \n\t" \
254 "pmaddwd %%mm6, %%mm1 \n\t" \
255 "movq 48(%2), %%mm7 \n\t" \
256 "pmaddwd %%mm2, %%mm7 \n\t" \
257 #rounder ", %%mm4 \n\t"\
258 "movq %%mm4, %%mm6 \n\t" \
259 "paddd %%mm5, %%mm4 \n\t" \
260 "psubd %%mm5, %%mm6 \n\t" \
261 "movq 56(%2), %%mm5 \n\t" \
262 "pmaddwd %%mm3, %%mm5 \n\t" \
263 #rounder ", %%mm0 \n\t"\
264 "paddd %%mm0, %%mm1 \n\t" \
265 "paddd %%mm0, %%mm0 \n\t" \
266 "psubd %%mm1, %%mm0 \n\t" \
267 "pmaddwd 64(%2), %%mm2 \n\t" \
268 "paddd %%mm5, %%mm7 \n\t" \
269 "movq 72(%2), %%mm5 \n\t" \
270 "pmaddwd %%mm3, %%mm5 \n\t" \
271 "paddd %%mm4, %%mm7 \n\t" \
272 "paddd %%mm4, %%mm4 \n\t" \
273 "psubd %%mm7, %%mm4 \n\t" \
274 "paddd %%mm2, %%mm5 \n\t" \
275 "psrad $" #shift ", %%mm7 \n\t"\
276 "psrad $" #shift ", %%mm4 \n\t"\
277 "movq %%mm1, %%mm2 \n\t" \
278 "paddd %%mm5, %%mm1 \n\t" \
279 "psubd %%mm5, %%mm2 \n\t" \
280 "psrad $" #shift ", %%mm1 \n\t"\
281 "psrad $" #shift ", %%mm2 \n\t"\
282 "packssdw %%mm1, %%mm7 \n\t" \
283 "packssdw %%mm4, %%mm2 \n\t" \
284 "movq %%mm7, " #dst " \n\t"\
285 "movq " #src1 ", %%mm1 \n\t" \
286 "movq 80(%2), %%mm4 \n\t" \
287 "movq %%mm2, 24+" #dst " \n\t"\
288 "pmaddwd %%mm1, %%mm4 \n\t" \
289 "movq 88(%2), %%mm7 \n\t" \
290 "pmaddwd 96(%2), %%mm1 \n\t" \
291 "pmaddwd %%mm3, %%mm7 \n\t" \
292 "movq %%mm0, %%mm2 \n\t" \
293 "pmaddwd 104(%2), %%mm3 \n\t" \
294 "paddd %%mm7, %%mm4 \n\t" \
295 "paddd %%mm4, %%mm2 \n\t" \
296 "psubd %%mm4, %%mm0 \n\t" \
297 "psrad $" #shift ", %%mm2 \n\t"\
298 "psrad $" #shift ", %%mm0 \n\t"\
299 "movq %%mm6, %%mm4 \n\t" \
300 "paddd %%mm1, %%mm3 \n\t" \
301 "paddd %%mm3, %%mm6 \n\t" \
302 "psubd %%mm3, %%mm4 \n\t" \
303 "psrad $" #shift ", %%mm6 \n\t"\
304 "packssdw %%mm6, %%mm2 \n\t" \
305 "movq %%mm2, 8+" #dst " \n\t"\
306 "psrad $" #shift ", %%mm4 \n\t"\
307 "packssdw %%mm0, %%mm4 \n\t" \
308 "movq %%mm4, 16+" #dst " \n\t"\
311 "pslld $16, %%mm0 \n\t"\
312 "#paddd "MANGLE(d40000)", %%mm0 \n\t"\
313 "psrad $13, %%mm0 \n\t"\
314 "packssdw %%mm0, %%mm0 \n\t"\
315 "movq %%mm0, " #dst " \n\t"\
316 "movq %%mm0, 8+" #dst " \n\t"\
317 "movq %%mm0, 16+" #dst " \n\t"\
318 "movq %%mm0, 24+" #dst " \n\t"\
323 ROW_IDCT( (%0), 8(%0), 16(%0), 24(%0), 0(%1),paddd 8(%2), 11)
328 DC_COND_ROW_IDCT( 32(%0), 40(%0), 48(%0), 56(%0), 32(%1),paddd (%2), 11)
329 DC_COND_ROW_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11)
330 DC_COND_ROW_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11)
334 COL_IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
335 COL_IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
336 COL_IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
337 COL_IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
341 #define DC_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
342 "movq " #src0 ", %%mm0 \n\t" \
343 "movq " #src4 ", %%mm1 \n\t" \
344 "movq " #src1 ", %%mm2 \n\t" \
345 "movq " #src5 ", %%mm3 \n\t" \
346 "movq "MANGLE(wm1010)", %%mm4 \n\t"\
347 "pand %%mm0, %%mm4 \n\t"\
348 "por %%mm1, %%mm4 \n\t"\
349 "por %%mm2, %%mm4 \n\t"\
350 "por %%mm3, %%mm4 \n\t"\
351 "packssdw %%mm4,%%mm4 \n\t"\
352 "movd %%mm4, %%eax \n\t"\
353 "orl %%eax, %%eax \n\t"\
355 "movq 16(%2), %%mm4 \n\t" \
356 "pmaddwd %%mm0, %%mm4 \n\t" \
357 "movq 24(%2), %%mm5 \n\t" \
358 "pmaddwd %%mm5, %%mm0 \n\t" \
359 "movq 32(%2), %%mm5 \n\t" \
360 "pmaddwd %%mm1, %%mm5 \n\t" \
361 "movq 40(%2), %%mm6 \n\t" \
362 "pmaddwd %%mm6, %%mm1 \n\t" \
363 "movq 48(%2), %%mm7 \n\t" \
364 "pmaddwd %%mm2, %%mm7 \n\t" \
365 #rounder ", %%mm4 \n\t"\
366 "movq %%mm4, %%mm6 \n\t" \
367 "paddd %%mm5, %%mm4 \n\t" \
368 "psubd %%mm5, %%mm6 \n\t" \
369 "movq 56(%2), %%mm5 \n\t" \
370 "pmaddwd %%mm3, %%mm5 \n\t" \
371 #rounder ", %%mm0 \n\t"\
372 "paddd %%mm0, %%mm1 \n\t" \
373 "paddd %%mm0, %%mm0 \n\t" \
374 "psubd %%mm1, %%mm0 \n\t" \
375 "pmaddwd 64(%2), %%mm2 \n\t" \
376 "paddd %%mm5, %%mm7 \n\t" \
377 "movq 72(%2), %%mm5 \n\t" \
378 "pmaddwd %%mm3, %%mm5 \n\t" \
379 "paddd %%mm4, %%mm7 \n\t" \
380 "paddd %%mm4, %%mm4 \n\t" \
381 "psubd %%mm7, %%mm4 \n\t" \
382 "paddd %%mm2, %%mm5 \n\t" \
383 "psrad $" #shift ", %%mm7 \n\t"\
384 "psrad $" #shift ", %%mm4 \n\t"\
385 "movq %%mm1, %%mm2 \n\t" \
386 "paddd %%mm5, %%mm1 \n\t" \
387 "psubd %%mm5, %%mm2 \n\t" \
388 "psrad $" #shift ", %%mm1 \n\t"\
389 "psrad $" #shift ", %%mm2 \n\t"\
390 "packssdw %%mm1, %%mm7 \n\t" \
391 "packssdw %%mm4, %%mm2 \n\t" \
392 "movq %%mm7, " #dst " \n\t"\
393 "movq " #src1 ", %%mm1 \n\t" \
394 "movq 80(%2), %%mm4 \n\t" \
395 "movq %%mm2, 24+" #dst " \n\t"\
396 "pmaddwd %%mm1, %%mm4 \n\t" \
397 "movq 88(%2), %%mm7 \n\t" \
398 "pmaddwd 96(%2), %%mm1 \n\t" \
399 "pmaddwd %%mm3, %%mm7 \n\t" \
400 "movq %%mm0, %%mm2 \n\t" \
401 "pmaddwd 104(%2), %%mm3 \n\t" \
402 "paddd %%mm7, %%mm4 \n\t" \
403 "paddd %%mm4, %%mm2 \n\t" \
404 "psubd %%mm4, %%mm0 \n\t" \
405 "psrad $" #shift ", %%mm2 \n\t"\
406 "psrad $" #shift ", %%mm0 \n\t"\
407 "movq %%mm6, %%mm4 \n\t" \
408 "paddd %%mm1, %%mm3 \n\t" \
409 "paddd %%mm3, %%mm6 \n\t" \
410 "psubd %%mm3, %%mm4 \n\t" \
411 "psrad $" #shift ", %%mm6 \n\t"\
412 "packssdw %%mm6, %%mm2 \n\t" \
413 "movq %%mm2, 8+" #dst " \n\t"\
414 "psrad $" #shift ", %%mm4 \n\t"\
415 "packssdw %%mm0, %%mm4 \n\t" \
416 "movq %%mm4, 16+" #dst " \n\t"\
419 "pslld $16, %%mm0 \n\t"\
420 "paddd "MANGLE(d40000)", %%mm0 \n\t"\
421 "psrad $13, %%mm0 \n\t"\
422 "packssdw %%mm0, %%mm0 \n\t"\
423 "movq %%mm0, " #dst " \n\t"\
424 "movq %%mm0, 8+" #dst " \n\t"\
425 "movq %%mm0, 16+" #dst " \n\t"\
426 "movq %%mm0, 24+" #dst " \n\t"\
429 #define Z_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift, bt) \
430 "movq " #src0 ", %%mm0 \n\t" \
431 "movq " #src4 ", %%mm1 \n\t" \
432 "movq " #src1 ", %%mm2 \n\t" \
433 "movq " #src5 ", %%mm3 \n\t" \
434 "movq %%mm0, %%mm4 \n\t"\
435 "por %%mm1, %%mm4 \n\t"\
436 "por %%mm2, %%mm4 \n\t"\
437 "por %%mm3, %%mm4 \n\t"\
438 "packssdw %%mm4,%%mm4 \n\t"\
439 "movd %%mm4, %%eax \n\t"\
440 "orl %%eax, %%eax \n\t"\
442 "movq 16(%2), %%mm4 \n\t" \
443 "pmaddwd %%mm0, %%mm4 \n\t" \
444 "movq 24(%2), %%mm5 \n\t" \
445 "pmaddwd %%mm5, %%mm0 \n\t" \
446 "movq 32(%2), %%mm5 \n\t" \
447 "pmaddwd %%mm1, %%mm5 \n\t" \
448 "movq 40(%2), %%mm6 \n\t" \
449 "pmaddwd %%mm6, %%mm1 \n\t" \
450 "movq 48(%2), %%mm7 \n\t" \
451 "pmaddwd %%mm2, %%mm7 \n\t" \
452 #rounder ", %%mm4 \n\t"\
453 "movq %%mm4, %%mm6 \n\t" \
454 "paddd %%mm5, %%mm4 \n\t" \
455 "psubd %%mm5, %%mm6 \n\t" \
456 "movq 56(%2), %%mm5 \n\t" \
457 "pmaddwd %%mm3, %%mm5 \n\t" \
458 #rounder ", %%mm0 \n\t"\
459 "paddd %%mm0, %%mm1 \n\t" \
460 "paddd %%mm0, %%mm0 \n\t" \
461 "psubd %%mm1, %%mm0 \n\t" \
462 "pmaddwd 64(%2), %%mm2 \n\t" \
463 "paddd %%mm5, %%mm7 \n\t" \
464 "movq 72(%2), %%mm5 \n\t" \
465 "pmaddwd %%mm3, %%mm5 \n\t" \
466 "paddd %%mm4, %%mm7 \n\t" \
467 "paddd %%mm4, %%mm4 \n\t" \
468 "psubd %%mm7, %%mm4 \n\t" \
469 "paddd %%mm2, %%mm5 \n\t" \
470 "psrad $" #shift ", %%mm7 \n\t"\
471 "psrad $" #shift ", %%mm4 \n\t"\
472 "movq %%mm1, %%mm2 \n\t" \
473 "paddd %%mm5, %%mm1 \n\t" \
474 "psubd %%mm5, %%mm2 \n\t" \
475 "psrad $" #shift ", %%mm1 \n\t"\
476 "psrad $" #shift ", %%mm2 \n\t"\
477 "packssdw %%mm1, %%mm7 \n\t" \
478 "packssdw %%mm4, %%mm2 \n\t" \
479 "movq %%mm7, " #dst " \n\t"\
480 "movq " #src1 ", %%mm1 \n\t" \
481 "movq 80(%2), %%mm4 \n\t" \
482 "movq %%mm2, 24+" #dst " \n\t"\
483 "pmaddwd %%mm1, %%mm4 \n\t" \
484 "movq 88(%2), %%mm7 \n\t" \
485 "pmaddwd 96(%2), %%mm1 \n\t" \
486 "pmaddwd %%mm3, %%mm7 \n\t" \
487 "movq %%mm0, %%mm2 \n\t" \
488 "pmaddwd 104(%2), %%mm3 \n\t" \
489 "paddd %%mm7, %%mm4 \n\t" \
490 "paddd %%mm4, %%mm2 \n\t" \
491 "psubd %%mm4, %%mm0 \n\t" \
492 "psrad $" #shift ", %%mm2 \n\t"\
493 "psrad $" #shift ", %%mm0 \n\t"\
494 "movq %%mm6, %%mm4 \n\t" \
495 "paddd %%mm1, %%mm3 \n\t" \
496 "paddd %%mm3, %%mm6 \n\t" \
497 "psubd %%mm3, %%mm4 \n\t" \
498 "psrad $" #shift ", %%mm6 \n\t"\
499 "packssdw %%mm6, %%mm2 \n\t" \
500 "movq %%mm2, 8+" #dst " \n\t"\
501 "psrad $" #shift ", %%mm4 \n\t"\
502 "packssdw %%mm0, %%mm4 \n\t" \
503 "movq %%mm4, 16+" #dst " \n\t"\
505 #define ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
506 "movq " #src0 ", %%mm0 \n\t" \
507 "movq " #src4 ", %%mm1 \n\t" \
508 "movq " #src1 ", %%mm2 \n\t" \
509 "movq " #src5 ", %%mm3 \n\t" \
510 "movq 16(%2), %%mm4 \n\t" \
511 "pmaddwd %%mm0, %%mm4 \n\t" \
512 "movq 24(%2), %%mm5 \n\t" \
513 "pmaddwd %%mm5, %%mm0 \n\t" \
514 "movq 32(%2), %%mm5 \n\t" \
515 "pmaddwd %%mm1, %%mm5 \n\t" \
516 "movq 40(%2), %%mm6 \n\t" \
517 "pmaddwd %%mm6, %%mm1 \n\t" \
518 "movq 48(%2), %%mm7 \n\t" \
519 "pmaddwd %%mm2, %%mm7 \n\t" \
520 #rounder ", %%mm4 \n\t"\
521 "movq %%mm4, %%mm6 \n\t" \
522 "paddd %%mm5, %%mm4 \n\t" \
523 "psubd %%mm5, %%mm6 \n\t" \
524 "movq 56(%2), %%mm5 \n\t" \
525 "pmaddwd %%mm3, %%mm5 \n\t" \
526 #rounder ", %%mm0 \n\t"\
527 "paddd %%mm0, %%mm1 \n\t" \
528 "paddd %%mm0, %%mm0 \n\t" \
529 "psubd %%mm1, %%mm0 \n\t" \
530 "pmaddwd 64(%2), %%mm2 \n\t" \
531 "paddd %%mm5, %%mm7 \n\t" \
532 "movq 72(%2), %%mm5 \n\t" \
533 "pmaddwd %%mm3, %%mm5 \n\t" \
534 "paddd %%mm4, %%mm7 \n\t" \
535 "paddd %%mm4, %%mm4 \n\t" \
536 "psubd %%mm7, %%mm4 \n\t" \
537 "paddd %%mm2, %%mm5 \n\t" \
538 "psrad $" #shift ", %%mm7 \n\t"\
539 "psrad $" #shift ", %%mm4 \n\t"\
540 "movq %%mm1, %%mm2 \n\t" \
541 "paddd %%mm5, %%mm1 \n\t" \
542 "psubd %%mm5, %%mm2 \n\t" \
543 "psrad $" #shift ", %%mm1 \n\t"\
544 "psrad $" #shift ", %%mm2 \n\t"\
545 "packssdw %%mm1, %%mm7 \n\t" \
546 "packssdw %%mm4, %%mm2 \n\t" \
547 "movq %%mm7, " #dst " \n\t"\
548 "movq " #src1 ", %%mm1 \n\t" \
549 "movq 80(%2), %%mm4 \n\t" \
550 "movq %%mm2, 24+" #dst " \n\t"\
551 "pmaddwd %%mm1, %%mm4 \n\t" \
552 "movq 88(%2), %%mm7 \n\t" \
553 "pmaddwd 96(%2), %%mm1 \n\t" \
554 "pmaddwd %%mm3, %%mm7 \n\t" \
555 "movq %%mm0, %%mm2 \n\t" \
556 "pmaddwd 104(%2), %%mm3 \n\t" \
557 "paddd %%mm7, %%mm4 \n\t" \
558 "paddd %%mm4, %%mm2 \n\t" \
559 "psubd %%mm4, %%mm0 \n\t" \
560 "psrad $" #shift ", %%mm2 \n\t"\
561 "psrad $" #shift ", %%mm0 \n\t"\
562 "movq %%mm6, %%mm4 \n\t" \
563 "paddd %%mm1, %%mm3 \n\t" \
564 "paddd %%mm3, %%mm6 \n\t" \
565 "psubd %%mm3, %%mm4 \n\t" \
566 "psrad $" #shift ", %%mm6 \n\t"\
567 "packssdw %%mm6, %%mm2 \n\t" \
568 "movq %%mm2, 8+" #dst " \n\t"\
569 "psrad $" #shift ", %%mm4 \n\t"\
570 "packssdw %%mm0, %%mm4 \n\t" \
571 "movq %%mm4, 16+" #dst " \n\t"\
574 DC_COND_IDCT( 0(%0), 8(%0), 16(%0), 24(%0), 0(%1),paddd 8(%2), 11)
575 Z_COND_IDCT( 32(%0), 40(%0), 48(%0), 56(%0), 32(%1),paddd (%2), 11, 4f)
576 Z_COND_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11, 2f)
577 Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 1f)
580 #define IDCT(src0, src4, src1, src5, dst, shift) \
581 "movq " #src0 ", %%mm0 \n\t" \
582 "movq " #src4 ", %%mm1 \n\t" \
583 "movq " #src1 ", %%mm2 \n\t" \
584 "movq " #src5 ", %%mm3 \n\t" \
585 "movq 16(%2), %%mm4 \n\t" \
586 "pmaddwd %%mm0, %%mm4 \n\t" \
587 "movq 24(%2), %%mm5 \n\t" \
588 "pmaddwd %%mm5, %%mm0 \n\t" \
589 "movq 32(%2), %%mm5 \n\t" \
590 "pmaddwd %%mm1, %%mm5 \n\t" \
591 "movq 40(%2), %%mm6 \n\t" \
592 "pmaddwd %%mm6, %%mm1 \n\t" \
593 "movq %%mm4, %%mm6 \n\t" \
594 "movq 48(%2), %%mm7 \n\t" \
595 "pmaddwd %%mm2, %%mm7 \n\t" \
596 "paddd %%mm5, %%mm4 \n\t" \
597 "psubd %%mm5, %%mm6 \n\t" \
598 "movq %%mm0, %%mm5 \n\t" \
599 "paddd %%mm1, %%mm0 \n\t" \
600 "psubd %%mm1, %%mm5 \n\t" \
601 "movq 56(%2), %%mm1 \n\t" \
602 "pmaddwd %%mm3, %%mm1 \n\t" \
603 "pmaddwd 64(%2), %%mm2 \n\t" \
604 "paddd %%mm1, %%mm7 \n\t" \
605 "movq 72(%2), %%mm1 \n\t" \
606 "pmaddwd %%mm3, %%mm1 \n\t" \
607 "paddd %%mm4, %%mm7 \n\t" \
608 "paddd %%mm4, %%mm4 \n\t" \
609 "psubd %%mm7, %%mm4 \n\t" \
610 "paddd %%mm2, %%mm1 \n\t" \
611 "psrad $" #shift ", %%mm7 \n\t"\
612 "psrad $" #shift ", %%mm4 \n\t"\
613 "movq %%mm0, %%mm2 \n\t" \
614 "paddd %%mm1, %%mm0 \n\t" \
615 "psubd %%mm1, %%mm2 \n\t" \
616 "psrad $" #shift ", %%mm0 \n\t"\
617 "psrad $" #shift ", %%mm2 \n\t"\
618 "packssdw %%mm7, %%mm7 \n\t" \
619 "movd %%mm7, " #dst " \n\t"\
620 "packssdw %%mm0, %%mm0 \n\t" \
621 "movd %%mm0, 16+" #dst " \n\t"\
622 "packssdw %%mm2, %%mm2 \n\t" \
623 "movd %%mm2, 96+" #dst " \n\t"\
624 "packssdw %%mm4, %%mm4 \n\t" \
625 "movd %%mm4, 112+" #dst " \n\t"\
626 "movq " #src1 ", %%mm0 \n\t" \
627 "movq 80(%2), %%mm4 \n\t" \
628 "pmaddwd %%mm0, %%mm4 \n\t" \
629 "movq 88(%2), %%mm7 \n\t" \
630 "pmaddwd 96(%2), %%mm0 \n\t" \
631 "pmaddwd %%mm3, %%mm7 \n\t" \
632 "movq %%mm5, %%mm2 \n\t" \
633 "pmaddwd 104(%2), %%mm3 \n\t" \
634 "paddd %%mm7, %%mm4 \n\t" \
635 "paddd %%mm4, %%mm2 \n\t" \
636 "psubd %%mm4, %%mm5 \n\t" \
637 "psrad $" #shift ", %%mm2 \n\t"\
638 "psrad $" #shift ", %%mm5 \n\t"\
639 "movq %%mm6, %%mm4 \n\t" \
640 "paddd %%mm0, %%mm3 \n\t" \
641 "paddd %%mm3, %%mm6 \n\t" \
642 "psubd %%mm3, %%mm4 \n\t" \
643 "psrad $" #shift ", %%mm6 \n\t"\
644 "psrad $" #shift ", %%mm4 \n\t"\
645 "packssdw %%mm2, %%mm2 \n\t" \
646 "packssdw %%mm6, %%mm6 \n\t" \
647 "movd %%mm2, 32+" #dst " \n\t"\
648 "packssdw %%mm4, %%mm4 \n\t" \
649 "packssdw %%mm5, %%mm5 \n\t" \
650 "movd %%mm6, 48+" #dst " \n\t"\
651 "movd %%mm4, 64+" #dst " \n\t"\
652 "movd %%mm5, 80+" #dst " \n\t"
656 IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
657 IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
658 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
659 IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
664 Z_COND_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11, 6f)
665 Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 5f)
668 #define IDCT(src0, src4, src1, src5, dst, shift) \
669 "movq " #src0 ", %%mm0 \n\t" \
670 "movq " #src4 ", %%mm1 \n\t" \
671 "movq " #src5 ", %%mm3 \n\t" \
672 "movq 16(%2), %%mm4 \n\t" \
673 "pmaddwd %%mm0, %%mm4 \n\t" \
674 "movq 24(%2), %%mm5 \n\t" \
675 "pmaddwd %%mm5, %%mm0 \n\t" \
676 "movq 32(%2), %%mm5 \n\t" \
677 "pmaddwd %%mm1, %%mm5 \n\t" \
678 "movq 40(%2), %%mm6 \n\t" \
679 "pmaddwd %%mm6, %%mm1 \n\t" \
680 "movq %%mm4, %%mm6 \n\t" \
681 "paddd %%mm5, %%mm4 \n\t" \
682 "psubd %%mm5, %%mm6 \n\t" \
683 "movq %%mm0, %%mm5 \n\t" \
684 "paddd %%mm1, %%mm0 \n\t" \
685 "psubd %%mm1, %%mm5 \n\t" \
686 "movq 56(%2), %%mm1 \n\t" \
687 "pmaddwd %%mm3, %%mm1 \n\t" \
688 "movq 72(%2), %%mm7 \n\t" \
689 "pmaddwd %%mm3, %%mm7 \n\t" \
690 "paddd %%mm4, %%mm1 \n\t" \
691 "paddd %%mm4, %%mm4 \n\t" \
692 "psubd %%mm1, %%mm4 \n\t" \
693 "psrad $" #shift ", %%mm1 \n\t"\
694 "psrad $" #shift ", %%mm4 \n\t"\
695 "movq %%mm0, %%mm2 \n\t" \
696 "paddd %%mm7, %%mm0 \n\t" \
697 "psubd %%mm7, %%mm2 \n\t" \
698 "psrad $" #shift ", %%mm0 \n\t"\
699 "psrad $" #shift ", %%mm2 \n\t"\
700 "packssdw %%mm1, %%mm1 \n\t" \
701 "movd %%mm1, " #dst " \n\t"\
702 "packssdw %%mm0, %%mm0 \n\t" \
703 "movd %%mm0, 16+" #dst " \n\t"\
704 "packssdw %%mm2, %%mm2 \n\t" \
705 "movd %%mm2, 96+" #dst " \n\t"\
706 "packssdw %%mm4, %%mm4 \n\t" \
707 "movd %%mm4, 112+" #dst " \n\t"\
708 "movq 88(%2), %%mm1 \n\t" \
709 "pmaddwd %%mm3, %%mm1 \n\t" \
710 "movq %%mm5, %%mm2 \n\t" \
711 "pmaddwd 104(%2), %%mm3 \n\t" \
712 "paddd %%mm1, %%mm2 \n\t" \
713 "psubd %%mm1, %%mm5 \n\t" \
714 "psrad $" #shift ", %%mm2 \n\t"\
715 "psrad $" #shift ", %%mm5 \n\t"\
716 "movq %%mm6, %%mm1 \n\t" \
717 "paddd %%mm3, %%mm6 \n\t" \
718 "psubd %%mm3, %%mm1 \n\t" \
719 "psrad $" #shift ", %%mm6 \n\t"\
720 "psrad $" #shift ", %%mm1 \n\t"\
721 "packssdw %%mm2, %%mm2 \n\t" \
722 "packssdw %%mm6, %%mm6 \n\t" \
723 "movd %%mm2, 32+" #dst " \n\t"\
724 "packssdw %%mm1, %%mm1 \n\t" \
725 "packssdw %%mm5, %%mm5 \n\t" \
726 "movd %%mm6, 48+" #dst " \n\t"\
727 "movd %%mm1, 64+" #dst " \n\t"\
728 "movd %%mm5, 80+" #dst " \n\t"
731 IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
732 IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
733 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
734 IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
739 Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 7f)
742 #define IDCT(src0, src4, src1, src5, dst, shift) \
743 "movq " #src0 ", %%mm0 \n\t" \
744 "movq " #src5 ", %%mm3 \n\t" \
745 "movq 16(%2), %%mm4 \n\t" \
746 "pmaddwd %%mm0, %%mm4 \n\t" \
747 "movq 24(%2), %%mm5 \n\t" \
748 "pmaddwd %%mm5, %%mm0 \n\t" \
749 "movq %%mm4, %%mm6 \n\t" \
750 "movq %%mm0, %%mm5 \n\t" \
751 "movq 56(%2), %%mm1 \n\t" \
752 "pmaddwd %%mm3, %%mm1 \n\t" \
753 "movq 72(%2), %%mm7 \n\t" \
754 "pmaddwd %%mm3, %%mm7 \n\t" \
755 "paddd %%mm4, %%mm1 \n\t" \
756 "paddd %%mm4, %%mm4 \n\t" \
757 "psubd %%mm1, %%mm4 \n\t" \
758 "psrad $" #shift ", %%mm1 \n\t"\
759 "psrad $" #shift ", %%mm4 \n\t"\
760 "movq %%mm0, %%mm2 \n\t" \
761 "paddd %%mm7, %%mm0 \n\t" \
762 "psubd %%mm7, %%mm2 \n\t" \
763 "psrad $" #shift ", %%mm0 \n\t"\
764 "psrad $" #shift ", %%mm2 \n\t"\
765 "packssdw %%mm1, %%mm1 \n\t" \
766 "movd %%mm1, " #dst " \n\t"\
767 "packssdw %%mm0, %%mm0 \n\t" \
768 "movd %%mm0, 16+" #dst " \n\t"\
769 "packssdw %%mm2, %%mm2 \n\t" \
770 "movd %%mm2, 96+" #dst " \n\t"\
771 "packssdw %%mm4, %%mm4 \n\t" \
772 "movd %%mm4, 112+" #dst " \n\t"\
773 "movq 88(%2), %%mm1 \n\t" \
774 "pmaddwd %%mm3, %%mm1 \n\t" \
775 "movq %%mm5, %%mm2 \n\t" \
776 "pmaddwd 104(%2), %%mm3 \n\t" \
777 "paddd %%mm1, %%mm2 \n\t" \
778 "psubd %%mm1, %%mm5 \n\t" \
779 "psrad $" #shift ", %%mm2 \n\t"\
780 "psrad $" #shift ", %%mm5 \n\t"\
781 "movq %%mm6, %%mm1 \n\t" \
782 "paddd %%mm3, %%mm6 \n\t" \
783 "psubd %%mm3, %%mm1 \n\t" \
784 "psrad $" #shift ", %%mm6 \n\t"\
785 "psrad $" #shift ", %%mm1 \n\t"\
786 "packssdw %%mm2, %%mm2 \n\t" \
787 "packssdw %%mm6, %%mm6 \n\t" \
788 "movd %%mm2, 32+" #dst " \n\t"\
789 "packssdw %%mm1, %%mm1 \n\t" \
790 "packssdw %%mm5, %%mm5 \n\t" \
791 "movd %%mm6, 48+" #dst " \n\t"\
792 "movd %%mm1, 64+" #dst " \n\t"\
793 "movd %%mm5, 80+" #dst " \n\t"
797 IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
798 IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
799 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
800 IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
805 Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 3f)
808 #define IDCT(src0, src4, src1, src5, dst, shift) \
809 "movq " #src0 ", %%mm0 \n\t" \
810 "movq " #src1 ", %%mm2 \n\t" \
811 "movq " #src5 ", %%mm3 \n\t" \
812 "movq 16(%2), %%mm4 \n\t" \
813 "pmaddwd %%mm0, %%mm4 \n\t" \
814 "movq 24(%2), %%mm5 \n\t" \
815 "pmaddwd %%mm5, %%mm0 \n\t" \
816 "movq %%mm4, %%mm6 \n\t" \
817 "movq 48(%2), %%mm7 \n\t" \
818 "pmaddwd %%mm2, %%mm7 \n\t" \
819 "movq %%mm0, %%mm5 \n\t" \
820 "movq 56(%2), %%mm1 \n\t" \
821 "pmaddwd %%mm3, %%mm1 \n\t" \
822 "pmaddwd 64(%2), %%mm2 \n\t" \
823 "paddd %%mm1, %%mm7 \n\t" \
824 "movq 72(%2), %%mm1 \n\t" \
825 "pmaddwd %%mm3, %%mm1 \n\t" \
826 "paddd %%mm4, %%mm7 \n\t" \
827 "paddd %%mm4, %%mm4 \n\t" \
828 "psubd %%mm7, %%mm4 \n\t" \
829 "paddd %%mm2, %%mm1 \n\t" \
830 "psrad $" #shift ", %%mm7 \n\t"\
831 "psrad $" #shift ", %%mm4 \n\t"\
832 "movq %%mm0, %%mm2 \n\t" \
833 "paddd %%mm1, %%mm0 \n\t" \
834 "psubd %%mm1, %%mm2 \n\t" \
835 "psrad $" #shift ", %%mm0 \n\t"\
836 "psrad $" #shift ", %%mm2 \n\t"\
837 "packssdw %%mm7, %%mm7 \n\t" \
838 "movd %%mm7, " #dst " \n\t"\
839 "packssdw %%mm0, %%mm0 \n\t" \
840 "movd %%mm0, 16+" #dst " \n\t"\
841 "packssdw %%mm2, %%mm2 \n\t" \
842 "movd %%mm2, 96+" #dst " \n\t"\
843 "packssdw %%mm4, %%mm4 \n\t" \
844 "movd %%mm4, 112+" #dst " \n\t"\
845 "movq " #src1 ", %%mm0 \n\t" \
846 "movq 80(%2), %%mm4 \n\t" \
847 "pmaddwd %%mm0, %%mm4 \n\t" \
848 "movq 88(%2), %%mm7 \n\t" \
849 "pmaddwd 96(%2), %%mm0 \n\t" \
850 "pmaddwd %%mm3, %%mm7 \n\t" \
851 "movq %%mm5, %%mm2 \n\t" \
852 "pmaddwd 104(%2), %%mm3 \n\t" \
853 "paddd %%mm7, %%mm4 \n\t" \
854 "paddd %%mm4, %%mm2 \n\t" \
855 "psubd %%mm4, %%mm5 \n\t" \
856 "psrad $" #shift ", %%mm2 \n\t"\
857 "psrad $" #shift ", %%mm5 \n\t"\
858 "movq %%mm6, %%mm4 \n\t" \
859 "paddd %%mm0, %%mm3 \n\t" \
860 "paddd %%mm3, %%mm6 \n\t" \
861 "psubd %%mm3, %%mm4 \n\t" \
862 "psrad $" #shift ", %%mm6 \n\t"\
863 "psrad $" #shift ", %%mm4 \n\t"\
864 "packssdw %%mm2, %%mm2 \n\t" \
865 "packssdw %%mm6, %%mm6 \n\t" \
866 "movd %%mm2, 32+" #dst " \n\t"\
867 "packssdw %%mm4, %%mm4 \n\t" \
868 "packssdw %%mm5, %%mm5 \n\t" \
869 "movd %%mm6, 48+" #dst " \n\t"\
870 "movd %%mm4, 64+" #dst " \n\t"\
871 "movd %%mm5, 80+" #dst " \n\t"
874 IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
875 IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
876 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
877 IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
883 #define IDCT(src0, src4, src1, src5, dst, shift) \
884 "movq " #src0 ", %%mm0 \n\t" \
885 "movq " #src1 ", %%mm2 \n\t" \
886 "movq 16(%2), %%mm4 \n\t" \
887 "pmaddwd %%mm0, %%mm4 \n\t" \
888 "movq 24(%2), %%mm5 \n\t" \
889 "pmaddwd %%mm5, %%mm0 \n\t" \
890 "movq %%mm4, %%mm6 \n\t" \
891 "movq 48(%2), %%mm7 \n\t" \
892 "pmaddwd %%mm2, %%mm7 \n\t" \
893 "movq %%mm0, %%mm5 \n\t" \
894 "movq 64(%2), %%mm3 \n\t"\
895 "pmaddwd %%mm2, %%mm3 \n\t" \
896 "paddd %%mm4, %%mm7 \n\t" \
897 "paddd %%mm4, %%mm4 \n\t" \
898 "psubd %%mm7, %%mm4 \n\t" \
899 "psrad $" #shift ", %%mm7 \n\t"\
900 "psrad $" #shift ", %%mm4 \n\t"\
901 "movq %%mm0, %%mm1 \n\t" \
902 "paddd %%mm3, %%mm0 \n\t" \
903 "psubd %%mm3, %%mm1 \n\t" \
904 "psrad $" #shift ", %%mm0 \n\t"\
905 "psrad $" #shift ", %%mm1 \n\t"\
906 "packssdw %%mm7, %%mm7 \n\t" \
907 "movd %%mm7, " #dst " \n\t"\
908 "packssdw %%mm0, %%mm0 \n\t" \
909 "movd %%mm0, 16+" #dst " \n\t"\
910 "packssdw %%mm1, %%mm1 \n\t" \
911 "movd %%mm1, 96+" #dst " \n\t"\
912 "packssdw %%mm4, %%mm4 \n\t" \
913 "movd %%mm4, 112+" #dst " \n\t"\
914 "movq 80(%2), %%mm4 \n\t" \
915 "pmaddwd %%mm2, %%mm4 \n\t" \
916 "pmaddwd 96(%2), %%mm2 \n\t" \
917 "movq %%mm5, %%mm1 \n\t" \
918 "paddd %%mm4, %%mm1 \n\t" \
919 "psubd %%mm4, %%mm5 \n\t" \
920 "psrad $" #shift ", %%mm1 \n\t"\
921 "psrad $" #shift ", %%mm5 \n\t"\
922 "movq %%mm6, %%mm4 \n\t" \
923 "paddd %%mm2, %%mm6 \n\t" \
924 "psubd %%mm2, %%mm4 \n\t" \
925 "psrad $" #shift ", %%mm6 \n\t"\
926 "psrad $" #shift ", %%mm4 \n\t"\
927 "packssdw %%mm1, %%mm1 \n\t" \
928 "packssdw %%mm6, %%mm6 \n\t" \
929 "movd %%mm1, 32+" #dst " \n\t"\
930 "packssdw %%mm4, %%mm4 \n\t" \
931 "packssdw %%mm5, %%mm5 \n\t" \
932 "movd %%mm6, 48+" #dst " \n\t"\
933 "movd %%mm4, 64+" #dst " \n\t"\
934 "movd %%mm5, 80+" #dst " \n\t"
938 IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
939 IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
940 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
941 IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
947 #define IDCT(src0, src4, src1, src5, dst, shift) \
948 "movq " #src0 ", %%mm0 \n\t" \
949 "movq " #src4 ", %%mm1 \n\t" \
950 "movq 16(%2), %%mm4 \n\t" \
951 "pmaddwd %%mm0, %%mm4 \n\t" \
952 "movq 24(%2), %%mm5 \n\t" \
953 "pmaddwd %%mm5, %%mm0 \n\t" \
954 "movq 32(%2), %%mm5 \n\t" \
955 "pmaddwd %%mm1, %%mm5 \n\t" \
956 "movq 40(%2), %%mm6 \n\t" \
957 "pmaddwd %%mm6, %%mm1 \n\t" \
958 "movq %%mm4, %%mm6 \n\t" \
959 "paddd %%mm5, %%mm4 \n\t" \
960 "psubd %%mm5, %%mm6 \n\t" \
961 "movq %%mm0, %%mm5 \n\t" \
962 "paddd %%mm1, %%mm0 \n\t" \
963 "psubd %%mm1, %%mm5 \n\t" \
964 "movq 8+" #src0 ", %%mm2 \n\t" \
965 "movq 8+" #src4 ", %%mm3 \n\t" \
966 "movq 16(%2), %%mm1 \n\t" \
967 "pmaddwd %%mm2, %%mm1 \n\t" \
968 "movq 24(%2), %%mm7 \n\t" \
969 "pmaddwd %%mm7, %%mm2 \n\t" \
970 "movq 32(%2), %%mm7 \n\t" \
971 "pmaddwd %%mm3, %%mm7 \n\t" \
972 "pmaddwd 40(%2), %%mm3 \n\t" \
973 "paddd %%mm1, %%mm7 \n\t" \
974 "paddd %%mm1, %%mm1 \n\t" \
975 "psubd %%mm7, %%mm1 \n\t" \
976 "paddd %%mm2, %%mm3 \n\t" \
977 "paddd %%mm2, %%mm2 \n\t" \
978 "psubd %%mm3, %%mm2 \n\t" \
979 "psrad $" #shift ", %%mm4 \n\t"\
980 "psrad $" #shift ", %%mm7 \n\t"\
981 "psrad $" #shift ", %%mm3 \n\t"\
982 "packssdw %%mm7, %%mm4 \n\t" \
983 "movq %%mm4, " #dst " \n\t"\
984 "psrad $" #shift ", %%mm0 \n\t"\
985 "packssdw %%mm3, %%mm0 \n\t" \
986 "movq %%mm0, 16+" #dst " \n\t"\
987 "movq %%mm0, 96+" #dst " \n\t"\
988 "movq %%mm4, 112+" #dst " \n\t"\
989 "psrad $" #shift ", %%mm5 \n\t"\
990 "psrad $" #shift ", %%mm6 \n\t"\
991 "psrad $" #shift ", %%mm2 \n\t"\
992 "packssdw %%mm2, %%mm5 \n\t" \
993 "movq %%mm5, 32+" #dst " \n\t"\
994 "psrad $" #shift ", %%mm1 \n\t"\
995 "packssdw %%mm1, %%mm6 \n\t" \
996 "movq %%mm6, 48+" #dst " \n\t"\
997 "movq %%mm6, 64+" #dst " \n\t"\
998 "movq %%mm5, 80+" #dst " \n\t"
1002 IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
1004 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
1009 "
# .p2align 4 \n\t"\
1012 #define IDCT(src0, src4, src1, src5, dst, shift) \
1013 "movq " #src0 ", %%mm0 \n\t" \
1014 "movq " #src4 ", %%mm1 \n\t" \
1015 "movq " #src1 ", %%mm2 \n\t" \
1016 "movq 16(%2), %%mm4 \n\t" \
1017 "pmaddwd %%mm0, %%mm4 \n\t" \
1018 "movq 24(%2), %%mm5 \n\t" \
1019 "pmaddwd %%mm5, %%mm0 \n\t" \
1020 "movq 32(%2), %%mm5 \n\t" \
1021 "pmaddwd %%mm1, %%mm5 \n\t" \
1022 "movq 40(%2), %%mm6 \n\t" \
1023 "pmaddwd %%mm6, %%mm1 \n\t" \
1024 "movq %%mm4, %%mm6 \n\t" \
1025 "movq 48(%2), %%mm7 \n\t" \
1026 "pmaddwd %%mm2, %%mm7 \n\t" \
1027 "paddd %%mm5, %%mm4 \n\t" \
1028 "psubd %%mm5, %%mm6 \n\t" \
1029 "movq %%mm0, %%mm5 \n\t" \
1030 "paddd %%mm1, %%mm0 \n\t" \
1031 "psubd %%mm1, %%mm5 \n\t" \
1032 "movq 64(%2), %%mm1 \n\t"\
1033 "pmaddwd %%mm2, %%mm1 \n\t" \
1034 "paddd %%mm4, %%mm7 \n\t" \
1035 "paddd %%mm4, %%mm4 \n\t" \
1036 "psubd %%mm7, %%mm4 \n\t" \
1037 "psrad $" #shift ", %%mm7 \n\t"\
1038 "psrad $" #shift ", %%mm4 \n\t"\
1039 "movq %%mm0, %%mm3 \n\t" \
1040 "paddd %%mm1, %%mm0 \n\t" \
1041 "psubd %%mm1, %%mm3 \n\t" \
1042 "psrad $" #shift ", %%mm0 \n\t"\
1043 "psrad $" #shift ", %%mm3 \n\t"\
1044 "packssdw %%mm7, %%mm7 \n\t" \
1045 "movd %%mm7, " #dst " \n\t"\
1046 "packssdw %%mm0, %%mm0 \n\t" \
1047 "movd %%mm0, 16+" #dst " \n\t"\
1048 "packssdw %%mm3, %%mm3 \n\t" \
1049 "movd %%mm3, 96+" #dst " \n\t"\
1050 "packssdw %%mm4, %%mm4 \n\t" \
1051 "movd %%mm4, 112+" #dst " \n\t"\
1052 "movq 80(%2), %%mm4 \n\t" \
1053 "pmaddwd %%mm2, %%mm4 \n\t" \
1054 "pmaddwd 96(%2), %%mm2 \n\t" \
1055 "movq %%mm5, %%mm3 \n\t" \
1056 "paddd %%mm4, %%mm3 \n\t" \
1057 "psubd %%mm4, %%mm5 \n\t" \
1058 "psrad $" #shift ", %%mm3 \n\t"\
1059 "psrad $" #shift ", %%mm5 \n\t"\
1060 "movq %%mm6, %%mm4 \n\t" \
1061 "paddd %%mm2, %%mm6 \n\t" \
1062 "psubd %%mm2, %%mm4 \n\t" \
1063 "psrad $" #shift ", %%mm6 \n\t"\
1064 "packssdw %%mm3, %%mm3 \n\t" \
1065 "movd %%mm3, 32+" #dst " \n\t"\
1066 "psrad $" #shift ", %%mm4 \n\t"\
1067 "packssdw %%mm6, %%mm6 \n\t" \
1068 "movd %%mm6, 48+" #dst " \n\t"\
1069 "packssdw %%mm4, %%mm4 \n\t" \
1070 "packssdw %%mm5, %%mm5 \n\t" \
1071 "movd %%mm4, 64+" #dst " \n\t"\
1072 "movd %%mm5, 80+" #dst " \n\t"
1076 IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
1077 IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
1078 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
1079 IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
1086 #define IDCT(src0, src4, src1, src5, dst, shift) \
1087 "movq " #src0 ", %%mm0 \n\t" \
1088 "movq 16(%2), %%mm4 \n\t" \
1089 "pmaddwd %%mm0, %%mm4 \n\t" \
1090 "movq 24(%2), %%mm5 \n\t" \
1091 "pmaddwd %%mm5, %%mm0 \n\t" \
1092 "psrad $" #shift ", %%mm4 \n\t"\
1093 "psrad $" #shift ", %%mm0 \n\t"\
1094 "movq 8+" #src0 ", %%mm2 \n\t" \
1095 "movq 16(%2), %%mm1 \n\t" \
1096 "pmaddwd %%mm2, %%mm1 \n\t" \
1097 "movq 24(%2), %%mm7 \n\t" \
1098 "pmaddwd %%mm7, %%mm2 \n\t" \
1099 "movq 32(%2), %%mm7 \n\t" \
1100 "psrad $" #shift ", %%mm1 \n\t"\
1101 "packssdw %%mm1, %%mm4 \n\t" \
1102 "movq %%mm4, " #dst " \n\t"\
1103 "psrad $" #shift ", %%mm2 \n\t"\
1104 "packssdw %%mm2, %%mm0 \n\t" \
1105 "movq %%mm0, 16+" #dst " \n\t"\
1106 "movq %%mm0, 96+" #dst " \n\t"\
1107 "movq %%mm4, 112+" #dst " \n\t"\
1108 "movq %%mm0, 32+" #dst " \n\t"\
1109 "movq %%mm4, 48+" #dst " \n\t"\
1110 "movq %%mm4, 64+" #dst " \n\t"\
1111 "movq %%mm0, 80+" #dst " \n\t"
1114 IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
1116 IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
1145 ::
"r" (
block),
"r" (temp),
"r" (coeffs)