亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ibmcam.c

?? 底層驅動開發
?? C
?? 第 1 頁 / 共 5 頁
字號:
			scanLength = 128;			scanHeight = 96;			order_uv = 1;	/* U Y V Y ... */			break;		case HDRSIG_MODEL1_176x144:			scanLength = 176;			scanHeight = 144;			order_uv = 1;	/* U Y V Y ... */			break;		case HDRSIG_MODEL1_352x288:			scanLength = 352;			scanHeight = 288;			order_uv = 0;	/* Y V Y V ... */			break;		default:			err("Unknown header signature 00 FF 00 %02lX", frame->header);			return scan_NextFrame;		}		/* order_yc: true=Yc false=cY ('c'=either U or V) */		order_yc = (IBMCAM_T(uvd)->camera_model == IBMCAM_MODEL_2);	}	len = scanLength * 3;	assert(len <= sizeof(lineBuffer));	/*	 * Lines are organized this way:	 *	 * I420:	 * ~~~~	 * <scanLength->	 * ___________________________________	 * |-----Y-----|---UVUVUV...UVUV-----| \	 * |-----------+---------------------|  \	 * |<-- 176 -->|<------ 176*2 ------>|  Total 72. lines (interlaced)	 * |...	   ... |        ...          |  /	 * |<-- 352 -->|<------ 352*2 ------>|  Total 144. lines (interlaced)	 * |___________|_____________________| /	 *  \           \	 *   lumaLine    chromaLine	 */	/* Make sure there's enough data for the entire line */	if (RingQueue_GetLength(&uvd->dp) < len)		return scan_Out;	/* Suck one line out of the ring queue */	RingQueue_Dequeue(&uvd->dp, lineBuffer, len);	/*	 * Make sure that our writing into output buffer	 * will not exceed the buffer. Mind that we may write	 * not into current output scanline but in several after	 * it as well (if we enlarge image vertically.)	 */	if ((frame->curline + 2) >= VIDEOSIZE_Y(frame->request))		return scan_NextFrame;	/*	 * Now we are sure that entire line (representing all 'scanLength'	 * pixels from the camera) is available in the buffer. We	 * start copying the line left-aligned to the V4L buffer.	 * If the camera line is shorter then we should pad the V4L	 * buffer with something (black) to complete the line.	 */	assert(frame->data != NULL);	f = frame->data + (v4l_linesize * frame->curline);	/*	 * To obtain chrominance data from the 'chromaLine' use this:	 *   v = chromaLine[0]; // 0-1:[0], 2-3:[4], 4-5:[8]...	 *   u = chromaLine[2]; // 0-1:[2], 2-3:[6], 4-5:[10]...	 *	 * Indices must be calculated this way:	 * v_index = (i >> 1) << 2;	 * u_index = (i >> 1) << 2 + 2;	 *	 * where 'i' is the column number [0..VIDEOSIZE_X(frame->request)-1]	 */	lumaLine = lineBuffer;	chromaLine = lineBuffer + scanLength;	for (i = 0; i < VIDEOSIZE_X(frame->request); i++)	{		unsigned char rv, gv, bv;	/* RGB components */		/* Check for various visual debugging hints (colorized pixels) */		if ((flags & FLAGS_DISPLAY_HINTS) && (icam->has_hdr)) {			/*			 * This is bad and should not happen. This means that			 * we somehow overshoot the line and encountered new			 * frame! Obviously our camera/V4L frame size is out			 * of whack. This cyan dot will help you to figure			 * out where exactly the new frame arrived.			 */			if (icam->has_hdr == 1) {				bv = 0; /* Yellow marker */				gv = 0xFF;				rv = 0xFF;			} else {				bv = 0xFF; /* Cyan marker */				gv = 0xFF;				rv = 0;			}			icam->has_hdr = 0;			goto make_pixel;		}		/*		 * Check if we are still in range. We may be out of range if our		 * V4L canvas is wider or taller than the camera "native" image.		 * Then we quickly fill the remainder of the line with zeros to		 * make black color and quit the horizontal scanning loop.		 */		if (((frame->curline + 2) >= scanHeight) || (i >= scanLength)) {			const int j = i * V4L_BYTES_PER_PIXEL;#if USES_IBMCAM_PUTPIXEL			/* Refresh 'f' because we don't use it much with PUTPIXEL */			f = frame->data + (v4l_linesize * frame->curline) + j;#endif			memset(f, 0, v4l_linesize - j);			break;		}		y = lumaLine[i];		if (flags & FLAGS_MONOCHROME) /* Use monochrome for debugging */			rv = gv = bv = y;		else {			int off_0, off_2;			off_0 = (i >> 1) << 2;			off_2 = off_0 + 2;			if (order_yc) {				off_0++;				off_2++;			}			if (!order_uv) {				off_0 += 2;				off_2 -= 2;			}			u = chromaLine[off_0] + hue_corr;			v = chromaLine[off_2] + hue2_corr;			/* Apply color correction */			if (color_corr != 0) {				/* Magnify up to 2 times, reduce down to zero saturation */				u = 128 + ((ccm + color_corr) * (u - 128)) / ccm;				v = 128 + ((ccm + color_corr) * (v - 128)) / ccm;			}			YUV_TO_RGB_BY_THE_BOOK(y, u, v, rv, gv, bv);		}	make_pixel:		/*		 * The purpose of creating the pixel here, in one,		 * dedicated place is that we may need to make the		 * pixel wider and taller than it actually is. This		 * may be used if camera generates small frames for		 * sake of frame rate (or any other reason.)		 *		 * The output data consists of B, G, R bytes		 * (in this order).		 */#if USES_IBMCAM_PUTPIXEL		RGB24_PUTPIXEL(frame, i, frame->curline, rv, gv, bv);#else		*f++ = bv;		*f++ = gv;		*f++ = rv;#endif		/*		 * Typically we do not decide within a legitimate frame		 * that we want to end the frame. However debugging code		 * may detect marker of new frame within the data. Then		 * this condition activates. The 'data' pointer is already		 * pointing at the new marker, so we'd better leave it as is.		 */		if (frame_done)			break;	/* End scanning of lines */	}	/*	 * Account for number of bytes that we wrote into output V4L frame.	 * We do it here, after we are done with the scanline, because we	 * may fill more than one output scanline if we do vertical	 * enlargement.	 */	frame->curline += 2;	if (pcopylen != NULL)		*pcopylen += 2 * v4l_linesize;	frame->deinterlace = Deinterlace_FillOddLines;	if (frame_done || (frame->curline >= VIDEOSIZE_Y(frame->request)))		return scan_NextFrame;	else		return scan_Continue;}/* * ibmcam_model2_320x240_parse_lines() * * This procedure deals with a weird RGB format that is produced by IBM * camera model 2 in modes 320x240 and above; 'x' below is 159 or 175, * depending on horizontal size of the picture: * * <--- 160 or 176 pairs of RA,RB bytes -----> * *-----------------------------------------* \ * | RA0 | RB0 | RA1 | RB1 | ... | RAx | RBx |  \   This is pair of horizontal lines, * |-----+-----+-----+-----+ ... +-----+-----|   *- or one interlaced line, total * | B0  | G0  | B1  | G1  | ... | Bx  | Gx  |  /   120 or 144 such pairs which yield * |=====+=====+=====+=====+ ... +=====+=====| /    240 or 288 lines after deinterlacing. * * Each group of FOUR bytes (RAi, RBi, Bi, Gi) where i=0..frame_width/2-1 * defines ONE pixel. Therefore this format yields 176x144 "decoded" * resolution at best. I do not know why camera sends such format - the * previous model (1) just used interlaced I420 and everyone was happy. * * I do not know what is the difference between RAi and RBi bytes. Both * seemingly represent R component, but slightly vary in value (so that * the picture looks a bit colored if one or another is used). I use * them both as R component in attempt to at least partially recover the * lost resolution. */static enum ParseState ibmcam_model2_320x240_parse_lines(	struct uvd *uvd,	struct usbvideo_frame *frame,	long *pcopylen){	unsigned char *f, *la, *lb;	unsigned int len;	int v4l_linesize; /* V4L line offset */	int i, j, frame_done=0, color_corr;	int scanLength, scanHeight;	static unsigned char lineBuffer[352*2];	switch (uvd->videosize) {	case VIDEOSIZE_320x240:	case VIDEOSIZE_352x240:	case VIDEOSIZE_352x288:		scanLength = VIDEOSIZE_X(uvd->videosize);		scanHeight = VIDEOSIZE_Y(uvd->videosize);		break;	default:		err("ibmcam_model2_320x240_parse_lines: Wrong mode.");		return scan_Out;	}	color_corr = (uvd->vpic.colour) >> 8; /* 0..+255 */	v4l_linesize = VIDEOSIZE_X(frame->request) * V4L_BYTES_PER_PIXEL;	len = scanLength * 2; /* See explanation above */	assert(len <= sizeof(lineBuffer));	/* Make sure there's enough data for the entire line */	if (RingQueue_GetLength(&uvd->dp) < len)		return scan_Out;	/* Suck one line out of the ring queue */	RingQueue_Dequeue(&uvd->dp, lineBuffer, len);	/*	 * Make sure that our writing into output buffer	 * will not exceed the buffer. Mind that we may write	 * not into current output scanline but in several after	 * it as well (if we enlarge image vertically.)	 */	if ((frame->curline + 2) >= VIDEOSIZE_Y(frame->request))		return scan_NextFrame;	la = lineBuffer;	lb = lineBuffer + scanLength;	/*	 * Now we are sure that entire line (representing all	 *         VIDEOSIZE_X(frame->request)	 * pixels from the camera) is available in the scratch buffer. We	 * start copying the line left-aligned to the V4L buffer (which	 * might be larger - not smaller, hopefully). If the camera	 * line is shorter then we should pad the V4L buffer with something	 * (black in this case) to complete the line.	 */	f = frame->data + (v4l_linesize * frame->curline);	/* Fill the 2-line strip */	for (i = 0; i < VIDEOSIZE_X(frame->request); i++) {		int y, rv, gv, bv;	/* RGB components */		j = i & (~1);		/* Check for various visual debugging hints (colorized pixels) */		if ((flags & FLAGS_DISPLAY_HINTS) && (IBMCAM_T(uvd)->has_hdr)) {			if (IBMCAM_T(uvd)->has_hdr == 1) {				bv = 0; /* Yellow marker */				gv = 0xFF;				rv = 0xFF;			} else {				bv = 0xFF; /* Cyan marker */				gv = 0xFF;				rv = 0;			}			IBMCAM_T(uvd)->has_hdr = 0;			goto make_pixel;		}		/*		 * Check if we are still in range. We may be out of range if our		 * V4L canvas is wider or taller than the camera "native" image.		 * Then we quickly fill the remainder of the line with zeros to		 * make black color and quit the horizontal scanning loop.		 */		if (((frame->curline + 2) >= scanHeight) || (i >= scanLength)) {			const int j = i * V4L_BYTES_PER_PIXEL;#if USES_IBMCAM_PUTPIXEL			/* Refresh 'f' because we don't use it much with PUTPIXEL */			f = frame->data + (v4l_linesize * frame->curline) + j;#endif			memset(f, 0, v4l_linesize - j);			break;		}		/*		 * Here I use RA and RB components, one per physical pixel.		 * This causes fine vertical grid on the picture but may improve		 * horizontal resolution. If you prefer replicating, use this:		 *   rv = la[j + 0];   ... or ... rv = la[j + 1];		 * then the pixel will be replicated.		 */		rv = la[i];		gv = lb[j + 1];		bv = lb[j + 0];		y = (rv + gv + bv) / 3; /* Brightness (badly calculated) */		if (flags & FLAGS_MONOCHROME) /* Use monochrome for debugging */			rv = gv = bv = y;		else if (color_corr != 128) {			/* Calculate difference between color and brightness */			rv -= y;			gv -= y;			bv -= y;			/* Scale differences */			rv = (rv * color_corr) / 128;			gv = (gv * color_corr) / 128;			bv = (bv * color_corr) / 128;			/* Reapply brightness */			rv += y;			gv += y;			bv += y;			/* Watch for overflows */			RESTRICT_TO_RANGE(rv, 0, 255);			RESTRICT_TO_RANGE(gv, 0, 255);			RESTRICT_TO_RANGE(bv, 0, 255);		}	make_pixel:		RGB24_PUTPIXEL(frame, i, frame->curline, rv, gv, bv);	}	/*	 * Account for number of bytes that we wrote into output V4L frame.	 * We do it here, after we are done with the scanline, because we	 * may fill more than one output scanline if we do vertical	 * enlargement.	 */	frame->curline += 2;	*pcopylen += v4l_linesize * 2;	frame->deinterlace = Deinterlace_FillOddLines;	if (frame_done || (frame->curline >= VIDEOSIZE_Y(frame->request)))		return scan_NextFrame;	else		return scan_Continue;}static enum ParseState ibmcam_model3_parse_lines(	struct uvd *uvd,	struct usbvideo_frame *frame,	long *pcopylen){	unsigned char *data;	const unsigned char *color;	unsigned int len;	int v4l_linesize; /* V4L line offset */	const int hue_corr  = (uvd->vpic.hue - 0x8000) >> 10;	/* -32..+31 */	const int hue2_corr = (hue_correction - 128) / 4;		/* -32..+31 */	const int ccm = 128; /* Color correction median - see below */	int i, u, v, rw, data_w=0, data_h=0, color_corr;	static unsigned char lineBuffer[640*3];	color_corr = (uvd->vpic.colour - 0x8000) >> 8; /* -128..+127 = -ccm..+(ccm-1)*/	RESTRICT_TO_RANGE(color_corr, -ccm, ccm+1);	v4l_linesize = VIDEOSIZE_X(frame->request) * V4L_BYTES_PER_PIXEL;	/* The header tells us what sort of data is in this frame */	switch (frame->header) {		/*		 * Uncompressed modes (that are easy to decode).		 */	case 0x0308:		data_w = 640;		data_h = 480;		break;	case 0x0208:		data_w = 320;		data_h = 240;		break;	case 0x020A:		data_w = 160;		data_h = 120;		break;		/*		 * Compressed modes (ViCE - that I don't know how to decode).		 */	case 0x0328:	/* 640x480, best quality compression */	case 0x0368:	/* 640x480, best frame rate compression */	case 0x0228:	/* 320x240, best quality compression */	case 0x0268:	/* 320x240, best frame rate compression */	case 0x02CA:	/* 160x120, best quality compression */	case 0x02EA:	/* 160x120, best frame rate compression */		/* Do nothing with this - not supported */		err("Unsupported mode $%04lx", frame->header);		return scan_NextFrame;	default:		/* Catch unknown headers, may help in learning new headers */		err("Strange frame->header=$%08lx", frame->header);		return scan_NextFrame;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产三级| 欧美变态tickling挠脚心| 美国毛片一区二区三区| 亚洲视频小说图片| 久久久亚洲精华液精华液精华液| 欧美亚洲高清一区| 国产精品一级片| 五月天一区二区| 亚洲天堂av一区| 国产婷婷色一区二区三区四区| 在线区一区二视频| 成熟亚洲日本毛茸茸凸凹| 偷拍亚洲欧洲综合| 国产精品传媒视频| 久久亚洲精精品中文字幕早川悠里| 欧美日韩精品欧美日韩精品一 | 久久99国产精品成人| 亚洲视频精选在线| 日本一区二区三级电影在线观看 | 亚洲一区在线电影| 久久久精品2019中文字幕之3| 欧美午夜寂寞影院| 91在线视频官网| 成人午夜精品一区二区三区| 黑人巨大精品欧美一区| 日本成人中文字幕在线视频| 亚洲午夜成aⅴ人片| 亚洲啪啪综合av一区二区三区| 精品播放一区二区| 欧美va亚洲va| 日韩精品在线一区二区| 欧美一三区三区四区免费在线看 | 在线不卡免费av| 欧美亚洲高清一区二区三区不卡| 91丨九色丨国产丨porny| 成人久久久精品乱码一区二区三区| 精品一区二区三区免费毛片爱| 奇米色777欧美一区二区| 日韩电影在线观看网站| 日韩高清在线电影| 青青草91视频| 国产原创一区二区| 国产电影一区二区三区| 国产成人午夜片在线观看高清观看| 国产真实乱子伦精品视频| 国产一区二区伦理| 国产成人av电影在线观看| 国产成人在线视频网址| 东方aⅴ免费观看久久av| 成人av在线影院| 色综合久久66| 欧美日韩高清一区二区不卡| 制服丝袜亚洲精品中文字幕| 精品伦理精品一区| 国产亚洲1区2区3区| 国产精品狼人久久影院观看方式| 欧美激情一区在线| 亚洲欧美影音先锋| 一区二区在线观看免费| 午夜不卡在线视频| 国产一区二区美女| 91小视频在线免费看| 欧美写真视频网站| 精品国产一区二区三区不卡| 欧美国产日韩在线观看| 一区二区日韩av| 美女在线观看视频一区二区| 国产精品中文欧美| 色视频一区二区| 日韩一级片网址| 国产日韩三级在线| 樱桃国产成人精品视频| 蜜桃一区二区三区在线观看| 国产福利一区在线| 色激情天天射综合网| 欧美另类一区二区三区| 久久久精品综合| 亚洲欧美aⅴ...| 蜜臀a∨国产成人精品| 成人午夜免费电影| 欧美精品一二三四| 亚洲国产成人在线| 亚洲不卡在线观看| 国产福利一区二区三区| 欧美亚洲国产一区二区三区| 久久网站热最新地址| 亚洲精品一二三区| 国产自产高清不卡| 欧美丝袜丝nylons| 国产午夜精品一区二区| 无码av中文一区二区三区桃花岛| 国产精品一区2区| 777xxx欧美| 亚洲欧美日韩国产手机在线 | 91女人视频在线观看| 欧美精选午夜久久久乱码6080| 国产清纯在线一区二区www| 视频一区二区中文字幕| 成人av动漫网站| xvideos.蜜桃一区二区| 午夜视频在线观看一区二区三区| 成人久久18免费网站麻豆| 欧美一二三在线| 亚洲精品国产第一综合99久久| 激情小说欧美图片| 91福利在线播放| 国产精品网友自拍| 美国欧美日韩国产在线播放| 欧美三级午夜理伦三级中视频| 亚洲国产成人一区二区三区| 美女国产一区二区| 欧美女孩性生活视频| 亚洲女女做受ⅹxx高潮| 成人免费视频免费观看| 久久在线观看免费| 日韩av一二三| 欧美午夜精品免费| 亚洲欧美偷拍另类a∨色屁股| 国产精品一二三四| 欧美成人video| 日本少妇一区二区| 欧美老女人在线| 亚洲一级在线观看| 91女神在线视频| 一色屋精品亚洲香蕉网站| 国产成人啪午夜精品网站男同| 精品噜噜噜噜久久久久久久久试看 | 国产性色一区二区| 国产精品资源在线| 国产亚洲综合性久久久影院| 精品一区二区日韩| 亚洲精品在线免费观看视频| 免费观看成人av| 日韩免费成人网| 九九九久久久精品| 欧美电影免费观看完整版| 蜜桃精品在线观看| 精品免费视频.| 看电视剧不卡顿的网站| 日韩欧美电影一区| 韩国女主播成人在线观看| 日韩精品一区二区三区四区| 麻豆久久久久久| 久久品道一品道久久精品| 国产成人夜色高潮福利影视| 中文字幕欧美激情| 91在线视频免费91| 亚洲图片欧美一区| 欧美精品色一区二区三区| 美女一区二区三区在线观看| 欧美绝品在线观看成人午夜影视| 日韩中文字幕不卡| 精品久久久久久亚洲综合网| 国产精品99久久久久久宅男| 国产精品护士白丝一区av| 91福利资源站| 麻豆精品视频在线观看| 国产女人18毛片水真多成人如厕| 97精品视频在线观看自产线路二| 亚洲在线观看免费视频| 日韩一区二区三区四区| 国产91色综合久久免费分享| 亚洲精品成人在线| 91 com成人网| 成人免费观看av| 亚洲成人在线观看视频| 欧美精品一区二区三区蜜桃| 波多野结衣欧美| 天天亚洲美女在线视频| 国产亚洲精品aa| 欧美日韩另类一区| 国产高清不卡二三区| 亚洲影院久久精品| 26uuu久久综合| 欧美性生活大片视频| 九九**精品视频免费播放| 亚洲欧美综合另类在线卡通| 日韩一区二区精品| 99久久婷婷国产精品综合| 蜜臀av亚洲一区中文字幕| 中文字幕一区视频| 7777精品久久久大香线蕉| 波多野结衣中文字幕一区二区三区| 亚洲成人资源网| 国产精品久久二区二区| 91精品国产免费久久综合| av一区二区久久| 激情国产一区二区| 亚洲自拍偷拍av| 国产欧美日产一区| 777欧美精品| 91捆绑美女网站| 国产一二三精品| 天堂蜜桃一区二区三区| 国产精品人妖ts系列视频| 欧美一区在线视频| 欧美午夜一区二区三区| 97se亚洲国产综合在线| 国产一区日韩二区欧美三区| 午夜视频一区二区|