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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? utils.c

?? 一個(gè)可以實(shí)現(xiàn)嵌入式視頻監(jiān)控系統(tǒng)的最新版客戶端軟件。
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/****************************************************************************#	 	Spcaview:  Spca5xx Grabber                                  ## 		Copyright (C) 2004 2005 Michel Xhaard                       ##                                                                           ## This program is free software; you can redistribute it and/or modify      ## it under the terms of the GNU General Public License as published by      ## the Free Software Foundation; either version 2 of the License, or         ## (at your option) any later version.                                       ##                                                                           ## This program is distributed in the hope that it will be useful,           ## but WITHOUT ANY WARRANTY; without even the implied warranty of            ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             ## GNU General Public License for more details.                              ##                                                                           ## You should have received a copy of the GNU General Public License         ## along with this program; if not, write to the Free Software               ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA ##                                                                           #****************************************************************************/#include "utils.h"#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <linux/types.h>#include <string.h>#include <fcntl.h>#include <wait.h>#include <time.h>#include <limits.h>#include "jdatatype.h"#include "encoder.h"#include <linux/videodev.h>#include "jconfig.h"doublems_time (void);staticswapRB (char *Buffer, int size);void exit_fatal(char *messages){	printf("%s \n",messages);	exit(1);}doublems_time (void){  static struct timeval tod;  gettimeofday (&tod, NULL);  return ((double) tod.tv_sec * 1000.0 + (double) tod.tv_usec / 1000.0);}staticswapRB (char *Buffer, int size){  char temp;  int i;  for (i = 0; i < size; i += 3)    {      temp = Buffer[i];      Buffer[i] = Buffer[i + 2];      Buffer[i + 2] = temp;    }}#define CLIP(color) (unsigned char)((color>0xFF)?0xff:((color<0)?0:color))voidYUV420toRGB (unsigned char *src, unsigned char *dst, int width, int height,	     int flipUV, int ColSpace){  unsigned char *Y;  unsigned char *V;  unsigned char *U;  int y1, y2, u, v;  int v1, v2, u1, u2;  unsigned char *pty1, *pty2;  int i, j;  unsigned char *RGB1, *RGB2;  int r, g, b;  //Initialization  Y = src;  V = Y + width * height;  U = Y + width * height + width * height / 4;  pty1 = Y;  pty2 = pty1 + width;  RGB1 = dst;  RGB2 = RGB1 + 3 * width;  for (j = 0; j < height; j += 2)    {      //printf ("process line %d\n",j);      for (i = 0; i < width; i += 2)	{	  if (flipUV)	    {	      u = (*V++) - 128;	      v = (*U++) - 128;	    }	  else	    {	      v = (*V++) - 128;	      u = (*U++) - 128;	    }	  switch (ColSpace)	    {	      // M$ color space	    case 0:	      {		v1 = ((v << 10) + (v << 9) + (v << 6) + (v << 5)) >> 10;	// 1.593		u1 = ((u << 8) + (u << 7) + (u << 4)) >> 10;	//         0.390		v2 = ((v << 9) + (v << 4)) >> 10;	//                0.515		u2 = ((u << 11) + (u << 4)) >> 10;	//               2.015	      }	      break;	      // PAL specific	    case 1:	      {		v1 = ((v << 10) + (v << 7) + (v << 4)) >> 10;	//      1.1406		u1 = ((u << 8) + (u << 7) + (u << 4) + (u << 3)) >> 10;	// 0.3984		v2 = ((v << 9) + (v << 6) + (v << 4) + (v << 1)) >> 10;	// 0.5800		u2 = ((u << 11) + (u << 5)) >> 10;	//              2.0312	      }	      break;	      // V4l2	    case 2:	      {		v1 = ((v << 10) + (v << 8) + (v << 7) + (v << 5)) >> 10;	//       1.406		u1 = ((u << 8) + (u << 6) + (u << 5)) >> 10;	//                0.343		v2 = ((v << 9) + (v << 7) + (v << 6) + (v << 5)) >> 10;	//        0.718		u2 = ((u << 10) + (u << 9) + (u << 8) + (u << 4) + (u << 3)) >> 10;	// 1.773	      }	      break;	    case 3:	      {		v1 = u1 = v2 = u2 = 0;	      }	      break;	    default:	      break;	    }	  //up-left	  y1 = (*pty1++);	  if (y1 > 0)	    {	      r = y1 + (v1);	      g = y1 - (u1) - (v2);	      b = y1 + (u2);	      r = CLIP (r);	      g = CLIP (g);	      b = CLIP (b);	    }	  else	    {	      r = g = b = 0;	    }	  *RGB1++ = r;	  *RGB1++ = g;	  *RGB1++ = b;	  //down-left	  y2 = (*pty2++);	  if (y2 > 0)	    {	      r = y2 + (v1);	      g = y2 - (u1) - (v2);	      b = y2 + (u2);	      r = CLIP (r);	      g = CLIP (g);	      b = CLIP (b);	    }	  else	    {	      r = b = g = 0;	    }	  *RGB2++ = r;	  *RGB2++ = g;	  *RGB2++ = b;	  //up-right	  y1 = (*pty1++);	  if (y1 > 0)	    {	      r = y1 + (v1);	      g = y1 - (u1) - (v2);	      b = y1 + (u2);	      r = CLIP (r);	      g = CLIP (g);	      b = CLIP (b);	    }	  else	    {	      r = g = b = 0;	    }	  *RGB1++ = r;	  *RGB1++ = g;	  *RGB1++ = b;	  //down-right	  y2 = (*pty2++);	  if (y2 > 0)	    {	      r = y2 + (v1);	      g = y2 - (u1) - (v2);	      b = y2 + (u2);	      r = CLIP (r);	      g = CLIP (g);	      b = CLIP (b);	    }	  else	    {	      r = b = g = 0;	    }	  *RGB2++ = r;	  *RGB2++ = g;	  *RGB2++ = b;	}      RGB1 += 3 * width;      RGB2 += 3 * width;      pty1 += width;      pty2 += width;    }//printf ("done YUV420 -> RGB \n");}int get_jpegsize (unsigned char *buf, int insize){ int i; 	 for ( i= 1024 ; i< insize; i++) { 	if ((buf[i] == 0xFF) && (buf[i+1] == 0xD9)) return i+10; } return -1;}/****************************************************************************//*  *    linux/drivers/video/fbcon-jpegdec.c - a tiny jpeg decoder. *       *      (w) August 2001 by Michael Schroeder, <mls@suse.de> *                   */ /*	february 2005 by Michel Xhaard, <mxhaard at magic dot fr >	change 	only produce RGB24 output	flip R and B component	Realloc output buffer if width and height change 	rewrite error check in jpeg_decode	update include for userspace use	decode 221111 jpeg411 and 211111 jpeg422 stream	*//****************************************************************************/#define ISHIFT 11#define IFIX(a) ((int)((a) * (1 << ISHIFT) + .5))#define IMULT(a, b) (((a) * (b)) >> ISHIFT)#define ITOINT(a) ((a) >> ISHIFT)#ifndef __P# define __P(x) x#endif/* special markers */#define M_BADHUFF	-1#define M_EOF		0x80struct jpeg_decdata {	int dcts[6 * 64 + 16];	int out[64 * 6];	int dquant[3][64];};struct in {	unsigned char *p;	unsigned int bits;	int left;	int marker;	int (*func) __P((void *));	void *data;};/*********************************/struct dec_hufftbl;struct enc_hufftbl;union hufftblp {	struct dec_hufftbl *dhuff;	struct enc_hufftbl *ehuff;};struct scan {	int dc;			/* old dc value */	union hufftblp hudc;	union hufftblp huac;	int next;		/* when to switch to next scan */	int cid;		/* component id */	int hv;			/* horiz/vert, copied from comp */	int tq;			/* quant tbl, copied from comp */};/*********************************/#define DECBITS 10		/* seems to be the optimum */struct dec_hufftbl {	int maxcode[17];	int valptr[16];	unsigned char vals[256];	unsigned int llvals[1 << DECBITS];};static void decode_mcus __P((struct in *, int *, int, struct scan *, int *));static int dec_readmarker __P((struct in *));static void dec_makehuff __P((struct dec_hufftbl *, int *, unsigned char *));static void setinput __P((struct in *, unsigned char *));/*********************************/#undef PREC#define PREC intstatic void idctqtab __P((unsigned char *, PREC *));static void idct __P((int *, int *, PREC *, PREC, int));static void scaleidctqtab __P((PREC *, PREC));/*********************************/static void initcol __P((PREC[][64]));static void col221111 __P((int *, unsigned char *, int));/*********************************/#define M_SOI	0xd8#define M_APP0	0xe0#define M_DQT	0xdb#define M_SOF0	0xc0#define M_DHT   0xc4#define M_DRI	0xdd#define M_SOS	0xda#define M_RST0	0xd0#define M_EOI	0xd9#define M_COM	0xfestatic unsigned char *datap;static int getbyte(void){	return *datap++;}static int getword(void){	int c1, c2;	c1 = *datap++;	c2 = *datap++;	return c1 << 8 | c2;}struct comp {	int cid;	int hv;	int tq;};#define MAXCOMP 4struct jpginfo {	int nc;			/* number of components */	int ns;			/* number of scans */	int dri;		/* restart interval */	int nm;			/* mcus til next marker */	int rm;			/* next restart marker */};static struct jpginfo info;static struct comp comps[MAXCOMP];static struct scan dscans[MAXCOMP];static unsigned char quant[4][64];static struct dec_hufftbl dhuff[4];#define dec_huffdc (dhuff + 0)#define dec_huffac (dhuff + 2)static struct in in;static int readtables(int till){	int m, l, i, j, lq, pq, tq;	int tc, th, tt;	for (;;) {		if (getbyte() != 0xff)			return -1;		if ((m = getbyte()) == till)			break;		switch (m) {		case 0xc2:			return 0;		case M_DQT:			lq = getword();			while (lq > 2) {				pq = getbyte();				tq = pq & 15;				if (tq > 3)					return -1;				pq >>= 4;				if (pq != 0)					return -1;				for (i = 0; i < 64; i++)					quant[tq][i] = getbyte();				lq -= 64 + 1;			}			break;		case M_DHT:			l = getword();			while (l > 2) {				int hufflen[16], k;				unsigned char huffvals[256];				tc = getbyte();				th = tc & 15;				tc >>= 4;				tt = tc * 2 + th;				if (tc > 1 || th > 1)					return -1;				for (i = 0; i < 16; i++)					hufflen[i] = getbyte();				l -= 1 + 16;				k = 0;				for (i = 0; i < 16; i++) {					for (j = 0; j < hufflen[i]; j++)						huffvals[k++] = getbyte();					l -= hufflen[i];				}				dec_makehuff(dhuff + tt, hufflen,					     huffvals);			}			break;		case M_DRI:			l = getword();			info.dri = getword();			break;		default:			l = getword();			while (l-- > 2)				getbyte();			break;		}	}	return 0;}static void dec_initscans(void){	int i;	info.nm = info.dri + 1;	info.rm = M_RST0;	for (i = 0; i < info.ns; i++)		dscans[i].dc = 0;}static int dec_checkmarker(void){	int i;	if (dec_readmarker(&in) != info.rm)		return -1;	info.nm = info.dri;	info.rm = (info.rm + 1) & ~0x08;	for (i = 0; i < info.ns; i++)		dscans[i].dc = 0;	return 0;}int jpeg_decode(unsigned char **pic, unsigned char *buf, int *width, int *height ){	struct jpeg_decdata *decdata;	int i, j, m, tac, tdc;	int intwidth ,intheight;	int mcusx, mcusy, mx, my;	int max[6];	int err = 0;	int enc411 = 1;	decdata = (struct jpeg_decdata*)malloc(sizeof(struct jpeg_decdata));	if (!decdata){		err= -1;		goto error;	}		if (buf == NULL){		err = -1;		goto error;	}	datap = buf;	if (getbyte() != 0xff){		err= ERR_NO_SOI;		goto error;	}	if (getbyte() != M_SOI){		err= ERR_NO_SOI;		goto error;	}	if (readtables(M_SOF0)){		err= ERR_BAD_TABLES;		goto error;	}	getword();	i = getbyte();	if (i != 8){		err = ERR_NOT_8BIT;		goto error;	}	intheight = getword();	intwidth = getword();		//if ((intheight & 15) || (intwidth & 15)){	if ((intheight & 7) || (intwidth & 15)){			err = ERR_BAD_WIDTH_OR_HEIGHT;		goto error;	}	info.nc = getbyte();	if (info.nc > MAXCOMP){		err = ERR_TOO_MANY_COMPPS;		goto error;	}	for (i = 0; i < info.nc; i++) {		int h, v;		comps[i].cid = getbyte();		comps[i].hv = getbyte();		v = comps[i].hv & 15;		h = comps[i].hv >> 4;		comps[i].tq = getbyte();		if (h > 3 || v > 3){			err = ERR_ILLEGAL_HV;			goto error;		}		if (comps[i].tq > 3){			err = ERR_QUANT_TABLE_SELECTOR;			goto error;		}	}	if (readtables(M_SOS)){		err = ERR_BAD_TABLES;		goto error;	}	getword();	info.ns = getbyte();	if (info.ns != 3){		err = ERR_NOT_YCBCR_221111;		goto error;	}	for (i = 0; i < 3; i++) {		dscans[i].cid = getbyte();		tdc = getbyte();		tac = tdc & 15;		tdc >>= 4;		if (tdc > 1 || tac > 1){			err = ERR_QUANT_TABLE_SELECTOR;			goto error;		}		for (j = 0; j < info.nc; j++)			if (comps[j].cid == dscans[i].cid)				break;		if (j == info.nc){			err= ERR_UNKNOWN_CID_IN_SCAN;			goto error;		}		dscans[i].hv = comps[j].hv;		dscans[i].tq = comps[j].tq;		dscans[i].hudc.dhuff = dec_huffdc + tdc;		dscans[i].huac.dhuff = dec_huffac + tac;	}		i = getbyte();	j = getbyte();	m = getbyte();		if (i != 0 || j != 63 || m != 0){		err = ERR_NOT_SEQUENTIAL_DCT;		goto error;	}		if (dscans[0].cid != 1 || dscans[1].cid != 2 || dscans[2].cid != 3){		err = ERR_NOT_YCBCR_221111;		goto error;	}	if (dscans[1].hv != 0x11 || dscans[2].hv != 0x11){		err = ERR_NOT_YCBCR_221111;		goto error;	}	/* if internal width and external are not the same or heigth too 	and pic not allocated realloc the good size and mark the change 	need 1 macroblock line more ?? */	if (intwidth != *width || intheight != *height || *pic == NULL){		*width = intwidth;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区在线播放| 色天天综合色天天久久| 日本视频一区二区| 亚洲va韩国va欧美va精品 | 亚洲欧洲国产日韩| 国产精品国产三级国产aⅴ原创| 国产欧美日韩另类一区| 国产亚洲一区字幕| 欧美经典一区二区三区| 国产精品美女久久久久久| 国产精品久久久久久久久久久免费看| 国产精品久久久一本精品| 国产精品久久福利| 亚洲精选一二三| 亚洲成av人片在线| 午夜精品久久久久久久久久久 | 成人avav在线| yourporn久久国产精品| 一本一道综合狠狠老| 欧美午夜片在线看| 9191久久久久久久久久久| 正在播放亚洲一区| 欧美va天堂va视频va在线| 久久久91精品国产一区二区精品| 亚洲国产经典视频| 亚洲综合色视频| 日韩av一二三| 国产高清久久久| 日本高清不卡视频| 欧美一级日韩免费不卡| 久久久久久久久蜜桃| 一区在线观看免费| 视频在线观看一区二区三区| 精品在线播放免费| 99久久综合色| 欧美日韩三级在线| 久久久精品免费观看| 亚洲日本韩国一区| 热久久国产精品| 成人激情免费视频| 3d成人h动漫网站入口| 久久久久国产精品麻豆ai换脸| 国产精品国模大尺度视频| 亚洲第一综合色| 极品少妇一区二区三区精品视频| 99精品视频在线播放观看| 在线播放欧美女士性生活| 久久嫩草精品久久久精品 | 在线一区二区视频| 欧美成人精品1314www| 国产精品精品国产色婷婷| 视频精品一区二区| 国产成a人亚洲| 欧美嫩在线观看| 国产欧美视频一区二区三区| 亚洲国产日韩一级| 高清国产一区二区| 在线成人午夜影院| 亚洲婷婷在线视频| 国产在线视频精品一区| 色综合久久久久久久| 日韩欧美一卡二卡| 夜夜爽夜夜爽精品视频| 国产999精品久久久久久| 在线播放国产精品二区一二区四区 | 884aa四虎影成人精品一区| 欧美国产1区2区| 美国三级日本三级久久99| 欧美在线|欧美| 国产精品美女久久久久久久久久久| 免费久久99精品国产| 欧美色图在线观看| 国产精品欧美久久久久一区二区| 久久99蜜桃精品| 欧美日韩在线播| 亚洲色图一区二区三区| 国产精品一区二区在线观看不卡| 欧美美女网站色| 亚洲伊人伊色伊影伊综合网| www.日韩在线| 国产亚洲综合在线| 国产一区二区女| 日韩精品一区二| 日韩国产欧美视频| 在线观看日韩电影| 亚洲欧洲日产国码二区| 精品午夜久久福利影院| 欧美日韩中文另类| 亚洲黄色小说网站| 国产69精品久久久久毛片| 色国产精品一区在线观看| 精品免费视频.| 午夜欧美电影在线观看| av福利精品导航| 日韩午夜激情av| 免费一级片91| 欧美精品第一页| 亚洲女女做受ⅹxx高潮| 国产成人在线视频网站| 精品美女在线观看| 日欧美一区二区| 91精品国产综合久久福利软件| 亚洲色欲色欲www在线观看| 国产精品一品二品| 精品国产欧美一区二区| 日韩精品高清不卡| 欧美视频一区二区三区在线观看 | 国产中文字幕一区| 欧美日韩午夜在线| 日本大胆欧美人术艺术动态| 欧美自拍偷拍午夜视频| 亚洲色图制服诱惑| 972aa.com艺术欧美| 中文字幕不卡的av| 国产精品一区二区你懂的| 欧美一级片在线观看| 精品一区二区三区香蕉蜜桃| 日韩女优视频免费观看| 奇米精品一区二区三区在线观看一 | 国产精品理伦片| 国产jizzjizz一区二区| 国产亚洲欧美中文| 免费在线看成人av| 欧美电影在哪看比较好| 日韩va欧美va亚洲va久久| 91精品国产色综合久久ai换脸| 亚洲线精品一区二区三区八戒| 波多野结衣中文字幕一区| 国产精品盗摄一区二区三区| 国产精品综合一区二区| 国产精品久久久久毛片软件| 成人免费观看视频| 国产精品欧美一级免费| 91丝袜国产在线播放| 亚洲精品乱码久久久久| 欧美视频一区二区三区四区| 亚洲r级在线视频| 欧美成人a在线| 国产精品69毛片高清亚洲| 国产日韩三级在线| 北条麻妃国产九九精品视频| 亚洲男人的天堂在线观看| 91国偷自产一区二区三区观看| 亚洲午夜免费福利视频| 欧美精品在线视频| 美国三级日本三级久久99| 久久久www免费人成精品| 成人综合婷婷国产精品久久 | 国产一区三区三区| 亚洲女女做受ⅹxx高潮| 欧美人牲a欧美精品| 麻豆极品一区二区三区| 亚洲国产精品成人久久综合一区 | 国产成人精品影院| 亚洲最色的网站| 欧美一级黄色大片| 国产99一区视频免费| 一区二区三区在线视频免费| 日韩视频免费观看高清完整版在线观看 | 91国产免费看| 免费成人在线播放| 中文一区一区三区高中清不卡| 欧美一二三区在线观看| 成人午夜电影久久影院| 日韩国产欧美三级| 欧美精品一区二区在线观看| 在线观看精品一区| 麻豆国产一区二区| 中文字幕日韩一区| 欧美精品乱码久久久久久按摩| 国产精品一线二线三线| 亚洲一区二区三区四区的| 欧美电视剧免费全集观看| 成人h动漫精品| 亚洲国产综合91精品麻豆| 中文字幕亚洲一区二区va在线| 3d动漫精品啪啪| 成av人片一区二区| 奇米影视在线99精品| 国产精品久线在线观看| 欧美一卡2卡三卡4卡5免费| 成年人国产精品| 国产成a人无v码亚洲福利| 午夜伊人狠狠久久| 欧美国产精品v| 日韩欧美一区在线观看| 色激情天天射综合网| 波多野结衣的一区二区三区| 久久99国产精品尤物| 亚洲国产一区在线观看| 国产亚洲人成网站| 日韩一区二区麻豆国产| 91.xcao| 在线精品观看国产| 国产成人h网站| 麻豆国产精品777777在线| 最新不卡av在线| 国产精品久久久久久久久动漫 | 26uuu精品一区二区在线观看| 在线免费观看日韩欧美|