videotestsrc: Add support for packed 4:4:4 YUV (format=V308)
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 12 Feb 2009 17:17:53 +0000 (18:17 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 12 Feb 2009 18:09:40 +0000 (19:09 +0100)
Partially fixes bug #571147.

gst/videotestsrc/videotestsrc.c

index 5405fda..4fa5b04 100644 (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 */
@@ -1392,6 +1395,16 @@ paint_setup_YV12 (paintinfo * p, unsigned char *dest)
 }
 
 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)
 {
   p->ap = dest;
@@ -1433,6 +1446,17 @@ paint_setup_YVYU (paintinfo * p, unsigned char *dest)
 }
 
 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)
 {
   int offset;