中级会员
 
- 积分
- 291
- 金钱
- 291
- 注册时间
- 2014-8-11
- 在线时间
- 76 小时
|
发表于 2017-6-12 20:55:35
|
显示全部楼层
修改h2v2_merged_upsample ();函数中for循环就可以实现了,红色为修改的部分 ->if(lcdltdc.width!=0)//RGB屏
{
/* Loop for each group of output pixels */
for (col =0 ; col <cinfo->output_width ; col++)
{
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cred = Crrtab[cr];
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 4 Y values and emit 4 pixels */
y = GETJSAMPLE(*inptr00++);
outlinebuf[col++ ] = range_limit[y + cblue] >> 3 | (range_limit[y + cgreen] >> 2) << 5 | (range_limit[y + cred] >> 3) << 11;
y = GETJSAMPLE(*inptr00++);
//pixel.color.B = range_limit[y + cblue] >> 3;
//pixel.color.G = range_limit[y + cgreen] >> 2;
//pixel.color.R = range_limit[y + cred] >> 3;
outlinebuf[col] = range_limit[y + cblue] >> 3 | (range_limit[y + cgreen] >> 2) << 5 | (range_limit[y + cred] >> 3) << 11;
}
LTDC_Color_Fill2(imgoffx,outlinecnt,cinfo->output_width+imgoffx-1,outlinecnt,outlinebuf);//DM2D填充
outlinecnt++;
//inptr00 = input_buf[0][in_row_group_ctr*2];
inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
inptr1 = input_buf[1][in_row_group_ctr];
inptr2 = input_buf[2][in_row_group_ctr];
/* Loop for each group of output pixels */
for (col =0 ; col <cinfo->output_width ; col++)
{
/* Do the chroma part of the calculation */
cb = GETJSAMPLE(*inptr1++);
cr = GETJSAMPLE(*inptr2++);
cred = Crrtab[cr];
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
cblue = Cbbtab[cb];
/* Fetch 4 Y values and emit 4 pixels */
y = GETJSAMPLE(*inptr01++);
//pixel.color.B = range_limit[y + cblue] >> 3;
//pixel.color.G = range_limit[y + cgreen] >> 2;
//pixel.color.R = range_limit[y + cred] >> 3;
outlinebuf[ col++] = range_limit[y + cblue] >> 3 | (range_limit[y + cgreen] >> 2) << 5 | (range_limit[y + cred] >> 3) << 11;
y = GETJSAMPLE(*inptr01++);
//pixel.color.B = range_limit[y + cblue] >> 3;
//pixel.color.G = range_limit[y + cgreen] >> 2;
//pixel.color.R = range_limit[y + cred] >> 3;
outlinebuf[col] = range_limit[y + cblue] >> 3 | (range_limit[y + cgreen] >> 2) << 5 | (range_limit[y + cred] >> 3) << 11;
}
LTDC_Color_Fill2(imgoffx,outlinecnt,cinfo->output_width+imgoffx-1,outlinecnt,outlinebuf);//DM2D填充
outlinecnt++;
/* If image width is odd, do the last output column separately */
//if (cinfo->output_width & 1) //RGB屏,不做处理.
}
|
|