const int mmxSize= srcWidth;
const int mmxSize= srcWidth&~15;
static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride){	int x,y;		// first line	for(x=0; x<srcWidth; x++){		dst[2*x+0]=		dst[2*x+1]= src[x];	}	dst+= dstStride;	for(y=1; y<srcHeight; y++){#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)		const int mmxSize= srcWidth;		asm volatile(			"movl %4, %%eax			\n\t"			"1:				\n\t"			"movq (%0, %%eax), %%mm0	\n\t"			"movq (%1, %%eax), %%mm1	\n\t"			"movq 1(%0, %%eax), %%mm2	\n\t"			"movq 1(%1, %%eax), %%mm3	\n\t"			"movq %%mm0, %%mm4		\n\t"			"movq %%mm1, %%mm5		\n\t"			PAVGB" %%mm3, %%mm0		\n\t"			PAVGB" %%mm3, %%mm0		\n\t"			PAVGB" %%mm4, %%mm3		\n\t"			PAVGB" %%mm4, %%mm3		\n\t"			PAVGB" %%mm2, %%mm1		\n\t"			PAVGB" %%mm2, %%mm1		\n\t"			PAVGB" %%mm5, %%mm2		\n\t"			PAVGB" %%mm5, %%mm2		\n\t"			"movq %%mm3, %%mm4		\n\t"			"movq %%mm2, %%mm5		\n\t"			"punpcklbw %%mm1, %%mm3		\n\t"			"punpckhbw %%mm1, %%mm4		\n\t"			"punpcklbw %%mm0, %%mm2		\n\t"			"punpckhbw %%mm0, %%mm5		\n\t"#if 1			MOVNTQ" %%mm3, (%2, %%eax, 2)	\n\t"			MOVNTQ" %%mm4, 8(%2, %%eax, 2)	\n\t"			MOVNTQ" %%mm2, (%3, %%eax, 2)	\n\t"			MOVNTQ" %%mm5, 8(%3, %%eax, 2)	\n\t"#else			"movq %%mm3, (%2, %%eax, 2)	\n\t"			"movq %%mm4, 8(%2, %%eax, 2)	\n\t"			"movq %%mm2, (%3, %%eax, 2)	\n\t"			"movq %%mm5, 8(%3, %%eax, 2)	\n\t"#endif			"addl $8, %%eax			\n\t"			" js 1b				\n\t"			:: "r" (src + mmxSize-1), "r" (src + srcStride + mmxSize-1),			   "r" (dst + mmxSize*2), "r" (dst + dstStride + mmxSize*2),			   "g" (-mmxSize)			: "%eax"		);		dst[0]= 		dst[dstStride]= src[0];#else		dst[0]= 		dst[dstStride]= src[0];		for(x=0; x<srcWidth-1; x++){			dst[2*x          +1]= (3*src[x+0] +   src[x+srcStride+1])>>2;			dst[2*x+dstStride+2]= (  src[x+0] + 3*src[x+srcStride+1])>>2;			dst[2*x+dstStride+1]= (  src[x+1] + 3*src[x+srcStride  ])>>2;			dst[2*x          +2]= (3*src[x+1] +   src[x+srcStride  ])>>2;		}#endif		dst[srcWidth*2 -1]= 		dst[srcWidth*2 -1 + dstStride]= src[srcWidth-1];		dst+=dstStride*2;		src+=srcStride;	}	src-=srcStride;		// last line	for(x=0; x<srcWidth; x++){		dst[2*x+0]=		dst[2*x+1]= src[x];	}#ifdef HAVE_MMXasm volatile(   EMMS" \n\t"        	SFENCE" \n\t"        	:::"memory");#endif}