"pand " #pplx ", " #ppsx "			\n\t"\ "pand " #ppsx ", " #t1 "			\n\t"\
"pand " #ppsx ", " #pplx "			\n\t"\
static inline void dering(uint8_t src[], int stride, int QP){#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)	asm volatile(		"movq pQPb, %%mm0				\n\t"		"paddusb %%mm0, %%mm0				\n\t"		"movq %%mm0, pQPb2				\n\t"		"leal (%0, %1), %%eax				\n\t"		"leal (%%eax, %1, 4), %%ebx			\n\t"//	0	1	2	3	4	5	6	7	8	9//	%0	eax	eax+%1	eax+2%1	%0+4%1	ebx	ebx+%1	ebx+2%1	%0+8%1	ebx+4%1		"pcmpeqb %%mm6, %%mm6				\n\t"		"pxor %%mm7, %%mm7				\n\t"#ifdef HAVE_MMX2#define FIND_MIN_MAX(addr)\		"movq " #addr ", %%mm0				\n\t"\		"pminub %%mm0, %%mm6				\n\t"\		"pmaxub %%mm0, %%mm7				\n\t"#else#define FIND_MIN_MAX(addr)\		"movq " #addr ", %%mm0				\n\t"\		"movq %%mm6, %%mm1				\n\t"\		"psubusb %%mm0, %%mm7				\n\t"\		"paddb %%mm0, %%mm7				\n\t"\		"psubusb %%mm0, %%mm1				\n\t"\		"psubb %%mm1, %%mm6				\n\t"#endifFIND_MIN_MAX((%%eax))FIND_MIN_MAX((%%eax, %1))FIND_MIN_MAX((%%eax, %1, 2))FIND_MIN_MAX((%0, %1, 4))FIND_MIN_MAX((%%ebx))FIND_MIN_MAX((%%ebx, %1))FIND_MIN_MAX((%%ebx, %1, 2))FIND_MIN_MAX((%0, %1, 8))		"movq %%mm6, %%mm4				\n\t"		"psrlq $8, %%mm6				\n\t"#ifdef HAVE_MMX2		"pminub %%mm4, %%mm6				\n\t" // min of pixels		"pshufw $0xF9, %%mm6, %%mm4			\n\t"		"pminub %%mm4, %%mm6				\n\t" // min of pixels		"pshufw $0xFE, %%mm6, %%mm4			\n\t"		"pminub %%mm4, %%mm6				\n\t"#else		"movq %%mm6, %%mm1				\n\t"		"psubusb %%mm4, %%mm1				\n\t"		"psubb %%mm1, %%mm6				\n\t"		"movq %%mm6, %%mm4				\n\t"		"psrlq $16, %%mm6				\n\t"		"movq %%mm6, %%mm1				\n\t"		"psubusb %%mm4, %%mm1				\n\t"		"psubb %%mm1, %%mm6				\n\t"		"movq %%mm6, %%mm4				\n\t"		"psrlq $32, %%mm6				\n\t"		"movq %%mm6, %%mm1				\n\t"		"psubusb %%mm4, %%mm1				\n\t"		"psubb %%mm1, %%mm6				\n\t"#endif		"movq %%mm7, %%mm4				\n\t"		"psrlq $8, %%mm7				\n\t"#ifdef HAVE_MMX2		"pmaxub %%mm4, %%mm7				\n\t" // max of pixels		"pshufw $0xF9, %%mm7, %%mm4			\n\t"		"pmaxub %%mm4, %%mm7				\n\t"		"pshufw $0xFE, %%mm7, %%mm4			\n\t"		"pmaxub %%mm4, %%mm7				\n\t"#else		"psubusb %%mm4, %%mm7				\n\t"		"paddb %%mm4, %%mm7				\n\t"		"movq %%mm7, %%mm4				\n\t"		"psrlq $16, %%mm7				\n\t"		"psubusb %%mm4, %%mm7				\n\t"		"paddb %%mm4, %%mm7				\n\t"		"movq %%mm7, %%mm4				\n\t"		"psrlq $32, %%mm7				\n\t"		"psubusb %%mm4, %%mm7				\n\t"		"paddb %%mm4, %%mm7				\n\t"#endif		PAVGB(%%mm6, %%mm7)				      // a=(max + min)/2		"punpcklbw %%mm7, %%mm7				\n\t"		"punpcklbw %%mm7, %%mm7				\n\t"		"punpcklbw %%mm7, %%mm7				\n\t"		"movq %%mm7, temp0				\n\t"		"movq (%0), %%mm0				\n\t" // L10		"movq %%mm0, %%mm1				\n\t" // L10		"movq %%mm0, %%mm2				\n\t" // L10		"psllq $8, %%mm1				\n\t"		"psrlq $8, %%mm2				\n\t"		"movd -4(%0), %%mm3				\n\t"		"movd 8(%0), %%mm4				\n\t"		"psrlq $24, %%mm3				\n\t"		"psllq $56, %%mm4				\n\t"		"por %%mm3, %%mm1				\n\t" // L00		"por %%mm4, %%mm2				\n\t" // L20		"movq %%mm1, %%mm3				\n\t" // L00		PAVGB(%%mm2, %%mm1)				      // (L20 + L00)/2		PAVGB(%%mm0, %%mm1)				      // (L20 + L00 + 2L10)/4		"psubusb %%mm7, %%mm0				\n\t"		"psubusb %%mm7, %%mm2				\n\t"		"psubusb %%mm7, %%mm3				\n\t"		"pcmpeqb b00, %%mm0				\n\t" // L10 > a ? 0 : -1		"pcmpeqb b00, %%mm2				\n\t" // L20 > a ? 0 : -1		"pcmpeqb b00, %%mm3				\n\t" // L00 > a ? 0 : -1		"paddb %%mm2, %%mm0				\n\t"		"paddb %%mm3, %%mm0				\n\t"		"movq (%%eax), %%mm2				\n\t" // L11		"movq %%mm2, %%mm3				\n\t" // L11		"movq %%mm2, %%mm4				\n\t" // L11		"psllq $8, %%mm3				\n\t"		"psrlq $8, %%mm4				\n\t"		"movd -4(%%eax), %%mm5				\n\t"		"movd 8(%%eax), %%mm6				\n\t"		"psrlq $24, %%mm5				\n\t"		"psllq $56, %%mm6				\n\t"		"por %%mm5, %%mm3				\n\t" // L01		"por %%mm6, %%mm4				\n\t" // L21		"movq %%mm3, %%mm5				\n\t" // L01		PAVGB(%%mm4, %%mm3)				      // (L21 + L01)/2		PAVGB(%%mm2, %%mm3)				      // (L21 + L01 + 2L11)/4		"psubusb %%mm7, %%mm2				\n\t"		"psubusb %%mm7, %%mm4				\n\t"		"psubusb %%mm7, %%mm5				\n\t"		"pcmpeqb b00, %%mm2				\n\t" // L11 > a ? 0 : -1		"pcmpeqb b00, %%mm4				\n\t" // L21 > a ? 0 : -1		"pcmpeqb b00, %%mm5				\n\t" // L01 > a ? 0 : -1		"paddb %%mm4, %%mm2				\n\t"		"paddb %%mm5, %%mm2				\n\t"// 0, 2, 3, 1#define DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \		"movq " #src ", " #sx "				\n\t" /* src[0] */\		"movq " #sx ", " #lx "				\n\t" /* src[0] */\		"movq " #sx ", " #t0 "				\n\t" /* src[0] */\		"psllq $8, " #lx "				\n\t"\		"psrlq $8, " #t0 "				\n\t"\		"movd -4" #src ", " #t1 "			\n\t"\		"psrlq $24, " #t1 "				\n\t"\		"por " #t1 ", " #lx "				\n\t" /* src[-1] */\		"movd 8" #src ", " #t1 "			\n\t"\		"psllq $56, " #t1 "				\n\t"\		"por " #t1 ", " #t0 "				\n\t" /* src[+1] */\		"movq " #lx ", " #t1 "				\n\t" /* src[-1] */\		PAVGB(t0, lx)				              /* (src[-1] + src[+1])/2 */\		PAVGB(sx, lx)				      /* (src[-1] + 2src[0] + src[+1])/4 */\		"psubusb temp0, " #t1 "				\n\t"\		"psubusb temp0, " #t0 "				\n\t"\		"psubusb temp0, " #sx "				\n\t"\		"pcmpeqb b00, " #t1 "				\n\t" /* src[-1] > a ? 0 : -1*/\		"pcmpeqb b00, " #t0 "				\n\t" /* src[+1] > a ? 0 : -1*/\		"pcmpeqb b00, " #sx "				\n\t" /* src[0]  > a ? 0 : -1*/\		"paddb " #t1 ", " #t0 "				\n\t"\		"paddb " #t0 ", " #sx "				\n\t"\\		PAVGB(lx, pplx)					     \		PAVGB(plx, pplx)				      /* filtered */\		"movq " #dst ", " #t0 "				\n\t" /* dst */\		"movq " #pplx ", " #t1 "			\n\t"\		"psubusb " #t0 ", " #pplx "			\n\t"\		"psubusb " #t1 ", " #t0 "			\n\t"\		"por " #t0 ", " #pplx "				\n\t" /* |filtered - dst| */\		"psubusb pQPb2, " #pplx "			\n\t"\		"pcmpeqb b00, " #pplx "				\n\t"\		"paddb " #sx ", " #ppsx "			\n\t"\		"paddb " #psx ", " #ppsx "			\n\t"\	"#paddb b02, " #ppsx "				\n\t"\		"pand b08, " #ppsx "				\n\t"\		"pcmpeqb b00, " #ppsx "				\n\t"\		"pand " #pplx ", " #ppsx "			\n\t"\		"pand " #ppsx ", " #t1 "			\n\t"\		"pandn " #dst ", " #ppsx "			\n\t"\		"por " #t1 ", " #ppsx "				\n\t"\		"movq " #ppsx ", " #dst "			\n\t"/*0000000111111111111101111101111110011110111111010111100111110001110111*///DERING_CORE(dst,src                  ,ppsx ,psx  ,sx   ,pplx ,plx  ,lx   ,t0   ,t1)DERING_CORE((%%eax),(%%eax, %1)        ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)DERING_CORE((%%eax, %1),(%%eax, %1, 2) ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)DERING_CORE((%%eax, %1, 2),(%0, %1, 4) ,%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7)DERING_CORE((%0, %1, 4),(%%ebx)        ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)DERING_CORE((%%ebx),(%%ebx, %1)        ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)DERING_CORE((%%ebx, %1), (%%ebx, %1, 2),%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7)DERING_CORE((%%ebx, %1, 2),(%0, %1, 8) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)DERING_CORE((%0, %1, 8),(%%ebx, %1, 4) ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)		: : "r" (src), "r" (stride), "r" (QP)		: "%eax", "%ebx"	);#else//FIXME#endif}