"paddsb (%3, %%ecx, 8), %%mm4			\n\t"\
"paddsb (%2, %%ecx, 8), %%mm4			\n\t"\
static inline void horizX1Filter(uint8_t *src, int stride, int QP){	int y;	static uint64_t *lut= NULL;	if(lut==NULL)	{		int i;		lut= (uint64_t*)memalign(8, 256*8);		for(i=0; i<256; i++)		{			int v= i < 128 ? 2*i : 2*(i-256);/*//Simulate 112242211 9-Tap filter			uint64_t a= (v/16) & 0xFF;			uint64_t b= (v/8) & 0xFF;			uint64_t c= (v/4) & 0xFF;			uint64_t d= (3*v/8) & 0xFF;*///Simulate piecewise linear interpolation			uint64_t a= (v/16) & 0xFF;			uint64_t b= (v*3/16) & 0xFF;			uint64_t c= (v*5/16) & 0xFF;			uint64_t d= (7*v/16) & 0xFF;			uint64_t A= (0x100 - a)&0xFF;			uint64_t B= (0x100 - b)&0xFF;			uint64_t C= (0x100 - c)&0xFF;			uint64_t D= (0x100 - c)&0xFF;			lut[i]   = (a<<56) | (b<<48) | (c<<40) | (d<<32) |				(D<<24) | (C<<16) | (B<<8) | (A);			//lut[i] = (v<<32) | (v<<24);		}	}#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)	asm volatile(		"pxor %%mm7, %%mm7				\n\t" // 0//		"movq b80, %%mm6				\n\t" // MIN_SIGNED_BYTE		"leal (%0, %1), %%eax				\n\t"		"leal (%%eax, %1, 4), %%ebx			\n\t"		"movq b80, %%mm6				\n\t"		"movd %2, %%mm5					\n\t" // QP		"movq %%mm5, %%mm4				\n\t"		"paddusb %%mm5, %%mm5				\n\t" // 2QP		"paddusb %%mm5, %%mm4				\n\t" // 3QP		"pxor %%mm5, %%mm5				\n\t" // 0		"psubb %%mm4, %%mm5				\n\t" // -3QP		"por bm11111110, %%mm5				\n\t" // ...,FF,FF,-3QP		"psllq $24, %%mm5				\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#define HX1old(a) \		"movd " #a ", %%mm0				\n\t"\		"movd 4" #a ", %%mm1				\n\t"\		"punpckldq %%mm1, %%mm0				\n\t"\		"movq %%mm0, %%mm1				\n\t"\		"movq %%mm0, %%mm2				\n\t"\		"psrlq $8, %%mm1				\n\t"\		"psubusb %%mm1, %%mm2				\n\t"\		"psubusb %%mm0, %%mm1				\n\t"\		"por %%mm2, %%mm1				\n\t" /* px = |px - p(x+1)| */\		"pcmpeqb %%mm7, %%mm2				\n\t" /* px = sgn[px - p(x+1)] */\		"pshufw $0x00, %%mm1, %%mm3			\n\t" /* p5 = |p1 - p2| */\		PAVGB(%%mm1, %%mm3)				      /* p5 = (|p2-p1| + |p6-p5|)/2 */\		"psrlq $16, %%mm3				\n\t" /* p3 = (|p2-p1| + |p6-p5|)/2 */\		"psubusb %%mm3, %%mm1			\n\t" /* |p3-p4|-(|p2-p1| + |p6-p5|)/2 */\		"paddb %%mm5, %%mm1				\n\t"\		"psubusb %%mm5, %%mm1				\n\t"\		PAVGB(%%mm7, %%mm1)\		"pxor %%mm2, %%mm1				\n\t"\		"psubb %%mm2, %%mm1				\n\t"\		"psrlq $24, %%mm1				\n\t"\		"movd %%mm1, %%ecx				\n\t"\		"paddb %%mm6, %%mm0				\n\t"\		"paddsb (%3, %%ecx, 8), %%mm0			\n\t"\		"paddb %%mm6, %%mm0				\n\t"\		"movq %%mm0, " #a "				\n\t"\/*HX1old((%0))HX1old((%%eax))HX1old((%%eax, %1))HX1old((%%eax, %1, 2))HX1old((%0, %1, 4))HX1old((%%ebx))HX1old((%%ebx, %1))HX1old((%%ebx, %1, 2))*///FIXME add some comments, its unreadable ...#define HX1b(a, c, b, d) \		"movd " #a ", %%mm0				\n\t"\		"movd 4" #a ", %%mm1				\n\t"\		"punpckldq %%mm1, %%mm0				\n\t"\		"movd " #b ", %%mm4				\n\t"\		"movq %%mm0, %%mm1				\n\t"\		"movq %%mm0, %%mm2				\n\t"\		"psrlq $8, %%mm1				\n\t"\		"movd 4" #b ", %%mm3				\n\t"\		"psubusb %%mm1, %%mm2				\n\t"\		"psubusb %%mm0, %%mm1				\n\t"\		"por %%mm2, %%mm1				\n\t" /* px = |px - p(x+1)| */\		"pcmpeqb %%mm7, %%mm2				\n\t" /* px = sgn[px - p(x+1)] */\		"punpckldq %%mm3, %%mm4				\n\t"\		"movq %%mm1, %%mm3				\n\t"\		"psllq $32, %%mm3				\n\t" /* p5 = |p1 - p2| */\		PAVGB(%%mm1, %%mm3)				      /* p5 = (|p2-p1| + |p6-p5|)/2 */\		"paddb %%mm6, %%mm0				\n\t"\		"psrlq $16, %%mm3				\n\t" /* p3 = (|p2-p1| + |p6-p5|)/2 */\		"psubusb %%mm3, %%mm1			\n\t" /* |p3-p4|-(|p2-p1| + |p6-p5|)/2 */\		"movq %%mm4, %%mm3				\n\t"\		"paddb %%mm5, %%mm1				\n\t"\		"psubusb %%mm5, %%mm1				\n\t"\		"psrlq $8, %%mm3				\n\t"\		PAVGB(%%mm7, %%mm1)\		"pxor %%mm2, %%mm1				\n\t"\		"psubb %%mm2, %%mm1				\n\t"\		"movq %%mm4, %%mm2				\n\t"\		"psrlq $24, %%mm1				\n\t"\		"psubusb %%mm3, %%mm2				\n\t"\		"movd %%mm1, %%ecx				\n\t"\		"psubusb %%mm4, %%mm3				\n\t"\		"paddsb (%3, %%ecx, 8), %%mm0			\n\t"\		"por %%mm2, %%mm3				\n\t" /* px = |px - p(x+1)| */\		"paddb %%mm6, %%mm0				\n\t"\		"pcmpeqb %%mm7, %%mm2				\n\t" /* px = sgn[px - p(x+1)] */\		"movq %%mm3, %%mm1				\n\t"\		"psllq $32, %%mm1				\n\t" /* p5 = |p1 - p2| */\		"movq %%mm0, " #a "				\n\t"\		PAVGB(%%mm3, %%mm1)				      /* p5 = (|p2-p1| + |p6-p5|)/2 */\		"paddb %%mm6, %%mm4				\n\t"\		"psrlq $16, %%mm1				\n\t" /* p3 = (|p2-p1| + |p6-p5|)/2 */\		"psubusb %%mm1, %%mm3			\n\t" /* |p3-p4|-(|p2-p1| + |p6-p5|)/2 */\		"paddb %%mm5, %%mm3				\n\t"\		"psubusb %%mm5, %%mm3				\n\t"\		PAVGB(%%mm7, %%mm3)\		"pxor %%mm2, %%mm3				\n\t"\		"psubb %%mm2, %%mm3				\n\t"\		"psrlq $24, %%mm3				\n\t"\		"movd " #c ", %%mm0				\n\t"\		"movd 4" #c ", %%mm1				\n\t"\		"punpckldq %%mm1, %%mm0				\n\t"\		"paddb %%mm6, %%mm0				\n\t"\		"paddsb (%3, %%ecx, 8), %%mm0			\n\t"\		"paddb %%mm6, %%mm0				\n\t"\		"movq %%mm0, " #c "				\n\t"\		"movd %%mm3, %%ecx				\n\t"\		"movd " #d ", %%mm0				\n\t"\		"paddsb (%3, %%ecx, 8), %%mm4			\n\t"\		"movd 4" #d ", %%mm1				\n\t"\		"paddb %%mm6, %%mm4				\n\t"\		"punpckldq %%mm1, %%mm0				\n\t"\		"movq %%mm4, " #b "				\n\t"\		"paddb %%mm6, %%mm0				\n\t"\		"paddsb (%3, %%ecx, 8), %%mm0			\n\t"\		"paddb %%mm6, %%mm0				\n\t"\		"movq %%mm0, " #d "				\n\t"\HX1b((%0),(%%eax),(%%eax, %1),(%%eax, %1, 2))HX1b((%0, %1, 4),(%%ebx),(%%ebx, %1),(%%ebx, %1, 2))		:		: "r" (src), "r" (stride), "r" (QP), "r" (lut)		: "%eax", "%ebx", "%ecx"	);#else//FIXME (has little in common with the mmx2 version)	for(y=0; y<BLOCK_SIZE; y++)	{		int a= src[1] - src[2];		int b= src[3] - src[4];		int c= src[5] - src[6];		int d= MAX(ABS(b) - (ABS(a) + ABS(c))/2, 0);		if(d < QP)		{			int v = d * SIGN(-b);			src[1] +=v/8;			src[2] +=v/4;			src[3] +=3*v/8;			src[4] -=3*v/8;			src[5] -=v/4;			src[6] -=v/8;		}		src+=stride;	}#endif}