videotestsrc: Add support for packed 4:4:4 YUV (format=V308)

Partially fixes bug #571147.
This commit is contained in:
Sebastian Dröge 2009-02-12 18:17:53 +01:00
parent a624df17c4
commit 79d0fff231

View file

@ -311,6 +311,7 @@ static void paint_setup_Y42B (paintinfo * p, unsigned char *dest);
static void paint_setup_Y444 (paintinfo * p, unsigned char *dest);
static void paint_setup_Y800 (paintinfo * p, unsigned char *dest);
static void paint_setup_AYUV (paintinfo * p, unsigned char *dest);
static void paint_setup_V308 (paintinfo * p, unsigned char *dest);
static void paint_setup_NV12 (paintinfo * p, unsigned char *dest);
static void paint_setup_NV21 (paintinfo * p, unsigned char *dest);
@ -345,6 +346,7 @@ static void paint_hline_Y41B (paintinfo * p, int x, int y, int w);
static void paint_hline_Y42B (paintinfo * p, int x, int y, int w);
static void paint_hline_Y444 (paintinfo * p, int x, int y, int w);
static void paint_hline_Y800 (paintinfo * p, int x, int y, int w);
static void paint_hline_V308 (paintinfo * p, int x, int y, int w);
static void paint_hline_AYUV (paintinfo * p, int x, int y, int w);
#if 0
@ -365,6 +367,7 @@ struct fourcc_list_struct fourcc_list[] = {
{VTS_YUV, "Y422", "Y422", 16, paint_setup_UYVY, paint_hline_YUY2},
{VTS_YUV, "UYNV", "UYNV", 16, paint_setup_UYVY, paint_hline_YUY2}, /* FIXME: UYNV? */
{VTS_YUV, "YVYU", "YVYU", 16, paint_setup_YVYU, paint_hline_YUY2},
{VTS_YUV, "V308", "V308", 24, paint_setup_V308, paint_hline_V308},
{VTS_YUV, "AYUV", "AYUV", 32, paint_setup_AYUV, paint_hline_AYUV},
/* interlaced */
@ -1391,6 +1394,16 @@ paint_setup_YV12 (paintinfo * p, unsigned char *dest)
p->endptr = p->up + p->ustride * GST_ROUND_UP_2 (p->height) / 2;
}
static void
paint_setup_V308 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
p->up = dest + 1;
p->vp = dest + 2;
p->ystride = GST_ROUND_UP_4 (p->width * 3);
p->endptr = dest + p->ystride * p->height;
}
static void
paint_setup_AYUV (paintinfo * p, unsigned char *dest)
{
@ -1432,6 +1445,17 @@ paint_setup_YVYU (paintinfo * p, unsigned char *dest)
p->endptr = dest + p->ystride * p->height;
}
static void
paint_hline_V308 (paintinfo * p, int x, int y, int w)
{
int offset;
offset = (y * p->ystride) + (x * 3);
oil_splat_u8 (p->yp + offset, 3, &p->yuv_color->Y, w);
oil_splat_u8 (p->up + offset, 3, &p->yuv_color->U, w);
oil_splat_u8 (p->vp + offset, 3, &p->yuv_color->V, w);
}
static void
paint_hline_AYUV (paintinfo * p, int x, int y, int w)
{