static void yv12_to_rgb24 (unsigned char *src, unsigned char *dest, int width, int height)
{
register int i, j;
register int y0, y1, u, v;
register int r, g, b;
register unsigned char *s[3];
s[0] = src;
s[1] = s[0] + width*height;
s[2] = s[1] + width*height/4;
for (i = 0; i < height; i++) {
for (j = 0; j < width/2; j++) {
y0 = *(s[0])++;
y1 = *(s[0])++;
if (i % 2 == 0 ) {
u = *(s[1])++ - 128;
v = *(s[2])++ - 128;
}
YUV2RGB (y0, u, v, r, g, b);
*dest++ = r;
*dest++ = g;
*dest++ = b;
YUV2RGB (y1, u, v, r, g, b);
*dest++ = r;
*dest++=g;
*dest++=b;
}
}
}
YV12转RGB24
最新推荐文章于 2021-02-23 19:43:32 发布