diff --git a/ChangeLog b/ChangeLog index 92e1906124..1a9d6892c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-05 Wim Taymans + + * gst/videotestsrc/videotestsrc.c: (paint_setup_Y41B), + (paint_hline_Y41B), (paint_setup_Y42B), (paint_hline_Y42B): + Added two more colorspaces. + 2004-11-05 Wim Taymans * gst/ffmpegcolorspace/gstffmpegcodecmap.c: diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c index fba1dddfa3..0db5d22301 100644 --- a/gst/videotestsrc/videotestsrc.c +++ b/gst/videotestsrc/videotestsrc.c @@ -255,6 +255,8 @@ static void paint_setup_YUY2 (paintinfo * p, char *dest); static void paint_setup_UYVY (paintinfo * p, char *dest); static void paint_setup_YVYU (paintinfo * p, char *dest); static void paint_setup_IYU2 (paintinfo * p, char *dest); +static void paint_setup_Y41B (paintinfo * p, char *dest); +static void paint_setup_Y42B (paintinfo * p, char *dest); static void paint_setup_Y800 (paintinfo * p, char *dest); #if 0 @@ -277,6 +279,8 @@ static void paint_setup_xRGB1555 (paintinfo * p, char *dest); static void paint_hline_I420 (paintinfo * p, int x, int y, int w); static void paint_hline_YUY2 (paintinfo * p, int x, int y, int w); static void paint_hline_IYU2 (paintinfo * p, int x, int y, int w); +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_Y800 (paintinfo * p, int x, int y, int w); #if 0 @@ -339,7 +343,9 @@ struct fourcc_list_struct fourcc_list[] = { #endif /* CLPL */ /* Y41B */ + {"Y41B", "Y41B", 12, paint_setup_Y41B, paint_hline_Y41B}, /* Y42B */ + {"Y42B", "Y42B", 16, paint_setup_Y42B, paint_hline_Y42B}, /* Y800 grayscale */ {"Y800", "Y800", 8, paint_setup_Y800, paint_hline_Y800}, @@ -793,6 +799,56 @@ paint_hline_IYU2 (paintinfo * p, int x, int y, int w) oil_splat_u8 (p->vp + offset + x * 3, 3, p->color->V, w); } +static void +paint_setup_Y41B (paintinfo * p, char *dest) +{ + p->yp = dest; + p->ystride = ROUND_UP_4 (p->width); + p->up = p->yp + p->ystride * p->height; + p->ustride = ROUND_UP_8 (p->width) / 4; + p->vp = p->up + p->ustride * p->height; + p->vstride = ROUND_UP_8 (p->width) / 4; + p->endptr = p->vp + p->vstride * p->height; +} + +static void +paint_hline_Y41B (paintinfo * p, int x, int y, int w) +{ + int x1 = x / 4; + int x2 = (x + w) / 4; + int offset = y * p->ystride; + int offset1 = y * p->ustride; + + memset (p->yp + offset + x, p->color->Y, w); + memset (p->up + offset1 + x1, p->color->U, x2 - x1); + memset (p->vp + offset1 + x1, p->color->V, x2 - x1); +} + +static void +paint_setup_Y42B (paintinfo * p, char *dest) +{ + p->yp = dest; + p->ystride = ROUND_UP_4 (p->width); + p->up = p->yp + p->ystride * p->height; + p->ustride = ROUND_UP_8 (p->width) / 2; + p->vp = p->up + p->ustride * p->height; + p->vstride = ROUND_UP_8 (p->width) / 2; + p->endptr = p->vp + p->vstride * p->height; +} + +static void +paint_hline_Y42B (paintinfo * p, int x, int y, int w) +{ + int x1 = x / 2; + int x2 = (x + w) / 2; + int offset = y * p->ystride; + int offset1 = y * p->ustride; + + memset (p->yp + offset + x, p->color->Y, w); + memset (p->up + offset1 + x1, p->color->U, x2 - x1); + memset (p->vp + offset1 + x1, p->color->V, x2 - x1); +} + static void paint_setup_Y800 (paintinfo * p, char *dest) {