This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请问,DM368上边的黑边怎么裁剪掉



请问专家:

送入DM368的数据格式为rawdata, 送入的数据一帧中上下有无效数据,一行中前后也有无效数据;有效像素为1920×1080。故在我使用formatter模块前,左边跟右边都有黑边,使能formatter模块后左边的黑边被裁剪掉了,但是上边的黑边无法裁剪。

修改的代码如下:

df_csc->start_pix = 64;
 df_csc->num_pixels= 1919;
 df_csc->start_line = 16;
 df_csc->num_lines = 1087;

 regw(0, CSCCTL);
 printk("\n###   Disable CSC   ###\n");

 tval = regr(FMTCFG);
 tval |= 0x01;  //FMTEN=1;
 tval &= 0xFFFFFFFD; //FMTCBL=0;
 tval &= 0xFFFFF0FF; //FMTAINC=0+1
 tval &= 0xFFFFFFCF; //LNUM=0 one line
 regw(tval, FMTCFG);

 regw(df_csc->start_pix & CCDC_DF_CSC_SPH_MASK, FMTSPH); //输入列起始
 regw((df_csc->num_pixels) & CCDC_DF_CSC_SPH_MASK, FMTLNH); //输入列长度
 regw(df_csc->start_line & CCDC_DF_CSC_SPH_MASK, FMTSLV); //输入行起始
 regw((df_csc->num_lines) & CCDC_DF_CSC_SPH_MASK, FMTLNV); //输入行长度
 regw(df_csc->num_pixels+1, FMTRLEN); //输出行像素个数

 tval = regr(FMTPLEN);
 tval &= 0xFFFFFF00;  //FMTPLEN0=0 FMTPLEN1=0 SET0使用0+1个APTR
 regw(tval, FMTPLEN);

 regw(0x0, FMTAPTR(0)); //line=0 init=0

 tval = regr(FMTPGMVF0);
 tval |= 0x01;   //enable PGM0EN
 regw(tval, FMTPGMVF0);

 tval = regr(FMTPGMVF1);
 tval |= 0x01;   //enable PGM16EN
 regw(tval, FMTPGMVF1);

 tval = regr(FMTPGMAPS0);
 tval &= 0xFFFFFFF0;  //PGM0APTR select APTR0
 regw(tval, FMTPGMAPS0);

 tval = regr(FMTPGMAPS4);
 tval &= 0xFFFFFFF0;  //PGM16APTR select APTR0
 regw(tval, FMTPGMAPS4);

 regw(0, SPH);
 regw(df_csc->num_pixels, LNH);
 regw(df_csc->start_line+1, SLV0);
 regw(df_csc->start_line+1, SLV1);
 regw(df_csc->num_lines+1, LNV);

 

另:按文档中的描述,我不知道LNV是怎么计算的?

ILC是什么?若按例子中的FMTLNV为4589,4589+1+ILC+1-1=ILC+4590 最后结果是怎么等于1529的呢?