34 #define OP_AVG(S,D) "pavgb " #S ", " #D " \n\t"
37 #define NORMALIZE_MMX(SHIFT) \
38 "paddw %%mm7, %%mm3 \n\t" \
39 "paddw %%mm7, %%mm4 \n\t" \
40 "psraw "SHIFT", %%mm3 \n\t" \
41 "psraw "SHIFT", %%mm4 \n\t"
43 #define TRANSFER_DO_PACK(OP) \
44 "packuswb %%mm4, %%mm3 \n\t" \
46 "movq %%mm3, (%2) \n\t"
48 #define TRANSFER_DONT_PACK(OP) \
51 "movq %%mm3, 0(%2) \n\t" \
52 "movq %%mm4, 8(%2) \n\t"
55 #define DO_UNPACK(reg) "punpcklbw %%mm0, " reg "\n\t"
56 #define DONT_UNPACK(reg)
59 #define LOAD_ROUNDER_MMX(ROUND) \
60 "movd "ROUND", %%mm7 \n\t" \
61 "punpcklwd %%mm7, %%mm7 \n\t" \
62 "punpckldq %%mm7, %%mm7 \n\t"
64 #define SHIFT2_LINE(OFF, R0,R1,R2,R3) \
65 "paddw %%mm"#R2", %%mm"#R1" \n\t" \
66 "movd (%0,%3), %%mm"#R0" \n\t" \
67 "pmullw %%mm6, %%mm"#R1" \n\t" \
68 "punpcklbw %%mm0, %%mm"#R0" \n\t" \
69 "movd (%0,%2), %%mm"#R3" \n\t" \
70 "psubw %%mm"#R0", %%mm"#R1" \n\t" \
71 "punpcklbw %%mm0, %%mm"#R3" \n\t" \
72 "paddw %%mm7, %%mm"#R1" \n\t" \
73 "psubw %%mm"#R3", %%mm"#R1" \n\t" \
74 "psraw %4, %%mm"#R1" \n\t" \
75 "movq %%mm"#R1", "#OFF"(%1) \n\t" \
81 int rnd, int64_t shift)
84 "mov $3, %%"REG_c
" \n\t"
88 "movd (%0), %%mm2 \n\t"
90 "movd (%0), %%mm3 \n\t"
91 "punpcklbw %%mm0, %%mm2 \n\t"
92 "punpcklbw %%mm0, %%mm3 \n\t"
105 :
"+r"(src),
"+r"(dst)
106 :
"r"(
stride),
"r"(-2*stride),
107 "m"(shift),
"m"(rnd),
"r"(9*stride-4)
116 #define VC1_HOR_16b_SHIFT2(OP, OPNAME)\
117 static void OPNAME ## vc1_hor_16b_shift2_mmx(uint8_t *dst, x86_reg stride,\
118 const int16_t *src, int rnd)\
123 rnd -= (-1+9+9-1)*1024; \
125 LOAD_ROUNDER_MMX("%4")\
126 "movq "MANGLE(ff_pw_128)", %%mm6\n\t"\
127 "movq "MANGLE(ff_pw_9)", %%mm5 \n\t"\
129 "movq 2*0+0(%1), %%mm1 \n\t"\
130 "movq 2*0+8(%1), %%mm2 \n\t"\
131 "movq 2*1+0(%1), %%mm3 \n\t"\
132 "movq 2*1+8(%1), %%mm4 \n\t"\
133 "paddw 2*3+0(%1), %%mm1 \n\t"\
134 "paddw 2*3+8(%1), %%mm2 \n\t"\
135 "paddw 2*2+0(%1), %%mm3 \n\t"\
136 "paddw 2*2+8(%1), %%mm4 \n\t"\
137 "pmullw %%mm5, %%mm3 \n\t"\
138 "pmullw %%mm5, %%mm4 \n\t"\
139 "psubw %%mm1, %%mm3 \n\t"\
140 "psubw %%mm2, %%mm4 \n\t"\
143 "paddw %%mm6, %%mm3 \n\t"\
144 "paddw %%mm6, %%mm4 \n\t"\
145 TRANSFER_DO_PACK(OP)\
150 : "+r"(h), "+r" (src), "+r" (dst)\
151 : "r"(stride), "m"(rnd)\
164 #define VC1_SHIFT2(OP, OPNAME)\
165 static void OPNAME ## vc1_shift2_mmx(uint8_t *dst, const uint8_t *src,\
166 x86_reg stride, int rnd, x86_reg offset)\
170 "mov $8, %%"REG_c" \n\t"\
171 LOAD_ROUNDER_MMX("%5")\
172 "movq "MANGLE(ff_pw_9)", %%mm6\n\t"\
174 "movd 0(%0 ), %%mm3 \n\t"\
175 "movd 4(%0 ), %%mm4 \n\t"\
176 "movd 0(%0,%2), %%mm1 \n\t"\
177 "movd 4(%0,%2), %%mm2 \n\t"\
179 "punpcklbw %%mm0, %%mm3 \n\t"\
180 "punpcklbw %%mm0, %%mm4 \n\t"\
181 "punpcklbw %%mm0, %%mm1 \n\t"\
182 "punpcklbw %%mm0, %%mm2 \n\t"\
183 "paddw %%mm1, %%mm3 \n\t"\
184 "paddw %%mm2, %%mm4 \n\t"\
185 "movd 0(%0,%3), %%mm1 \n\t"\
186 "movd 4(%0,%3), %%mm2 \n\t"\
187 "pmullw %%mm6, %%mm3 \n\t" \
188 "pmullw %%mm6, %%mm4 \n\t" \
189 "punpcklbw %%mm0, %%mm1 \n\t"\
190 "punpcklbw %%mm0, %%mm2 \n\t"\
191 "psubw %%mm1, %%mm3 \n\t" \
192 "psubw %%mm2, %%mm4 \n\t" \
193 "movd 0(%0,%2), %%mm1 \n\t"\
194 "movd 4(%0,%2), %%mm2 \n\t"\
195 "punpcklbw %%mm0, %%mm1 \n\t"\
196 "punpcklbw %%mm0, %%mm2 \n\t"\
197 "psubw %%mm1, %%mm3 \n\t" \
198 "psubw %%mm2, %%mm4 \n\t" \
200 "packuswb %%mm4, %%mm3 \n\t"\
202 "movq %%mm3, (%1) \n\t"\
205 "dec %%"REG_c" \n\t"\
207 : "+r"(src), "+r"(dst)\
208 : "r"(offset), "r"(-2*offset), "g"(stride), "m"(rnd),\
210 : "%"REG_c, "memory"\
215 VC1_SHIFT2(OP_AVG, avg_)
227 #define MSPEL_FILTER13_CORE(UNPACK, MOVQ, A1, A2, A3, A4) \
228 MOVQ "*0+"A1", %%mm1 \n\t" \
229 MOVQ "*4+"A1", %%mm2 \n\t" \
232 "pmullw "MANGLE(ff_pw_3)", %%mm1\n\t" \
233 "pmullw "MANGLE(ff_pw_3)", %%mm2\n\t" \
234 MOVQ "*0+"A2", %%mm3 \n\t" \
235 MOVQ "*4+"A2", %%mm4 \n\t" \
238 "pmullw %%mm6, %%mm3 \n\t" \
239 "pmullw %%mm6, %%mm4 \n\t" \
240 "psubw %%mm1, %%mm3 \n\t" \
241 "psubw %%mm2, %%mm4 \n\t" \
242 MOVQ "*0+"A4", %%mm1 \n\t" \
243 MOVQ "*4+"A4", %%mm2 \n\t" \
246 "psllw $2, %%mm1 \n\t" \
247 "psllw $2, %%mm2 \n\t" \
248 "psubw %%mm1, %%mm3 \n\t" \
249 "psubw %%mm2, %%mm4 \n\t" \
250 MOVQ "*0+"A3", %%mm1 \n\t" \
251 MOVQ "*4+"A3", %%mm2 \n\t" \
254 "pmullw %%mm5, %%mm1 \n\t" \
255 "pmullw %%mm5, %%mm2 \n\t" \
256 "paddw %%mm1, %%mm3 \n\t" \
257 "paddw %%mm2, %%mm4 \n\t"
267 #define MSPEL_FILTER13_VER_16B(NAME, A1, A2, A3, A4) \
269 vc1_put_ver_16b_ ## NAME ## _mmx(int16_t *dst, const uint8_t *src, \
270 x86_reg src_stride, \
271 int rnd, int64_t shift) \
276 LOAD_ROUNDER_MMX("%5") \
277 "movq "MANGLE(ff_pw_53)", %%mm5\n\t" \
278 "movq "MANGLE(ff_pw_18)", %%mm6\n\t" \
281 MSPEL_FILTER13_CORE(DO_UNPACK, "movd 1", A1, A2, A3, A4) \
282 NORMALIZE_MMX("%6") \
283 TRANSFER_DONT_PACK(OP_PUT) \
285 "movd 8+"A1", %%mm1 \n\t" \
287 "movq %%mm1, %%mm3 \n\t" \
288 "paddw %%mm1, %%mm1 \n\t" \
289 "paddw %%mm3, %%mm1 \n\t" \
290 "movd 8+"A2", %%mm3 \n\t" \
292 "pmullw %%mm6, %%mm3 \n\t" \
293 "psubw %%mm1, %%mm3 \n\t" \
294 "movd 8+"A3", %%mm1 \n\t" \
296 "pmullw %%mm5, %%mm1 \n\t" \
297 "paddw %%mm1, %%mm3 \n\t" \
298 "movd 8+"A4", %%mm1 \n\t" \
300 "psllw $2, %%mm1 \n\t" \
301 "psubw %%mm1, %%mm3 \n\t" \
302 "paddw %%mm7, %%mm3 \n\t" \
303 "psraw %6, %%mm3 \n\t" \
304 "movq %%mm3, 16(%2) \n\t" \
309 : "+r"(h), "+r" (src), "+r" (dst) \
310 : "r"(src_stride), "r"(3*src_stride), \
311 "m"(rnd), "m"(shift) \
323 #define MSPEL_FILTER13_HOR_16B(NAME, A1, A2, A3, A4, OP, OPNAME) \
325 OPNAME ## vc1_hor_16b_ ## NAME ## _mmx(uint8_t *dst, x86_reg stride, \
326 const int16_t *src, int rnd) \
330 rnd -= (-4+58+13-3)*256; \
332 LOAD_ROUNDER_MMX("%4") \
333 "movq "MANGLE(ff_pw_18)", %%mm6 \n\t" \
334 "movq "MANGLE(ff_pw_53)", %%mm5 \n\t" \
337 MSPEL_FILTER13_CORE(DONT_UNPACK, "movq 2", A1, A2, A3, A4) \
338 NORMALIZE_MMX("$7") \
340 "paddw "MANGLE(ff_pw_128)", %%mm3 \n\t" \
341 "paddw "MANGLE(ff_pw_128)", %%mm4 \n\t" \
342 TRANSFER_DO_PACK(OP) \
347 : "+r"(h), "+r" (src), "+r" (dst) \
348 : "r"(stride), "m"(rnd) \
361 #define MSPEL_FILTER13_8B(NAME, A1, A2, A3, A4, OP, OPNAME) \
363 OPNAME ## vc1_## NAME ## _mmx(uint8_t *dst, const uint8_t *src, \
364 x86_reg stride, int rnd, x86_reg offset) \
370 LOAD_ROUNDER_MMX("%6") \
371 "movq "MANGLE(ff_pw_53)", %%mm5 \n\t" \
372 "movq "MANGLE(ff_pw_18)", %%mm6 \n\t" \
375 MSPEL_FILTER13_CORE(DO_UNPACK, "movd 1", A1, A2, A3, A4) \
376 NORMALIZE_MMX("$6") \
377 TRANSFER_DO_PACK(OP) \
382 : "+r"(h), "+r" (src), "+r" (dst) \
383 : "r"(offset), "r"(3*offset), "g"(stride), "m"(rnd) \
389 MSPEL_FILTER13_8B (
shift1,
"0(%1,%4 )",
"0(%1,%3,2)",
"0(%1,%3 )",
"0(%1 )",
OP_PUT, put_)
390 MSPEL_FILTER13_8B (
shift1, "0(%1,%4 )", "0(%1,%3,2)", "0(%1,%3 )", "0(%1 )", OP_AVG, avg_)
391 MSPEL_FILTER13_VER_16B(shift1, "0(%1,%4 )", "0(%1,%3,2)", "0(%1,%3 )", "0(%1 )")
392 MSPEL_FILTER13_HOR_16B(shift1, "2*3(%1)", "2*2(%1)", "2*1(%1)", "2*0(%1)",
OP_PUT, put_)
393 MSPEL_FILTER13_HOR_16B(shift1, "2*3(%1)", "2*2(%1)", "2*1(%1)", "2*0(%1)", OP_AVG, avg_)
396 MSPEL_FILTER13_8B (shift3, "0(%1 )", "0(%1,%3 )", "0(%1,%3,2)", "0(%1,%4 )", OP_PUT, put_)
397 MSPEL_FILTER13_8B (shift3, "0(%1 )", "0(%1,%3 )", "0(%1,%3,2)", "0(%1,%4 )", OP_AVG, avg_)
398 MSPEL_FILTER13_VER_16B(shift3, "0(%1 )", "0(%1,%3 )", "0(%1,%3,2)", "0(%1,%4 )")
399 MSPEL_FILTER13_HOR_16B(shift3, "2*0(%1)", "2*1(%1)", "2*2(%1)", "2*3(%1)", OP_PUT, put_)
400 MSPEL_FILTER13_HOR_16B(shift3, "2*0(%1)", "2*1(%1)", "2*2(%1)", "2*3(%1)", OP_AVG, avg_)
402 typedef
void (*vc1_mspel_mc_filter_ver_16bits)(int16_t *dst, const uint8_t *src,
x86_reg src_stride,
int rnd, int64_t shift);
403 typedef
void (*vc1_mspel_mc_filter_hor_16bits)(uint8_t *dst,
x86_reg dst_stride, const int16_t *src,
int rnd);
404 typedef
void (*vc1_mspel_mc_filter_8bits)(uint8_t *dst, const uint8_t *src,
x86_reg stride,
int rnd,
x86_reg offset);
417 #define VC1_MSPEL_MC(OP)\
418 static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,\
419 int hmode, int vmode, int rnd)\
421 static const vc1_mspel_mc_filter_ver_16bits vc1_put_shift_ver_16bits[] =\
422 { NULL, vc1_put_ver_16b_shift1_mmx, vc1_put_ver_16b_shift2_mmx, vc1_put_ver_16b_shift3_mmx };\
423 static const vc1_mspel_mc_filter_hor_16bits vc1_put_shift_hor_16bits[] =\
424 { NULL, OP ## vc1_hor_16b_shift1_mmx, OP ## vc1_hor_16b_shift2_mmx, OP ## vc1_hor_16b_shift3_mmx };\
425 static const vc1_mspel_mc_filter_8bits vc1_put_shift_8bits[] =\
426 { NULL, OP ## vc1_shift1_mmx, OP ## vc1_shift2_mmx, OP ## vc1_shift3_mmx };\
429 "pxor %%mm0, %%mm0 \n\t"\
435 static const int shift_value[] = { 0, 5, 1, 5 };\
436 int shift = (shift_value[hmode]+shift_value[vmode])>>1;\
438 DECLARE_ALIGNED(16, int16_t, tmp)[12*8];\
440 r = (1<<(shift-1)) + rnd-1;\
441 vc1_put_shift_ver_16bits[vmode](tmp, src-1, stride, r, shift);\
443 vc1_put_shift_hor_16bits[hmode](dst, stride, tmp+1, 64-rnd);\
447 vc1_put_shift_8bits[vmode](dst, src, stride, 1-rnd, stride);\
453 vc1_put_shift_8bits[hmode](dst, src, stride, rnd, 1);\
460 #define DECLARE_FUNCTION(a, b) \
461 static void put_vc1_mspel_mc ## a ## b ## _mmx(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
462 put_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
464 static void avg_vc1_mspel_mc ## a ## b ## _mmx2(uint8_t *dst, const uint8_t *src, int stride, int rnd) { \
465 avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
469 DECLARE_FUNCTION(0, 2)
470 DECLARE_FUNCTION(0, 3)
472 DECLARE_FUNCTION(1, 0)
473 DECLARE_FUNCTION(1, 1)
474 DECLARE_FUNCTION(1, 2)
475 DECLARE_FUNCTION(1, 3)
477 DECLARE_FUNCTION(2, 0)
478 DECLARE_FUNCTION(2, 1)
479 DECLARE_FUNCTION(2, 2)
480 DECLARE_FUNCTION(2, 3)
482 DECLARE_FUNCTION(3, 0)
483 DECLARE_FUNCTION(3, 1)
484 DECLARE_FUNCTION(3, 2)
485 DECLARE_FUNCTION(3, 3)
487 static
void vc1_inv_trans_4x4_dc_mmx2(uint8_t *dest,
int linesize,
DCTELEM *
block)
490 dc = (17 * dc + 4) >> 3;
491 dc = (17 * dc + 64) >> 7;
493 "movd %0, %%mm0 \n\t"
494 "pshufw $0, %%mm0, %%mm0 \n\t"
495 "pxor %%mm1, %%mm1 \n\t"
496 "psubw %%mm0, %%mm1 \n\t"
497 "packuswb %%mm0, %%mm0 \n\t"
498 "packuswb %%mm1, %%mm1 \n\t"
502 "movd %0, %%mm2 \n\t"
503 "movd %1, %%mm3 \n\t"
504 "movd %2, %%mm4 \n\t"
505 "movd %3, %%mm5 \n\t"
506 "paddusb %%mm0, %%mm2 \n\t"
507 "paddusb %%mm0, %%mm3 \n\t"
508 "paddusb %%mm0, %%mm4 \n\t"
509 "paddusb %%mm0, %%mm5 \n\t"
510 "psubusb %%mm1, %%mm2 \n\t"
511 "psubusb %%mm1, %%mm3 \n\t"
512 "psubusb %%mm1, %%mm4 \n\t"
513 "psubusb %%mm1, %%mm5 \n\t"
514 "movd %%mm2, %0 \n\t"
515 "movd %%mm3, %1 \n\t"
516 "movd %%mm4, %2 \n\t"
517 "movd %%mm5, %3 \n\t"
518 :
"+m"(*(uint32_t*)(dest+0*linesize)),
519 "+m"(*(uint32_t*)(dest+1*linesize)),
520 "+m"(*(uint32_t*)(dest+2*linesize)),
521 "+m"(*(uint32_t*)(dest+3*linesize))
528 dc = (17 * dc + 4) >> 3;
529 dc = (12 * dc + 64) >> 7;
531 "movd %0, %%mm0 \n\t"
532 "pshufw $0, %%mm0, %%mm0 \n\t"
533 "pxor %%mm1, %%mm1 \n\t"
534 "psubw %%mm0, %%mm1 \n\t"
535 "packuswb %%mm0, %%mm0 \n\t"
536 "packuswb %%mm1, %%mm1 \n\t"
540 "movd %0, %%mm2 \n\t"
541 "movd %1, %%mm3 \n\t"
542 "movd %2, %%mm4 \n\t"
543 "movd %3, %%mm5 \n\t"
544 "paddusb %%mm0, %%mm2 \n\t"
545 "paddusb %%mm0, %%mm3 \n\t"
546 "paddusb %%mm0, %%mm4 \n\t"
547 "paddusb %%mm0, %%mm5 \n\t"
548 "psubusb %%mm1, %%mm2 \n\t"
549 "psubusb %%mm1, %%mm3 \n\t"
550 "psubusb %%mm1, %%mm4 \n\t"
551 "psubusb %%mm1, %%mm5 \n\t"
552 "movd %%mm2, %0 \n\t"
553 "movd %%mm3, %1 \n\t"
554 "movd %%mm4, %2 \n\t"
555 "movd %%mm5, %3 \n\t"
556 :
"+m"(*(uint32_t*)(dest+0*linesize)),
557 "+m"(*(uint32_t*)(dest+1*linesize)),
558 "+m"(*(uint32_t*)(dest+2*linesize)),
559 "+m"(*(uint32_t*)(dest+3*linesize))
563 "movd %0, %%mm2 \n\t"
564 "movd %1, %%mm3 \n\t"
565 "movd %2, %%mm4 \n\t"
566 "movd %3, %%mm5 \n\t"
567 "paddusb %%mm0, %%mm2 \n\t"
568 "paddusb %%mm0, %%mm3 \n\t"
569 "paddusb %%mm0, %%mm4 \n\t"
570 "paddusb %%mm0, %%mm5 \n\t"
571 "psubusb %%mm1, %%mm2 \n\t"
572 "psubusb %%mm1, %%mm3 \n\t"
573 "psubusb %%mm1, %%mm4 \n\t"
574 "psubusb %%mm1, %%mm5 \n\t"
575 "movd %%mm2, %0 \n\t"
576 "movd %%mm3, %1 \n\t"
577 "movd %%mm4, %2 \n\t"
578 "movd %%mm5, %3 \n\t"
579 :
"+m"(*(uint32_t*)(dest+0*linesize)),
580 "+m"(*(uint32_t*)(dest+1*linesize)),
581 "+m"(*(uint32_t*)(dest+2*linesize)),
582 "+m"(*(uint32_t*)(dest+3*linesize))
589 dc = ( 3 * dc + 1) >> 1;
590 dc = (17 * dc + 64) >> 7;
592 "movd %0, %%mm0 \n\t"
593 "pshufw $0, %%mm0, %%mm0 \n\t"
594 "pxor %%mm1, %%mm1 \n\t"
595 "psubw %%mm0, %%mm1 \n\t"
596 "packuswb %%mm0, %%mm0 \n\t"
597 "packuswb %%mm1, %%mm1 \n\t"
601 "movq %0, %%mm2 \n\t"
602 "movq %1, %%mm3 \n\t"
603 "movq %2, %%mm4 \n\t"
604 "movq %3, %%mm5 \n\t"
605 "paddusb %%mm0, %%mm2 \n\t"
606 "paddusb %%mm0, %%mm3 \n\t"
607 "paddusb %%mm0, %%mm4 \n\t"
608 "paddusb %%mm0, %%mm5 \n\t"
609 "psubusb %%mm1, %%mm2 \n\t"
610 "psubusb %%mm1, %%mm3 \n\t"
611 "psubusb %%mm1, %%mm4 \n\t"
612 "psubusb %%mm1, %%mm5 \n\t"
613 "movq %%mm2, %0 \n\t"
614 "movq %%mm3, %1 \n\t"
615 "movq %%mm4, %2 \n\t"
616 "movq %%mm5, %3 \n\t"
617 :
"+m"(*(uint32_t*)(dest+0*linesize)),
618 "+m"(*(uint32_t*)(dest+1*linesize)),
619 "+m"(*(uint32_t*)(dest+2*linesize)),
620 "+m"(*(uint32_t*)(dest+3*linesize))
627 dc = (3 * dc + 1) >> 1;
628 dc = (3 * dc + 16) >> 5;
630 "movd %0, %%mm0 \n\t"
631 "pshufw $0, %%mm0, %%mm0 \n\t"
632 "pxor %%mm1, %%mm1 \n\t"
633 "psubw %%mm0, %%mm1 \n\t"
634 "packuswb %%mm0, %%mm0 \n\t"
635 "packuswb %%mm1, %%mm1 \n\t"
639 "movq %0, %%mm2 \n\t"
640 "movq %1, %%mm3 \n\t"
641 "movq %2, %%mm4 \n\t"
642 "movq %3, %%mm5 \n\t"
643 "paddusb %%mm0, %%mm2 \n\t"
644 "paddusb %%mm0, %%mm3 \n\t"
645 "paddusb %%mm0, %%mm4 \n\t"
646 "paddusb %%mm0, %%mm5 \n\t"
647 "psubusb %%mm1, %%mm2 \n\t"
648 "psubusb %%mm1, %%mm3 \n\t"
649 "psubusb %%mm1, %%mm4 \n\t"
650 "psubusb %%mm1, %%mm5 \n\t"
651 "movq %%mm2, %0 \n\t"
652 "movq %%mm3, %1 \n\t"
653 "movq %%mm4, %2 \n\t"
654 "movq %%mm5, %3 \n\t"
655 :
"+m"(*(uint32_t*)(dest+0*linesize)),
656 "+m"(*(uint32_t*)(dest+1*linesize)),
657 "+m"(*(uint32_t*)(dest+2*linesize)),
658 "+m"(*(uint32_t*)(dest+3*linesize))
662 "movq %0, %%mm2 \n\t"
663 "movq %1, %%mm3 \n\t"
664 "movq %2, %%mm4 \n\t"
665 "movq %3, %%mm5 \n\t"
666 "paddusb %%mm0, %%mm2 \n\t"
667 "paddusb %%mm0, %%mm3 \n\t"
668 "paddusb %%mm0, %%mm4 \n\t"
669 "paddusb %%mm0, %%mm5 \n\t"
670 "psubusb %%mm1, %%mm2 \n\t"
671 "psubusb %%mm1, %%mm3 \n\t"
672 "psubusb %%mm1, %%mm4 \n\t"
673 "psubusb %%mm1, %%mm5 \n\t"
674 "movq %%mm2, %0 \n\t"
675 "movq %%mm3, %1 \n\t"
676 "movq %%mm4, %2 \n\t"
677 "movq %%mm5, %3 \n\t"
678 :
"+m"(*(uint32_t*)(dest+0*linesize)),
679 "+m"(*(uint32_t*)(dest+1*linesize)),
680 "+m"(*(uint32_t*)(dest+2*linesize)),
681 "+m"(*(uint32_t*)(dest+3*linesize))
685 #define LOOP_FILTER(EXT) \
686 void ff_vc1_v_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \
687 void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \
688 void ff_vc1_v_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \
689 void ff_vc1_h_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \
691 static void vc1_v_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \
693 ff_vc1_v_loop_filter8_ ## EXT(src, stride, pq); \
694 ff_vc1_v_loop_filter8_ ## EXT(src+8, stride, pq); \
697 static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \
699 ff_vc1_h_loop_filter8_ ## EXT(src, stride, pq); \
700 ff_vc1_h_loop_filter8_ ## EXT(src+8*stride, stride, pq); \
709 void ff_vc1_h_loop_filter8_sse4(uint8_t *src,
int stride,
int pq);
711 static
void vc1_h_loop_filter16_sse4(uint8_t *src,
int stride,
int pq)
713 ff_vc1_h_loop_filter8_sse4(src, stride, pq);
714 ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq);
720 int stride,
int h,
int x,
int y);
722 int stride,
int h,
int x,
int y);
724 int stride,
int h,
int x,
int y);
726 int stride,
int h,
int x,
int y);
728 int stride,
int h,
int x,
int y);
783 #define ASSIGN_LF(EXT) \
784 dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_ ## EXT; \
785 dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_ ## EXT; \
786 dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_ ## EXT; \
787 dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_ ## EXT; \
788 dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \
789 dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_ ## EXT
792 if (mm_flags & AV_CPU_FLAG_MMX) {
797 if (mm_flags & AV_CPU_FLAG_MMX2) {