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