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

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

?? mx27_pp.c

?? LINUX下的ov2640驅動程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. *//* * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html *//*! * @file mx27_pp.c * * @brief MX27 V4L2 Video Output Driver * * Video4Linux2 Output Device using MX27 eMMA Post-processing functionality. * * @ingroup MXC_V4L2_OUTPUT */#include <linux/kernel.h>#include <linux/string.h>#include <linux/module.h>#include <linux/fb.h>#include <linux/clk.h>#include <linux/interrupt.h>#include <asm/io.h>#include "mx27_pp.h"#include "mxc_v4l2_output.h"#define SCALE_RETRY	32	/* to be more relax, less precise */#define PP_SKIP		1#define PP_TBL_MAX	40static unsigned short scale_tbl[PP_TBL_MAX];static int g_hlen, g_vlen;static emma_pp_cfg g_pp_cfg;static int g_disp_num = 0;static char pp_dev[] = "emma_pp";/*! * @brief PP resizing routines */static int gcd(int x, int y);static int ratio(int x, int y, int *den);static int scale_0d(int k, int coeff, int base, int nxt);static int scale_1d(int inv, int outv, int k);static int scale_1d_smart(int *inv, int *outv, int index);static int scale_2d(emma_pp_scale * sz);static irqreturn_t pp_isr(int irq, void *dev_id);static int set_output_addr(emma_pp_cfg * cfg, vout_data * vout);static int pphw_reset(void);static int pphw_enable(int flag);static int pphw_ptr(emma_pp_cfg * cfg);static int pphw_outptr(emma_pp_cfg * cfg);static int pphw_cfg(emma_pp_cfg * cfg);static int pphw_isr(void);static void pphw_init(void);static void pphw_exit(void);#define PP_DUMP(reg)	pr_debug("%s\t = 0x%08X\n", #reg, __raw_readl(reg))void pp_dump(void){	PP_DUMP(PP_CNTL);	PP_DUMP(PP_INTRCNTL);	PP_DUMP(PP_INTRSTATUS);	PP_DUMP(PP_SOURCE_Y_PTR);	PP_DUMP(PP_SOURCE_CB_PTR);	PP_DUMP(PP_SOURCE_CR_PTR);	PP_DUMP(PP_DEST_RGB_PTR);	PP_DUMP(PP_QUANTIZER_PTR);	PP_DUMP(PP_PROCESS_FRAME_PARA);	PP_DUMP(PP_SOURCE_FRAME_WIDTH);	PP_DUMP(PP_DEST_DISPLAY_WIDTH);	PP_DUMP(PP_DEST_IMAGE_SIZE);	PP_DUMP(PP_DEST_FRAME_FMT_CNTL);	PP_DUMP(PP_RESIZE_INDEX);	PP_DUMP(PP_CSC_COEF_0123);	PP_DUMP(PP_CSC_COEF_4);}static const unsigned char pp_coeftab[] = {	2, 1,	19, 10,	17, 9,	15, 8,	13, 7,	11, 6,	20, 11,	9, 5,	16, 9,	7, 4,	19, 11,	12, 7,	17, 10,	5, 3,	18, 11,	13, 8,	8, 5,	19, 12,	11, 7,	14, 9,	17, 11,	20, 13,	3, 2,	19, 13,	16, 11,	13, 9,	10, 7,	17, 12,	7, 5,	18, 13,	11, 8,	15, 11,	19, 14,	4, 3,	17, 13,	13, 10,	9, 7,	14, 11,	19, 15,	5, 4,	16, 13,	11, 9,	17, 14,	6, 5,	19, 16,	13, 11,	20, 17,	7, 6,	15, 13,	8, 7,	17, 15,	9, 8,	19, 17,	10, 9,	11, 10,	12, 11,	13, 12,	14, 13,	15, 14,	16, 15,	17, 16,	18, 17,	19, 18,	20, 19,	1, 1,	19, 20,	18, 19,	17, 18,	16, 17,	15, 16,	14, 15,	13, 14,	12, 13,	11, 12,	10, 11,	9, 10,	17, 19,	8, 9,	15, 17,	7, 8,	13, 15,	6, 7,	17, 20,	11, 13,	16, 19,	5, 6,	14, 17,	9, 11,	13, 16,	4, 5,	15, 19,	11, 14,	7, 9,	10, 13,	13, 17,	3, 4,	14, 19,	11, 15,	8, 11,	13, 18,	5, 7,	12, 17,	7, 10,	9, 13,	11, 16,	13, 19,	2, 3,	13, 20,	11, 17,	9, 14,	7, 11,	12, 19,	5, 8,	8, 13,	11, 18,	3, 5,	10, 17,	7, 12,	11, 19,	4, 7,	9, 16,	5, 9,	11, 20,	6, 11,	7, 13,	8, 15,	9, 17,	10, 19,	1, 2,	9, 19,	8, 17,	7, 15,	6, 13,	5, 11,	9, 20,	4, 9,	7, 16,	3, 7,	8, 19,	5, 12,	7, 17,	2, 5,	7, 18,	5, 13,	3, 8,	7, 19,	4, 11,	5, 14,	6, 17,	7, 20,	1, 3,	6, 19,	5, 16,	4, 13,	3, 10,	5, 17,	2, 7,	5, 18,	3, 11,	4, 15,	5, 19,	1, 4};/*! * @brief Set PP input address. * @param ptr	The pointer to the Y value of input * @return	Zero on success, others on failure */int pp_ptr(unsigned long ptr){	g_pp_cfg.ptr.y = ptr;	g_pp_cfg.ptr.u = g_pp_cfg.ptr.v = g_pp_cfg.ptr.qp = 0;	return pphw_ptr(&g_pp_cfg);}/*! * @brief Enable or disable PP. * @param flag	Zero to disable PP, others to enable PP * @return	Zero on success, others on failure */int pp_enable(int flag){	return pphw_enable(flag);}/*! * @brief Get the display No. of last completed PP frame. * @return	The display No. of last completed PP frame. */int pp_num_last(void){	return (g_disp_num ? 0 : 1);}/*! * @brief Initialize PP. * @param vout	Pointer to _vout_data structure * @return	Zero on success, others on failure */int pp_init(vout_data * vout){	pphw_init();	pphw_enable(0);	enable_irq(INT_EMMAPP);	return request_irq(INT_EMMAPP, pp_isr, 0, pp_dev, vout);}/*! * @brief Deinitialize PP. * @param vout	Pointer to _vout_data structure */void pp_exit(vout_data * vout){	disable_irq(INT_EMMAPP);	free_irq(INT_EMMAPP, vout);	pphw_enable(0);	pphw_exit();}/*! * @brief Configure PP. * @param vout	Pointer to _vout_data structure * @return	Zero on success, others on failure */int pp_cfg(vout_data * vout){	if (!vout)		return -1;	/* PP accepts YUV420 input only */	if (vout->v2f.fmt.pix.pixelformat != V4L2_PIX_FMT_YUV420) {		pr_debug("unsupported pixel format.\n");		return -1;	}	g_pp_cfg.operation = 0;	memset(g_pp_cfg.csc_table, 0, sizeof(g_pp_cfg.csc_table));	/* Convert output pixel format to PP required format */	switch (vout->v4l2_fb.fmt.pixelformat) {	case V4L2_PIX_FMT_BGR32:		g_pp_cfg.red_width = 8;		g_pp_cfg.green_width = 8;		g_pp_cfg.blue_width = 8;		g_pp_cfg.red_offset = 8;		g_pp_cfg.green_offset = 16;		g_pp_cfg.blue_offset = 24;		g_pp_cfg.rgb_resolution = 32;		break;	case V4L2_PIX_FMT_RGB32:		g_pp_cfg.red_width = 8;		g_pp_cfg.green_width = 8;		g_pp_cfg.blue_width = 8;		g_pp_cfg.red_offset = 24;		g_pp_cfg.green_offset = 16;		g_pp_cfg.blue_offset = 8;		g_pp_cfg.rgb_resolution = 32;		break;	case V4L2_PIX_FMT_YUYV:		g_pp_cfg.red_width = 0;		g_pp_cfg.green_width = 0;		g_pp_cfg.blue_width = 0;		g_pp_cfg.red_offset = 0;		g_pp_cfg.green_offset = 0;		g_pp_cfg.blue_offset = PP_PIX_YUYV;		g_pp_cfg.rgb_resolution = 16;		break;	case V4L2_PIX_FMT_UYVY:		g_pp_cfg.red_width = 0;		g_pp_cfg.green_width = 0;		g_pp_cfg.blue_width = 0;		g_pp_cfg.red_offset = 0;		g_pp_cfg.green_offset = 0;		g_pp_cfg.blue_offset = PP_PIX_UYVY;		g_pp_cfg.rgb_resolution = 16;		break;	case V4L2_PIX_FMT_RGB565:	default:		g_pp_cfg.red_width = 5;		g_pp_cfg.green_width = 6;		g_pp_cfg.blue_width = 5;		g_pp_cfg.red_offset = 11;		g_pp_cfg.green_offset = 5;		g_pp_cfg.blue_offset = 0;		g_pp_cfg.rgb_resolution = 16;		break;	}	if (vout->ipu_buf[0] != -1)		g_pp_cfg.ptr.y =		    (unsigned int)vout->queue_buf_paddr[vout->ipu_buf[0]];	else		g_pp_cfg.ptr.y = 0;	g_pp_cfg.ptr.u = g_pp_cfg.ptr.v = g_pp_cfg.ptr.qp = 0;	g_pp_cfg.dim.in.width = vout->v2f.fmt.pix.width;	g_pp_cfg.dim.in.height = vout->v2f.fmt.pix.height;	g_pp_cfg.dim.out.width = vout->crop_current.width;	g_pp_cfg.dim.out.height = vout->crop_current.height;	g_pp_cfg.dim.num.width = 0;	g_pp_cfg.dim.num.height = 0;	g_pp_cfg.dim.den.width = 0;	g_pp_cfg.dim.den.height = 0;	if (scale_2d(&g_pp_cfg.dim)) {		pr_debug("unsupported resize ratio.\n");		return -1;	}	g_pp_cfg.dim.out.width = vout->crop_current.width;	g_pp_cfg.dim.out.height = vout->crop_current.height;	g_pp_cfg.in_y_stride = 0;	if (set_output_addr(&g_pp_cfg, vout)) {		pr_debug("failed to set pp output address.\n");		return -1;	}	return pphw_cfg(&g_pp_cfg);}irqreturn_t mxc_v4l2out_pp_in_irq_handler(int irq, void *dev_id);/*! * @brief PP IRQ handler. */static irqreturn_t pp_isr(int irq, void *dev_id){	int status;	vout_data *vout = dev_id;	status = pphw_isr();	if ((status & 0x1) == 0) {	/* Not frame complete interrupt */		pr_debug("not pp frame complete interrupt\n");		return IRQ_HANDLED;	}	if (vout->v4l2_fb.flags == V4L2_FBUF_FLAG_OVERLAY) {		g_disp_num = g_disp_num ? 0 : 1;		g_pp_cfg.outptr = (unsigned int)vout->display_bufs[g_disp_num];		pphw_outptr(&g_pp_cfg);	}	return mxc_v4l2out_pp_in_irq_handler(irq, dev_id);}/*! * @brief Set PP output address. * @param cfg	Pointer to emma_pp_cfg structure * @param vout	Pointer to _vout_data structure * @return	Zero on success, others on failure */static int set_output_addr(emma_pp_cfg * cfg, vout_data * vout){	if (vout->v4l2_fb.flags == V4L2_FBUF_FLAG_OVERLAY) {		g_disp_num = 0;		cfg->outptr = (unsigned int)vout->display_bufs[g_disp_num];		cfg->out_stride = vout->crop_current.width;		return 0;	} else {		struct fb_info *fb;		fb = registered_fb[vout->output_fb_num[vout->cur_disp_output]];		if (!fb)			return -1;		cfg->outptr = fb->fix.smem_start;		cfg->outptr += vout->crop_current.top * fb->var.xres_virtual		    * (fb->var.bits_per_pixel >> 3)		    + vout->crop_current.left * (fb->var.bits_per_pixel >> 3);		cfg->out_stride = fb->var.xres_virtual;		return 0;	}}/*! * @brief Get maximum common divisor. * @param x	First input value * @param y	Second input value * @return	Maximum common divisor of x and y */static int gcd(int x, int y){	int k;	if (x < y) {		k = x;		x = y;		y = k;	}	while ((k = x % y)) {		x = y;		y = k;	}	return y;}/*! * @brief Get ratio. * @param x	First input value * @param y	Second input value * @param den	Denominator of the ratio (corresponding to y) * @return	Numerator of the ratio (corresponding to x) */static int ratio(int x, int y, int *den){	int g;	if (!x || !y)		return 0;	g = gcd(x, y);	*den = y / g;	return x / g;}/*! * @brief Build PP coefficient entry * Build one or more coefficient entries for PP coefficient table based * on given coefficient. * * @param k	The index of the coefficient in coefficient table * @param coeff	The weighting coefficient * @param base	The base of the coefficient * @param nxt	Number of pixels to be read * * @return	The index of the next coefficient entry on success *		-1 on failure */static int scale_0d(int k, int coeff, int base, int nxt){	if (k >= PP_TBL_MAX) {		/* no more space in table */		pr_debug("no space in scale table, k = %d\n", k);		return -1;	}	coeff = ((coeff << BC_COEF) + (base >> 1)) / base;	/*	 * Valid values for weighting coefficient are 0, 2 to 30, and 31.	 * A value of 31 is treated as 32 and therefore 31 is an	 * invalid co-efficient.	 */	if (coeff >= SZ_COEF - 1)		coeff--;	else if (coeff == 1)		coeff++;	coeff = coeff << BC_NXT;	if (nxt < SZ_NXT) {		coeff |= nxt;		coeff <<= 1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品久久久久影院色| 国产亚洲一区二区三区四区| 亚洲欧美激情一区二区| 成人免费观看视频| 亚洲免费观看高清完整版在线观看 | 国产成人精品免费看| 欧美一区二区福利视频| 日韩vs国产vs欧美| 精品国产免费久久| 成人毛片老司机大片| 亚洲天堂成人在线观看| 精品视频在线看| 美腿丝袜一区二区三区| 国产欧美精品一区aⅴ影院| a级高清视频欧美日韩| 亚洲一二三级电影| 日韩欧美高清dvd碟片| 国产精品亚洲第一区在线暖暖韩国| 欧美激情一区三区| 欧美性大战久久| 麻豆91在线观看| 国产精品护士白丝一区av| 91免费视频大全| 美女一区二区在线观看| 中文字幕的久久| 欧美日韩一区不卡| 国产精品一区二区在线观看不卡| 亚洲色图一区二区| 日韩一级完整毛片| 99精品一区二区| 免费人成网站在线观看欧美高清| 国产精品婷婷午夜在线观看| 欧美色窝79yyyycom| 国产黄色成人av| 亚洲h在线观看| 国产精品入口麻豆九色| 国产三级三级三级精品8ⅰ区| 成人avav影音| 日本中文字幕一区二区视频| 国产精品毛片无遮挡高清| 欧美精品在线观看一区二区| 高清shemale亚洲人妖| 天堂一区二区在线| 欧美激情一区二区三区蜜桃视频| 欧美欧美欧美欧美| 99国产欧美另类久久久精品| 激情都市一区二区| 亚洲妇女屁股眼交7| 国产欧美久久久精品影院| 制服视频三区第一页精品| 亚洲三级在线免费| 国产精品三级av在线播放| 欧美久久久久久蜜桃| 成人动漫av在线| 欧美日韩国产不卡| 麻豆91在线看| 亚洲国产精品嫩草影院| 国产精品久久福利| 欧美精品一区二区高清在线观看| 欧美中文字幕亚洲一区二区va在线 | 成人精品高清在线| 激情六月婷婷久久| 免费在线观看不卡| 偷拍日韩校园综合在线| 亚洲永久免费视频| 日韩伦理电影网| 裸体歌舞表演一区二区| 一区二区成人在线视频| 亚洲欧洲国产日韩| 亚洲国产激情av| 久久久99免费| 欧美精品一区二区三区蜜臀| 日韩一区国产二区欧美三区| 欧美精品123区| 欧美日本精品一区二区三区| 精品1区2区3区| 欧美色图在线观看| 69av一区二区三区| 欧美肥妇bbw| 3751色影院一区二区三区| 欧美日韩成人激情| 在线91免费看| 欧美大度的电影原声| 日韩精品专区在线影院重磅| 欧美大片国产精品| 久久久综合精品| 国产精品视频看| 日韩伦理免费电影| 一区二区三区视频在线观看| 亚洲高清视频中文字幕| 亚洲国产综合在线| 日本网站在线观看一区二区三区| 五月激情综合婷婷| 久久国产免费看| 国产91精品欧美| 一本一道综合狠狠老| 欧美性感一区二区三区| 日韩欧美国产小视频| 欧美精品一区二区久久婷婷| 欧美极品xxx| 亚洲美女免费在线| 日韩av电影免费观看高清完整版| 日本aⅴ亚洲精品中文乱码| 激情伊人五月天久久综合| 国产精品影音先锋| 91国偷自产一区二区开放时间 | 欧美日本在线看| 欧美不卡视频一区| 中文在线一区二区| 亚洲与欧洲av电影| 九九九精品视频| 一本大道av伊人久久综合| 欧美另类高清zo欧美| 久久夜色精品国产噜噜av| 国产精品天美传媒沈樵| 亚洲第一福利视频在线| 激情偷乱视频一区二区三区| 91丨porny丨首页| 日韩欧美亚洲一区二区| 国产精品久久久久久久蜜臀| 亚洲成人综合视频| 国产精品1区2区3区在线观看| 91福利视频久久久久| 精品少妇一区二区三区在线视频| 亚洲欧美激情一区二区| 久久精品国产澳门| 色婷婷久久99综合精品jk白丝| 日韩一区二区三区四区五区六区| 中文字幕五月欧美| 久久精品国产免费看久久精品| 一本到三区不卡视频| 2021久久国产精品不只是精品| 亚洲一区二区三区视频在线| 国产麻豆一精品一av一免费| 欧美日韩精品是欧美日韩精品| 国产日韩欧美电影| 久久精品免费看| 国产精品美女久久久久aⅴ| 三级欧美在线一区| 99久久伊人精品| 久久久精品蜜桃| 婷婷开心激情综合| 日本乱码高清不卡字幕| 国产欧美1区2区3区| 麻豆极品一区二区三区| 欧美日韩高清在线| 亚洲男人电影天堂| 波多野结衣在线一区| 久久精品欧美日韩精品| 轻轻草成人在线| 欧美日韩夫妻久久| 亚洲黄色免费电影| 91一区一区三区| 国产精品麻豆欧美日韩ww| 精品一区二区久久久| 日韩一区二区三区免费看| 亚洲国产精品久久久久秋霞影院 | 欧美大胆一级视频| 肉肉av福利一精品导航| 欧美性猛交一区二区三区精品| 中文字幕亚洲欧美在线不卡| 国产成人aaaa| 国产欧美精品区一区二区三区| 国产一区二区久久| 久久久亚洲国产美女国产盗摄| 免费成人小视频| 日韩精品一区二区三区在线| 日本伊人色综合网| 日韩欧美国产一二三区| 久久国内精品自在自线400部| 日韩免费观看2025年上映的电影| 亚洲成人av免费| 91国产免费看| 欧美激情在线一区二区| 懂色中文一区二区在线播放| 国产亚洲一区字幕| 成人国产精品免费观看视频| 国产精品欧美一级免费| 精品不卡在线视频| 国产一区二区在线看| 久久亚洲免费视频| 成人一区二区在线观看| 日韩理论片中文av| 在线欧美小视频| 日韩国产欧美在线播放| 日韩一区二区麻豆国产| 国产一区亚洲一区| 国产精品女同互慰在线看| 色天天综合色天天久久| 亚洲va天堂va国产va久| 日韩精品在线一区| 国产成人av电影| 亚洲国产精品久久人人爱蜜臀| 69成人精品免费视频| 国产精品中文字幕一区二区三区| 国产午夜亚洲精品理论片色戒| 99国产精品久久久| 日韩电影在线观看一区| 国产午夜亚洲精品理论片色戒| 日本高清不卡aⅴ免费网站|