要把它转换为rgb数据才能在lcd屏上显示的,我的显示程序如下,自己研究下吧
unsigned short R,G,B;
unsigned long i;
unsigned short *pDest=NULL;
pDest=malloc(size);
unsigned int x;
unsigned int y;
for( i=0;i<size;i+=4)
{
char Y0 = *(char *)p++;
char U = *(char *)p++;
char Y1 = *(char *)p++;
char V = *(char *)p++;
R=(298*(Y0-16)+409*(V-128)+128)/256;
G=(298*(Y0-16)-100*(U-128)-208*(V-128)+128)/256;
B=(298*(Y0-16)+516*(U-128)+128)/256;
if(R < 0) R = 0;
if(R > 255) R = 255;
if(G < 0) G = 0;
if(G > 255) G = 255;
if(B < 0) B = 0;
if(B > 255) B = 255;
R=R/8;G=G/4;B=B/8;
*pDest=((R<<11)|(G<<5)|B);
pDest++;
R=(298*(Y1-16)+409*(V-128)+128)/256;
G=(298*(Y1-16)-100*(U-128)-208*(V-128)+128)/256;
B=(298*(Y1-16)+516*(U-128)+128)/256;
if(R < 0) R = 0;
if(R > 255) R = 255;
if(G < 0) G = 0;
if(G > 255) G = 255;
if(B < 0) B = 0;
if(B > 255) B = 255;
R=R/8;G=G/4;B=B/8;
*pDest=(R<<11)|(G<<5)|B;
pDest++;
}
pDest=pDest-size;
for(y=0;y<fb_height;y++) //240
{
for(x=0;x<fb_width;x+=1) //320
{
unsigned short color;
color=pDest[y*fb_width+x];
fb_pixel(fbmem+128,fb_width,fb_height,x,y,color);
}
}