const int middleEnergy= 5*(src[4] - src[5]) + 2*(src[2] - src[5]);
static inline void doHorizDefFilterAndCopyBack(uint8_t dst[], int stride, int QP){#ifdef HAVE_MMX	asm volatile(		"pushl %0					\n\t"		"pxor %%mm7, %%mm7				\n\t"		"movq bm00001000, %%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		"psllq $24, %%mm4				\n\t"		"pxor %%mm5, %%mm5				\n\t" // 0		"psubb %%mm4, %%mm5				\n\t" // -QP		"leal tempBlock, %%eax				\n\t"//FIXME? "unroll by 2" and mix#ifdef HAVE_MMX2#define HDF(i)	\		"movq " #i "(%%eax), %%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| */\		"pminub %%mm1, %%mm3				\n\t" /* p5 = min(|p2-p1|, |p6-p5|)*/\		"psrlq $16, %%mm3				\n\t" /* p3 = min(|p2-p1|, |p6-p5|)*/\		"psubusb %%mm3, %%mm1			\n\t" /* |p3-p4|-min(|p1-p2|,|p5-p6|) */\		"paddb %%mm5, %%mm1				\n\t"\		"psubusb %%mm5, %%mm1				\n\t"\		"psrlw $2, %%mm1				\n\t"\		"pxor %%mm2, %%mm1				\n\t"\		"psubb %%mm2, %%mm1				\n\t"\		"pand %%mm6, %%mm1				\n\t"\		"psubb %%mm1, %%mm0				\n\t"\		"psllq $8, %%mm1				\n\t"\		"paddb %%mm1, %%mm0				\n\t"\		"movd %%mm0, (%0)				\n\t"\		"psrlq $32, %%mm0				\n\t"\		"movd %%mm0, 4(%0)				\n\t"#else#define HDF(i)\		"movq " #i "(%%eax), %%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)] */\		"movq %%mm1, %%mm3				\n\t"\		"psllq $32, %%mm3				\n\t"\		"movq %%mm3, %%mm4				\n\t"\		"psubusb %%mm1, %%mm4				\n\t"\		"psubb %%mm4, %%mm3				\n\t"\		"psrlq $16, %%mm3				\n\t" /* p3 = min(|p2-p1|, |p6-p5|)*/\		"psubusb %%mm3, %%mm1			\n\t" /* |p3-p4|-min(|p1-p2|,|p5,6|) */\		"paddb %%mm5, %%mm1				\n\t"\		"psubusb %%mm5, %%mm1				\n\t"\		"psrlw $2, %%mm1				\n\t"\		"pxor %%mm2, %%mm1				\n\t"\		"psubb %%mm2, %%mm1				\n\t"\		"pand %%mm6, %%mm1				\n\t"\		"psubb %%mm1, %%mm0				\n\t"\		"psllq $8, %%mm1				\n\t"\		"paddb %%mm1, %%mm0				\n\t"\		"movd %%mm0, (%0)				\n\t"\		"psrlq $32, %%mm0				\n\t"\		"movd %%mm0, 4(%0)				\n\t"#endif		HDF(0)		"addl %1, %0					\n\t"		HDF(8)		"addl %1, %0					\n\t"		HDF(16)		"addl %1, %0					\n\t"		HDF(24)		"addl %1, %0					\n\t"		HDF(32)		"addl %1, %0					\n\t"		HDF(40)		"addl %1, %0					\n\t"		HDF(48)		"addl %1, %0					\n\t"		HDF(56)		"popl %0					\n\t"		:		: "r" (dst), "r" (stride), "r" (QP)		: "%eax"	);#else	uint8_t *src= tempBlock;	int y;	for(y=0; y<BLOCK_SIZE; y++)	{		dst[0] = src[0];		dst[1] = src[1];		dst[2] = src[2];		dst[3] = src[3];		dst[4] = src[4];		dst[5] = src[5];		dst[6] = src[6];		dst[7] = src[7];		const int middleEnergy= 5*(src[4] - src[5]) + 2*(src[2] - src[5]);		if(ABS(middleEnergy) < 8*QP)		{			const int q=(src[3] - src[4])/2;			const int leftEnergy=  5*(src[2] - src[1]) + 2*(src[0] - src[3]);			const int rightEnergy= 5*(src[6] - src[5]) + 2*(src[4] - src[7]);			int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) );			d= MAX(d, 0);			d= (5*d + 32) >> 6;			d*= SIGN(-middleEnergy);			if(q>0)			{				d= d<0 ? 0 : d;				d= d>q ? q : d;			}			else			{				d= d>0 ? 0 : d;				d= d<q ? q : d;			}        		dst[3]-= d;	        	dst[4]+= d;		}		dst+= stride;		src+= TEMP_STRIDE;	}#endif}