if (component == 0)
return 0;
if (component == 1) {
- return GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height) +
+ return GST_ROUND_UP_4 (width) * height +
GST_ROUND_UP_4 (GST_ROUND_UP_4 (width) / 4) *
(GST_ROUND_UP_4 (height) / 4);
}
if (component == 2)
- return GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height);
+ return GST_ROUND_UP_4 (width) * height;
return 0;
case GST_VIDEO_FORMAT_IYU1:
if (component == 0)
return size;
case GST_VIDEO_FORMAT_YUV9:
case GST_VIDEO_FORMAT_YVU9:
- size = GST_ROUND_UP_4 (width) * GST_ROUND_UP_2 (height);
+ size = GST_ROUND_UP_4 (width) * height;
size += GST_ROUND_UP_4 (GST_ROUND_UP_4 (width) / 4) *
(GST_ROUND_UP_4 (height) / 4) * 2;
return size;
static void
paint_setup_YVU9 (paintinfo * p, unsigned char *dest)
{
- int h = GST_ROUND_UP_4 (p->height);
-
p->yp = dest;
p->ystride = GST_ROUND_UP_4 (p->width);
- p->vp = p->yp + p->ystride * GST_ROUND_UP_4 (p->height);
+ p->vp = p->yp + p->ystride * p->height;
p->vstride = GST_ROUND_UP_4 (p->ystride / 4);
- p->up = p->vp + p->vstride * GST_ROUND_UP_4 (h / 4);
+ p->up = p->vp + p->vstride * (GST_ROUND_UP_4 (p->height) / 4);
p->ustride = GST_ROUND_UP_4 (p->ystride / 4);
- p->endptr = p->up + p->ustride * GST_ROUND_UP_4 (h / 4);
+ p->endptr = p->up + p->ustride * (GST_ROUND_UP_4 (p->height) / 4);
}
static void
paint_setup_YUV9 (paintinfo * p, unsigned char *dest)
{
- /* untested */
- int h = GST_ROUND_UP_4 (p->height);
-
p->yp = dest;
p->ystride = GST_ROUND_UP_4 (p->width);
- p->up = p->yp + p->ystride * h;
+ p->up = p->yp + p->ystride * p->height;
p->ustride = GST_ROUND_UP_4 (p->ystride / 4);
- p->vp = p->up + p->ustride * GST_ROUND_UP_4 (h / 4);
+ p->vp = p->up + p->ustride * (GST_ROUND_UP_4 (p->height) / 4);
p->vstride = GST_ROUND_UP_4 (p->ystride / 4);
- p->endptr = p->vp + p->vstride * GST_ROUND_UP_4 (h / 4);
+ p->endptr = p->vp + p->vstride * (GST_ROUND_UP_4 (p->height) / 4);
}
#define gst_video_format_is_packed video_format_is_packed
fail_unless_equals_int (off1, (unsigned long) paintinfo.up);
fail_unless_equals_int (off2, (unsigned long) paintinfo.vp);
- skip_check:
-
/* should be 0 if there's no alpha component */
off3 = gst_video_format_get_component_offset (fmt, 3, w, h);
fail_unless_equals_int (off3, (unsigned long) paintinfo.ap);