dst[1]= ((dst[1]<<2) + (first + sums[0] + sums[3]<<1) + sums[5] + 8)>>4; dst[2]= ((dst[2]<<2) + (first + sums[1] + sums[4]<<1) + sums[6] + 8)>>4; dst[3]= ((dst[3]<<2) + (sums[2] + sums[5]<<1) + sums[0] + sums[7] + 8)>>4; dst[4]= ((dst[4]<<2) + (sums[3] + sums[6]<<1) + sums[1] + sums[8] + 8)>>4; dst[5]= ((dst[5]<<2) + (last + sums[7] + sums[4]<<1) + sums[2] + 8)>>4; dst[6]= ((last + dst[6]<<2) + (dst[7] + sums[5]<<1) + sums[3] + 8)>>4; dst[7]= ((sums[8]<<2) + (last + sums[6]<<1) + sums[4] + 8)>>4;
dst[1]= ((dst[1]<<2) + ((first + sums[0] + sums[3])<<1) + sums[5] + 8)>>4; dst[2]= ((dst[2]<<2) + ((first + sums[1] + sums[4])<<1) + sums[6] + 8)>>4; dst[3]= ((dst[3]<<2) + ((sums[2] + sums[5])<<1) + sums[0] + sums[7] + 8)>>4; dst[4]= ((dst[4]<<2) + ((sums[3] + sums[6])<<1) + sums[1] + sums[8] + 8)>>4; dst[5]= ((dst[5]<<2) + ((last + sums[7] + sums[4])<<1) + sums[2] + 8)>>4; dst[6]= (((last + dst[6])<<2) + ((dst[7] + sums[5])<<1) + sums[3] + 8)>>4; dst[7]= ((sums[8]<<2) + ((last + sums[6])<<1) + sums[4] + 8)>>4;
static inline void doHorizLowPass(uint8_t dst[], int stride, int QP){#if 0	asm volatile(		"leal (%0, %1), %%ecx				\n\t"		"leal (%%ecx, %1, 4), %%ebx			\n\t"//	0	1	2	3	4	5	6	7	8	9//	%0	ecx	ecx+%1	ecx+2%1	%0+4%1	ebx	ebx+%1	ebx+2%1	%0+8%1	ebx+4%1		"pxor %%mm7, %%mm7					\n\t"		"leal tempBlock, %%eax					\n\t"/*#define HLP1	"movq (%0), %%mm0					\n\t"\		"movq %%mm0, %%mm1					\n\t"\		"psllq $8, %%mm0					\n\t"\		PAVGB(%%mm1, %%mm0)\		"psrlw $8, %%mm0					\n\t"\		"pxor %%mm1, %%mm1					\n\t"\		"packuswb %%mm1, %%mm0					\n\t"\		"movq %%mm0, %%mm1					\n\t"\		"movq %%mm0, %%mm2					\n\t"\		"psllq $32, %%mm0					\n\t"\		"paddb %%mm0, %%mm1					\n\t"\		"psllq $16, %%mm2					\n\t"\		PAVGB(%%mm2, %%mm0)\		"movq %%mm0, %%mm3					\n\t"\		"pand bm11001100, %%mm0					\n\t"\		"paddusb %%mm0, %%mm3					\n\t"\		"psrlq $8, %%mm3					\n\t"\		PAVGB(%%mm1, %%mm4)\		PAVGB(%%mm3, %%mm2)\		"psrlq $16, %%mm2					\n\t"\		"punpcklbw %%mm2, %%mm2					\n\t"\		"movq %%mm2, (%0)					\n\t"\#define HLP2	"movq (%0), %%mm0					\n\t"\		"movq %%mm0, %%mm1					\n\t"\		"psllq $8, %%mm0					\n\t"\		PAVGB(%%mm1, %%mm0)\		"psrlw $8, %%mm0					\n\t"\		"pxor %%mm1, %%mm1					\n\t"\		"packuswb %%mm1, %%mm0					\n\t"\		"movq %%mm0, %%mm2					\n\t"\		"psllq $32, %%mm0					\n\t"\		"psllq $16, %%mm2					\n\t"\		PAVGB(%%mm2, %%mm0)\		"movq %%mm0, %%mm3					\n\t"\		"pand bm11001100, %%mm0					\n\t"\		"paddusb %%mm0, %%mm3					\n\t"\		"psrlq $8, %%mm3					\n\t"\		PAVGB(%%mm3, %%mm2)\		"psrlq $16, %%mm2					\n\t"\		"punpcklbw %%mm2, %%mm2					\n\t"\		"movq %%mm2, (%0)					\n\t"\*/// approximately a 7-Tap Filter with Vector (1,2,3,4,3,2,1)/16/*Implemented	Exact 7-Tap 9421		A321 36421		64321 334321		= 1234321	=  1234321	=   123433	=    12463	  12346     1249	   123A*/#ifdef HAVE_MMX2#define HLP3(i)	"movq " #i "(%%eax), %%mm0				\n\t"\		"movq %%mm0, %%mm1					\n\t"\		"movq %%mm0, %%mm2					\n\t"\		"movq %%mm0, %%mm3					\n\t"\		"movq %%mm0, %%mm4					\n\t"\		"psllq $8, %%mm1					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"pand bm00000001, %%mm3					\n\t"\		"pand bm10000000, %%mm4					\n\t"\		"por %%mm3, %%mm1					\n\t"\		"por %%mm4, %%mm2					\n\t"\		PAVGB(%%mm2, %%mm1)\		PAVGB(%%mm1, %%mm0)\\		"pshufw $0xF9, %%mm0, %%mm3				\n\t"\		"pshufw $0x90, %%mm0, %%mm4				\n\t"\		PAVGB(%%mm3, %%mm4)\		PAVGB(%%mm4, %%mm0)\		"movd %%mm0, (%0)					\n\t"\		"psrlq $32, %%mm0					\n\t"\		"movd %%mm0, 4(%0)					\n\t"#else#define HLP3(i)	"movq " #i "(%%eax), %%mm0				\n\t"\		"movq %%mm0, %%mm1					\n\t"\		"movq %%mm0, %%mm2					\n\t"\		"movd -4(%0), %%mm3					\n\t" /*0001000*/\		"movd 8(%0), %%mm4					\n\t" /*0001000*/\		"psllq $8, %%mm1					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"psrlq $24, %%mm3					\n\t"\		"psllq $56, %%mm4					\n\t"\		"por %%mm3, %%mm1					\n\t"\		"por %%mm4, %%mm2					\n\t"\		PAVGB(%%mm2, %%mm1)\		PAVGB(%%mm1, %%mm0)\\		"movq %%mm0, %%mm3					\n\t"\		"movq %%mm0, %%mm4					\n\t"\		"movq %%mm0, %%mm5					\n\t"\		"psrlq $16, %%mm3					\n\t"\		"psllq $16, %%mm4					\n\t"\		"pand bm11000000, %%mm5					\n\t"\		"por %%mm5, %%mm3					\n\t"\		"movq %%mm0, %%mm5					\n\t"\		"pand bm00000011, %%mm5					\n\t"\		"por %%mm5, %%mm4					\n\t"\		PAVGB(%%mm3, %%mm4)\		PAVGB(%%mm4, %%mm0)\		"movd %%mm0, (%0)					\n\t"\		"psrlq $32, %%mm0					\n\t"\		"movd %%mm0, 4(%0)					\n\t"#endif/* uses the 7-Tap Filter: 1112111 */#define NEW_HLP(src, dst)\		"movq " #src "(%%eax), %%mm1				\n\t"\		"movq " #src "(%%eax), %%mm2				\n\t"\		"psllq $8, %%mm1					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"movd -4" #dst ", %%mm3					\n\t" /*0001000*/\		"movd 8" #dst ", %%mm4					\n\t" /*0001000*/\		"psrlq $24, %%mm3					\n\t"\		"psllq $56, %%mm4					\n\t"\		"por %%mm3, %%mm1					\n\t"\		"por %%mm4, %%mm2					\n\t"\		"movq %%mm1, %%mm5					\n\t"\		PAVGB(%%mm2, %%mm1)\		"movq " #src "(%%eax), %%mm0				\n\t"\		PAVGB(%%mm1, %%mm0)\		"psllq $8, %%mm5					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"por %%mm3, %%mm5					\n\t"\		"por %%mm4, %%mm2					\n\t"\		"movq %%mm5, %%mm1					\n\t"\		PAVGB(%%mm2, %%mm5)\		"psllq $8, %%mm1					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"por %%mm3, %%mm1					\n\t"\		"por %%mm4, %%mm2					\n\t"\		PAVGB(%%mm2, %%mm1)\		PAVGB(%%mm1, %%mm5)\		PAVGB(%%mm5, %%mm0)\		"movd %%mm0, " #dst "					\n\t"\		"psrlq $32, %%mm0					\n\t"\		"movd %%mm0, 4" #dst "					\n\t"/* uses the 9-Tap Filter: 112242211 */#define NEW_HLP2(i)\		"movq " #i "(%%eax), %%mm0				\n\t" /*0001000*/\		"movq %%mm0, %%mm1					\n\t" /*0001000*/\		"movq %%mm0, %%mm2					\n\t" /*0001000*/\		"movd -4(%0), %%mm3					\n\t" /*0001000*/\		"movd 8(%0), %%mm4					\n\t" /*0001000*/\		"psllq $8, %%mm1					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"psrlq $24, %%mm3					\n\t"\		"psllq $56, %%mm4					\n\t"\		"por %%mm3, %%mm1					\n\t" /*0010000*/\		"por %%mm4, %%mm2					\n\t" /*0000100*/\		"movq %%mm1, %%mm5					\n\t" /*0010000*/\		PAVGB(%%mm2, %%mm1)					      /*0010100*/\		PAVGB(%%mm1, %%mm0)					      /*0012100*/\		"psllq $8, %%mm5					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"por %%mm3, %%mm5					\n\t" /*0100000*/\		"por %%mm4, %%mm2					\n\t" /*0000010*/\		"movq %%mm5, %%mm1					\n\t" /*0100000*/\		PAVGB(%%mm2, %%mm5)					      /*0100010*/\		"psllq $8, %%mm1					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"por %%mm3, %%mm1					\n\t" /*1000000*/\		"por %%mm4, %%mm2					\n\t" /*0000001*/\		"movq %%mm1, %%mm6					\n\t" /*1000000*/\		PAVGB(%%mm2, %%mm1)					      /*1000001*/\		"psllq $8, %%mm6					\n\t"\		"psrlq $8, %%mm2					\n\t"\		"por %%mm3, %%mm6					\n\t"/*100000000*/\		"por %%mm4, %%mm2					\n\t"/*000000001*/\		PAVGB(%%mm2, %%mm6)					     /*100000001*/\		PAVGB(%%mm6, %%mm1)					     /*110000011*/\		PAVGB(%%mm1, %%mm5)					     /*112000211*/\		PAVGB(%%mm5, %%mm0)					     /*112242211*/\		"movd %%mm0, (%0)					\n\t"\		"psrlq $32, %%mm0					\n\t"\		"movd %%mm0, 4(%0)					\n\t"#define HLP(src, dst) NEW_HLP(src, dst)		HLP(0, (%0))		HLP(8, (%%ecx))		HLP(16, (%%ecx, %1))		HLP(24, (%%ecx, %1, 2))		HLP(32, (%0, %1, 4))		HLP(40, (%%ebx))		HLP(48, (%%ebx, %1))		HLP(56, (%%ebx, %1, 2))		:		: "r" (dst), "r" (stride)		: "%eax", "%ebx", "%ecx"	);#else	int y;	for(y=0; y<BLOCK_SIZE; y++)	{		const int first= ABS(dst[-1] - dst[0]) < QP ? dst[-1] : dst[0];		const int last= ABS(dst[8] - dst[7]) < QP ? dst[8] : dst[7];		int sums[9];		sums[0] = first + dst[0];		sums[1] = dst[0] + dst[1];		sums[2] = dst[1] + dst[2];		sums[3] = dst[2] + dst[3];		sums[4] = dst[3] + dst[4];		sums[5] = dst[4] + dst[5];		sums[6] = dst[5] + dst[6];		sums[7] = dst[6] + dst[7];		sums[8] = dst[7] + last;		dst[0]= ((sums[0]<<2) + ((first + sums[2])<<1) + sums[4] + 8)>>4;		dst[1]= ((dst[1]<<2) + (first + sums[0] + sums[3]<<1) + sums[5] + 8)>>4;		dst[2]= ((dst[2]<<2) + (first + sums[1] + sums[4]<<1) + sums[6] + 8)>>4;		dst[3]= ((dst[3]<<2) + (sums[2] + sums[5]<<1) + sums[0] + sums[7] + 8)>>4;		dst[4]= ((dst[4]<<2) + (sums[3] + sums[6]<<1) + sums[1] + sums[8] + 8)>>4;		dst[5]= ((dst[5]<<2) + (last + sums[7] + sums[4]<<1) + sums[2] + 8)>>4;		dst[6]= ((last + dst[6]<<2) + (dst[7] + sums[5]<<1) + sums[3] + 8)>>4;		dst[7]= ((sums[8]<<2) + (last + sums[6]<<1) + sums[4] + 8)>>4;		dst+= stride;	}#endif}