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.

OMAPL138摄像头采集及显示问题

我采用ov7725作为视屏数据采集,采用一个2.2寸屏来显示。其中ov7725采集视频分辨率为320*240,2.2寸显示屏分辨率为240*320。ov7725采集的数据是yuv422的,而显示屏是RGB565的,将摄像头采集回来的数据的部分图像做彩色空间转换,用于LCD的显示。我的做法是,建立一个表以Y为下标对应到相应的RGB灰度,表的形式如下:

volatile unsigned short Y2Gray[] = {
0x0000,0x0000,0x0000,0x0000,0x0020,0x0020,0x0020,0x0020,
0x0841,0x0841,0x0841,0x0841,0x0861,0x0861,0x0861,0x0861,
0x1082,0x1082,0x1082,0x1082,0x10a2,0x10a2,0x10a2,0x10a2,
....

0xffdf,0xffdf,0xffdf,0xffdf,0xffff,0xffff,0xffff,0xffff,

};

色彩空间转换的部分如下:

volatile unsigned char *videoTopY, *videoTopC;
volatile unsigned short *videoTopRgb1, *videoTopRgb2;

for(i = 0; i < 240; i++)
{
    for(j = 0; j < 240; j+=8)
    {
        index = i * 240+ j;
        index1 = i * 320+ j;
        videoTopRgb1[index] = Y2Gray[videoTopY[index1 * 2]];
        videoTopRgb1[index + 1] =Y2Gray[videoTopY[(index1 + 1) * 2]];
        videoTopRgb1[index + 2] = Y2Gray[videoTopY[(index1 + 2) * 2]];
        videoTopRgb1[index + 3] = Y2Gray[videoTopY[(index1 + 3) * 2]];
        videoTopRgb1[index + 4] = Y2Gray[videoTopY[(index1 + 4) * 2]];
        videoTopRgb1[index + 5] = Y2Gray[videoTopY[(index1 + 5) * 2]];
        videoTopRgb1[index + 6] = Y2Gray[videoTopY[(index1 + 6) * 2]];
        videoTopRgb1[index + 7] = Y2Gray[videoTopY[(index1 + 7) * 2]];

    }

}

我用的是双buffer显示的。

问题是图像只会显示一半。

使用CCS5.5将DSP内存中的数据保存,放到matlab中显示如下:

我的摄像头采集回来的数据是这样的(图一)

小黑点忽略yuv

理论上处理完成之后应该是这个样子的(图二)

但是dsp处理完数据后显示buff里的数据是这样的(图三,图四):

程序运行过过程中图三,图四是交替显示的。

请问这是为什么?我开了L1cache,cache inv和wb都用了,也不起作用。程序架构是参考startware的lcd_loopback写的。

请TI的工程师帮忙解决一下,困扰了两周了,不胜感激。