//摄像头接口寄存器初始化
void CamInit(U32 CoDstWidth, U32 CoDstHeight, U32 PrDstWidth, U32 PrDstHeight,
U32 WinHorOffset, U32 WinVerOffset, U32 CoFrameBuffer, U32 PrFrameBuffer)
{
U32 WinOfsEn;
U32 divisor, multiplier;
U32 MainBurstSizeY, RemainedBurstSizeY, MainBurstSizeC, RemainedBurstSizeC, MainBurstSizeRGB, RemainedBurstSizeRGB;
U32 H_Shift, V_Shift, PreHorRatio, PreVerRatio, MainHorRatio, MainVerRatio;
U32 SrcWidth, SrcHeight;
U32 ScaleUp_H_Co, ScaleUp_V_Co, ScaleUp_H_Pr, ScaleUp_V_Pr;
//constant for calculating codec dma address
if(CAM_CODEC_OUTPUT)
divisor=2; //CCIR-422
else
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;
else ScaleUp_V_Pr=1;
////////////////// common control setting
s2440CAM->rCIGCTRL |= (1