kernels/linux-2.4.0/drivers/usb/ov511.c
/* This converts YUV420 segments to YUYV */
This converts YUV420 segments to YUYV
This converts YUV420 segments to YUYV
static void
ov511_parse_data_yuv422(unsigned char *pIn0, unsigned char *pOut0,
		        int iOutY, int iOutUV, int iWidth)
{
	int k, l, m;
	unsigned char *pIn, *pOut, *pOut1;
	pIn = pIn0 + 128;
	pOut = pOut0 + iOutY;
	for (k = 0; k < 4; k++) {
		pOut1 = pOut;
		for (l = 0; l < 8; l++) {
			for (m = 0; m < 8; m++) {
				*pOut1 = (*pIn++);
				pOut1 += 2;
			}
			pOut1 += (iWidth - 8) * 2;
		}
		pOut += 8 * 2;
	}
	pIn = pIn0;
	pOut = pOut0 + iOutUV + 1;
	for (l = 0; l < 8; l++) {
		for (m=0; m<8; m++) {
			int v   = *(pIn+64);
			int u   = *pIn++;
			*pOut = u;
			*(pOut+2) = v;
			*(pOut+iWidth) = u;
			*(pOut+iWidth+2) = v;
			pOut += 4;
		}
		pOut += (iWidth*4 - 32);
	}
}
static void ov511_parse_data_yuv422 ( unsigned char * pIn0 , unsigned char * pOut0 , int iOutY , int iOutUV , int iWidth ) { int k , l , m ; unsigned char * pIn , * pOut , * pOut1 ; pIn = pIn0 + 128 ; pOut = pOut0 + iOutY ; for ( k = 0 ; k < 4 ; k ++ ) { pOut1 = pOut ; for ( l = 0 ; l < 8 ; l ++ ) { for ( m = 0 ; m < 8 ; m ++ ) { * pOut1 = ( * pIn ++ ) ; pOut1 += 2 ; } pOut1 += ( iWidth - 8 ) * 2 ; } pOut += 8 * 2 ; } pIn = pIn0 ; pOut = pOut0 + iOutUV + 1 ; for ( l = 0 ; l < 8 ; l ++ ) { for ( m = 0 ; m < 8 ; m ++ ) { int v = * ( pIn + 64 ) ; int u = * pIn ++ ; * pOut = u ; * ( pOut + 2 ) = v ; * ( pOut + iWidth ) = u ; * ( pOut + iWidth + 2 ) = v ; pOut += 4 ; } pOut += ( iWidth * 4 - 32 ) ; } }
This converts YUV420 segments to YUYV
This converts YUV420 segments to YUYV