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

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

?? camif.c

?? 2440 開發板的測試程序。包括uart,iic,lcd
?? C
?? 第 1 頁 / 共 3 頁
字號:
		divisor = 4; //CCIR-420

	//constant for calculating preview dma address
	if ( CAM_PVIEW_OUTPUT )
		multiplier = 4;
	else
		multiplier = 2;

	if ( WinHorOffset == 0 && WinVerOffset == 0 )
		WinOfsEn = 0;
	else
		WinOfsEn = 1;

	SrcWidth = CAM_SRC_HSIZE - WinHorOffset * 2;
	SrcHeight = CAM_SRC_VSIZE - WinVerOffset * 2;

	if ( SrcWidth >= CoDstWidth )
		ScaleUp_H_Co = 0; //down
	else
		ScaleUp_H_Co = 1;		//up

	if ( SrcHeight >= CoDstHeight )
		ScaleUp_V_Co = 0;
	else
		ScaleUp_V_Co = 1;		

	if ( SrcWidth >= PrDstWidth )
		ScaleUp_H_Pr = 0; //down
	else
		ScaleUp_H_Pr = 1;		//up

	if ( SrcHeight >= PrDstHeight )
		ScaleUp_V_Pr = 0;   // edited 040225
	else
		ScaleUp_V_Pr = 1;		

	////////////////// common control setting
	rCIGCTRL |= ( 1 << 26 ) | ( 0 << 27 ); // inverse PCLK, test pattern--- hzh
	//rCIGCTRL |= (0<<26)|(0<<27); // don't inverse PCLK, test pattern
	rCIWDOFST = ( 1 << 30 ) | ( 0xf << 12 ); // clear overflow 
	rCIWDOFST = 0 ;	
	rCIWDOFST = ( WinOfsEn << 31 ) | ( WinHorOffset << 16 ) | ( WinVerOffset );
	rCISRCFMT = ( CAM_ITU656 << 31 ) |
		( 1 << 30 ) |
		( 0 << 29 ) |
		( CAM_SRC_HSIZE << 16 ) |
		( CAM_ORDER_YCBYCR << 14 ) |
		( CAM_SRC_VSIZE );
	//--- hzh
	//rCISRCFMT=(CAM_ITU601<<31)|(1<<30)|(0<<29)|(CAM_SRC_HSIZE<<16)|(CAM_ORDER_YCBYCR<<14)|(CAM_SRC_VSIZE);
	//---

	////////////////// codec port setting
	if ( CAM_CODEC_4PP )
	{
		rCICOYSA1 = CoFrameBuffer;
		rCICOYSA2 = rCICOYSA1 + CoDstWidth * CoDstHeight + 2 * CoDstWidth * CoDstHeight / divisor;
		rCICOYSA3 = rCICOYSA2 + CoDstWidth * CoDstHeight + 2 * CoDstWidth * CoDstHeight / divisor;
		rCICOYSA4 = rCICOYSA3 + CoDstWidth * CoDstHeight + 2 * CoDstWidth * CoDstHeight / divisor;

		rCICOCBSA1 = rCICOYSA1 + CoDstWidth * CoDstHeight;
		rCICOCBSA2 = rCICOYSA2 + CoDstWidth * CoDstHeight;
		rCICOCBSA3 = rCICOYSA3 + CoDstWidth * CoDstHeight;
		rCICOCBSA4 = rCICOYSA4 + CoDstWidth * CoDstHeight;

		rCICOCRSA1 = rCICOCBSA1 + CoDstWidth * CoDstHeight / divisor;
		rCICOCRSA2 = rCICOCBSA2 + CoDstWidth * CoDstHeight / divisor;
		rCICOCRSA3 = rCICOCBSA3 + CoDstWidth * CoDstHeight / divisor;
		rCICOCRSA4 = rCICOCBSA4 + CoDstWidth * CoDstHeight / divisor;
	}
	else
	{
		rCICOYSA1 = CoFrameBuffer;
		rCICOYSA2 = rCICOYSA1;
		rCICOYSA3 = rCICOYSA1;
		rCICOYSA4 = rCICOYSA1;

		rCICOCBSA1 = rCICOYSA1 + CoDstWidth * CoDstHeight;
		rCICOCBSA2 = rCICOCBSA1;
		rCICOCBSA3 = rCICOCBSA1;
		rCICOCBSA4 = rCICOCBSA1;

		rCICOCRSA1 = rCICOCBSA1 + CoDstWidth * CoDstHeight / divisor;
		rCICOCRSA2 = rCICOCRSA1;
		rCICOCRSA3 = rCICOCRSA1;
		rCICOCRSA4 = rCICOCRSA1;
	}
	
	rCICOTRGFMT = ( CAM_CODEC_IN_422 << 31 ) |
		( CAM_CODEC_OUTPUT << 30 ) |
		( CoDstWidth << 16 ) |
		( CAM_FLIP_NORMAL << 14 ) |
		( CoDstHeight );

	CalculateBurstSize( CoDstWidth , &MainBurstSizeY , &RemainedBurstSizeY );
	CalculateBurstSize( CoDstWidth / 2 , &MainBurstSizeC , &RemainedBurstSizeC );
	rCICOCTRL = ( MainBurstSizeY << 19 ) |
		( RemainedBurstSizeY << 14 ) |
		( MainBurstSizeC << 9 ) |
		( RemainedBurstSizeC << 4 );

	CalculatePrescalerRatioShift( SrcWidth , CoDstWidth , &PreHorRatio , &H_Shift );
	CalculatePrescalerRatioShift( SrcHeight , CoDstHeight , &PreVerRatio , &V_Shift );
	MainHorRatio = ( SrcWidth << 8 ) / ( CoDstWidth << H_Shift );
	MainVerRatio = ( SrcHeight << 8 ) / ( CoDstHeight << V_Shift );

	rCICOSCPRERATIO = ( ( 10 - H_Shift - V_Shift ) << 28 ) | ( PreHorRatio << 16 ) | ( PreVerRatio );
	rCICOSCPREDST = ( ( SrcWidth / PreHorRatio ) << 16 ) | ( SrcHeight / PreVerRatio ); 
	rCICOSCCTRL = ( CAM_SCALER_BYPASS_OFF << 31 ) |
		( ScaleUp_H_Co << 30 ) |
		( ScaleUp_V_Co << 29 ) |
		( MainHorRatio << 16 ) |
		( MainVerRatio );

	rCICOTAREA = CoDstWidth * CoDstHeight;

	///////////////// preview port setting
	if ( CAM_PVIEW_4PP ) // codec view mode
	{
		rCIPRCLRSA1 = PrFrameBuffer;
		rCIPRCLRSA2 = rCIPRCLRSA1 + PrDstWidth * PrDstHeight * multiplier;
		rCIPRCLRSA3 = rCIPRCLRSA2 + PrDstWidth * PrDstHeight * multiplier;
		rCIPRCLRSA4 = rCIPRCLRSA3 + PrDstWidth * PrDstHeight * multiplier;
	}
	else // direct preview mode
	{
		rCIPRCLRSA1 = ( U32 ) LCD_BUFFER_CAM;
		rCIPRCLRSA2 = ( U32 ) LCD_BUFFER_CAM;
		rCIPRCLRSA3 = ( U32 ) LCD_BUFFER_CAM;
		rCIPRCLRSA4 = ( U32 ) LCD_BUFFER_CAM;
	}	

	rCIPRTRGFMT = ( PrDstWidth << 16 ) | ( CAM_FLIP_NORMAL << 14 ) | ( PrDstHeight );

	if ( CAM_PVIEW_OUTPUT == CAM_RGB24B )
		CalculateBurstSize( PrDstWidth * 2 , &MainBurstSizeRGB , &RemainedBurstSizeRGB );
	else // RGB16B
		CalculateBurstSize( PrDstWidth * 2 , &MainBurstSizeRGB , &RemainedBurstSizeRGB );
	rCIPRCTRL = ( MainBurstSizeRGB << 19 ) | ( RemainedBurstSizeRGB << 14 );

	CalculatePrescalerRatioShift( SrcWidth , PrDstWidth , &PreHorRatio , &H_Shift );
	CalculatePrescalerRatioShift( SrcHeight , PrDstHeight , &PreVerRatio , &V_Shift );
	MainHorRatio = ( SrcWidth << 8 ) / ( PrDstWidth << H_Shift );
	MainVerRatio = ( SrcHeight << 8 ) / ( PrDstHeight << V_Shift );
	rCIPRSCPRERATIO = ( ( 10 - H_Shift - V_Shift ) << 28 ) | ( PreHorRatio << 16 ) | ( PreVerRatio );		 
	rCIPRSCPREDST = ( ( SrcWidth / PreHorRatio ) << 16 ) | ( SrcHeight / PreVerRatio );
	rCIPRSCCTRL = ( 1 << 31 ) |
		( CAM_PVIEW_OUTPUT << 30 ) |
		( ScaleUp_H_Pr << 29 ) |
		( ScaleUp_V_Pr << 28 ) |
		( MainHorRatio << 16 ) |
		( MainVerRatio );

	rCIPRTAREA = PrDstWidth * PrDstHeight;
}



/********************************************************
 CalculateBurstSize - Calculate the busrt lengths
 
 Description:	
 - dstHSize: the number of the byte of H Size.
 
*/
void CalculateBurstSize( U32 hSize , U32* mainBurstSize , U32* remainedBurstSize )
{
	U32 tmp;	
	tmp = ( hSize / 4 ) % 16;
	switch ( tmp )
	{
		case 0:
			*mainBurstSize = 16;
			*remainedBurstSize = 16;
			break;
		case 4:
			*mainBurstSize = 16;
			*remainedBurstSize = 4;
			break;
		case 8:
			*mainBurstSize = 16;
			*remainedBurstSize = 8;
			break;
		default:
			tmp = ( hSize / 4 ) % 8;
			switch ( tmp )
			{
				case 0:
					*mainBurstSize = 8;
					*remainedBurstSize = 8;
					break;
				case 4:
					*mainBurstSize = 8;
					*remainedBurstSize = 4;
				default:
					*mainBurstSize = 4;
					tmp = ( hSize / 4 ) % 4;
					*remainedBurstSize = ( tmp ) ? tmp : 4;
					break;
			}
			break;
	}
}



/********************************************************
 CalculatePrescalerRatioShift - none
 
 Description:	
 - none
 
*/
void CalculatePrescalerRatioShift( U32 SrcSize , U32 DstSize , U32* ratio , U32* shift )
{
	if ( SrcSize >= 64 * DstSize )
	{
		Uart_Printf( "ERROR: out of the prescaler range: SrcSize/DstSize = %d(< 64)\n" , SrcSize / DstSize );
		while ( 1 );
	}
	else if ( SrcSize >= 32 * DstSize )
	{
		*ratio = 32;
		*shift = 5;
	}
	else if ( SrcSize >= 16 * DstSize )
	{
		*ratio = 16;
		*shift = 4;
	}
	else if ( SrcSize >= 8 * DstSize )
	{
		*ratio = 8;
		*shift = 3;
	}
	else if ( SrcSize >= 4 * DstSize )
	{
		*ratio = 4;
		*shift = 2;
	}
	else if ( SrcSize >= 2 * DstSize )
	{
		*ratio = 2;
		*shift = 1;
	}
	else
	{
		*ratio = 1;
		*shift = 0;
	}
}


/********************************************************
 CamCaptureStart - Start camera capture operation.
 
 Description:	
 - mode= CAM_CODEC_CAPTURE_ENABLE_BIT or CAM_PVIEW_CAPTURE_ENABLE_BIT or both
  
*/
void CamCaptureStart( U32 mode )
{
	if ( mode & CAM_CODEC_SCALER_CAPTURE_ENABLE_BIT )
	{
		camCodecStatus = CAM_STARTED;
		rCICOSCCTRL |= CAM_CODEC_SACLER_START_BIT;
	}

	if ( mode & CAM_PVIEW_SCALER_CAPTURE_ENABLE_BIT )
	{
		camPviewStatus = CAM_STARTED;
		rCIPRSCCTRL |= CAM_PVIEW_SACLER_START_BIT;
	}

	if ( mode & CAM_CAMIF_GLOBAL_CAPTURE_ENABLE_BIT )
	{
		camCodecStatus = CAM_STARTED;
		rCICOSCCTRL |= CAM_CAMIF_GLOBAL_CAPTURE_ENABLE_BIT;
	}

	rCIIMGCPT |= CAM_CAMIF_GLOBAL_CAPTURE_ENABLE_BIT | mode;
}


void CamCaptureStop( void )
{
	camCodecStatus = CAM_STOP_ISSUED;
	camPviewStatus = CAM_STOP_ISSUED;
}


void _CamCodecStopHw( void )
{
	rCICOSCCTRL &= ~CAM_CODEC_SACLER_START_BIT; //stop codec scaler.
	rCIIMGCPT &= ~CAM_CODEC_SCALER_CAPTURE_ENABLE_BIT; //stop capturing for codec scaler.
	if ( !( rCIIMGCPT & CAM_PVIEW_SCALER_CAPTURE_ENABLE_BIT ) )
		rCIIMGCPT &= ~CAM_CAMIF_GLOBAL_CAPTURE_ENABLE_BIT; //stop capturing for preview scaler if needed.
	rCICOCTRL |= ( 1 << 2 ); //Enable last IRQ at the end of frame capture.
	//NOTE:LastIrqEn bit should be set after clearing CAPTURE_ENABLE_BIT & SCALER_START_BIT
}

void _CamPviewStopHw( void )
{
	rCIPRSCCTRL &= ~CAM_PVIEW_SACLER_START_BIT; //stop preview scaler.
	rCIIMGCPT &= ~CAM_PVIEW_SCALER_CAPTURE_ENABLE_BIT; //stop capturing for preview scaler.
	if ( !( rCIIMGCPT & CAM_CODEC_SCALER_CAPTURE_ENABLE_BIT ) )
		rCIIMGCPT &= ~CAM_CAMIF_GLOBAL_CAPTURE_ENABLE_BIT; //stop capturing for codec scaler if needed.
	rCIPRCTRL |= ( 1 << 2 ); //Enable last IRQ at the end of frame capture.
	//NOTE:LastIrqEn bit should be set after clearing CAPTURE_ENABLE_BIT & SCALER_START_BIT
}


void __irq CamIsr( void )
{
	U32 completedFrameIndex;

	if ( rSUBSRCPND & BIT_SUB_CAM_C )
	{
		Uart_Printf("[C]");
		rGPFDAT ^= 1 << 5;	//hzh
		CamCodecIntMask();
		rSUBSRCPND |= BIT_SUB_CAM_C;
		ClearPending( BIT_CAM );
		switch ( camCodecStatus )
		{
			case CAM_STOP_ISSUED:
				_CamCodecStopHw();
				camCodecStatus = CAM_LAST_CAPTURING;
				Uart_Printf( "cr=%x\n" , rCICOCTRL );
				//Uart_Printf("cS1\n");
				break;
			case CAM_LAST_CAPTURING:
				camCodecStatus = CAM_STOPPED;
				CamCodecIntMask();			
				//Uart_Printf("cS2\n");
				return;
			case CAM_STARTED:
				flagCaptured_C = 1;
				//				_CamCodecStopHw();
				if ( camTestMode & CAM_TEST_MODE_CODEC )
				{
					if ( camCodecCaptureCount > 0 )
						completedFrameIndex = ( ( ( rCICOSTATUS >> 26 ) & 0x3 ) + 4 - 2 ) % 4;   
					//Uart_Printf("FrameIndex:%d\n",completedFrameIndex);
				}
				else
				{
					//Uart_Printf("Just Capturing without display");
				}
				break;
			case CAM_CODEC_SCALER_BYPASS_STATE:
				//Uart_Printf("cBP\n");
				break;
			default:
				break;
		}

		CamCodecIntUnmask();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人avav影音| 日韩精品国产精品| 成人自拍视频在线观看| 国产欧美精品日韩区二区麻豆天美| 久久狠狠亚洲综合| 日韩欧美国产一二三区| 国产在线精品视频| 中文字幕av一区 二区| 99国产精品久久久久久久久久久| 国产精品污www在线观看| 大尺度一区二区| 亚洲欧美日本在线| 欧美日韩一区二区在线观看视频| 日韩精品电影一区亚洲| 2021中文字幕一区亚洲| 成人一区二区视频| 亚洲永久精品大片| 精品三级在线观看| 99在线精品观看| 成人爱爱电影网址| 亚洲一区精品在线| 日韩欧美激情四射| 97久久精品人人爽人人爽蜜臀| 一区二区在线观看视频在线观看| 欧美日本一区二区| 国产成人综合亚洲网站| 一区二区三区日韩欧美| 久久综合色之久久综合| 91麻豆免费观看| 老司机精品视频导航| 中文字幕五月欧美| 欧美变态tickle挠乳网站| 99久久精品免费观看| 青娱乐精品视频| 综合欧美亚洲日本| 欧美精品一区二区蜜臀亚洲| www.在线欧美| 男男视频亚洲欧美| 亚洲欧洲综合另类在线| 精品成人私密视频| 欧美色国产精品| 成人做爰69片免费看网站| 日韩中文欧美在线| 亚洲女爱视频在线| 久久亚洲捆绑美女| 欧美狂野另类xxxxoooo| 成人高清视频在线| 激情久久久久久久久久久久久久久久| 中文字幕日韩精品一区 | 国产女主播视频一区二区| 91国在线观看| 国产成人8x视频一区二区 | 91福利资源站| 国产成人精品网址| 久久99久久精品| 亚洲高清免费观看| 亚洲黄色小视频| 国产欧美一区二区三区在线看蜜臀| 欧美揉bbbbb揉bbbbb| av亚洲精华国产精华| 国产一区二区三区在线观看免费视频| 无吗不卡中文字幕| 午夜成人免费电影| 一区二区三区精品久久久| 中文字幕综合网| 中文字幕精品一区二区精品绿巨人| 日韩精品中午字幕| 欧美一区二区视频网站| 69p69国产精品| 欧美精品九九99久久| 欧美精品一区二区三区蜜桃| 777a∨成人精品桃花网| 欧美视频在线一区二区三区| 色婷婷久久综合| 91网站在线观看视频| 成人的网站免费观看| 99精品黄色片免费大全| 99天天综合性| 色综合天天做天天爱| 91一区二区三区在线播放| av在线综合网| 91猫先生在线| 欧美美女网站色| 7777精品伊人久久久大香线蕉超级流畅| 欧美性大战久久久| 欧美日韩精品福利| 欧美高清hd18日本| 日韩一级在线观看| 精品国产乱码久久久久久蜜臀| 欧美大片拔萝卜| 亚洲精品在线观看网站| 久久久久久亚洲综合| 国产亚洲成av人在线观看导航| 久久久久久99精品| 国产精品免费久久| 一区二区三区四区在线| 亚洲高清久久久| 韩国精品在线观看| 成人免费看片app下载| 色综合天天天天做夜夜夜夜做| 在线视频综合导航| 欧美一级免费观看| 日韩电影在线免费观看| 老司机精品视频线观看86| 成人综合在线网站| 欧美性猛交xxxx黑人交 | 久久综合色鬼综合色| 日本一区二区三区四区在线视频| 亚洲视频1区2区| 午夜精品久久久久久久久久| 麻豆一区二区三| 国产成人无遮挡在线视频| 色综合中文字幕| 日韩视频国产视频| 国产精品久久久久久久久久久免费看| 一区二区在线观看免费视频播放| 亚洲成av人片一区二区梦乃| 狠狠色丁香久久婷婷综合_中| 成人h动漫精品| 欧美日韩亚洲综合一区| 久久天天做天天爱综合色| 亚洲色图欧美激情| 美女视频黄 久久| 成人av电影在线网| 7777精品伊人久久久大香线蕉完整版 | 亚洲丝袜精品丝袜在线| 视频一区视频二区中文字幕| 国产精品18久久久| 欧美精品丝袜中出| 成人免费在线播放视频| 日本强好片久久久久久aaa| 成人免费看视频| 欧美成人vr18sexvr| 一区二区三区蜜桃| 国产高清不卡一区| 欧美一区二区三区在线看| 国产精品成人午夜| 极品尤物av久久免费看| 91久久香蕉国产日韩欧美9色| 亚洲精品一区二区三区影院| 91在线观看地址| 欧美日韩国产三级| 亚洲欧美自拍偷拍| 另类小说一区二区三区| 91国模大尺度私拍在线视频| 久久蜜臀中文字幕| 蜜桃91丨九色丨蝌蚪91桃色| 在线日韩一区二区| 国产精品成人免费在线| 国产在线日韩欧美| 欧美日韩国产在线观看| 亚洲免费高清视频在线| 成人理论电影网| 日韩欧美综合在线| 亚洲超丰满肉感bbw| 91美女片黄在线| 国产精品国产三级国产aⅴ原创| 狠狠狠色丁香婷婷综合久久五月| 欧美三级一区二区| 亚洲国产美国国产综合一区二区| 99vv1com这只有精品| 久久久久国产精品麻豆| 国内精品伊人久久久久av一坑 | 久久色在线观看| 免费在线观看日韩欧美| 欧美群妇大交群的观看方式| 亚洲免费在线视频一区 二区| 成人禁用看黄a在线| 中文一区在线播放| 成人av第一页| 综合激情网...| 91丨九色丨蝌蚪丨老版| 亚洲三级电影全部在线观看高清| 成人免费黄色在线| 国产精品久久久一本精品| 大尺度一区二区| 国产精品久久看| 色婷婷精品久久二区二区蜜臂av | 欧美午夜不卡在线观看免费| 亚洲欧美另类图片小说| 在线观看日韩国产| 肉色丝袜一区二区| 日韩精品一区二区三区四区视频 | 亚洲高清免费观看高清完整版在线观看 | av中文字幕一区| 亚洲码国产岛国毛片在线| 久久久国际精品| 国产.欧美.日韩| 亚洲视频狠狠干| 欧美午夜一区二区| 日本中文字幕不卡| 久久综合中文字幕| 成人国产精品免费观看视频| 综合在线观看色| 欧美性猛交xxxxxxxx| 蜜臀av国产精品久久久久| 欧美xfplay| 91在线观看下载| 日韩影院免费视频| 国产日韩欧美高清在线|