Commit a0a66e8c authored by Benjamin Otte's avatar Benjamin Otte
Browse files

[videotestsrc] Fix Y41B

Chroma components should be aligned on 4byte boundaries.

https://bugzilla.gnome.org/show_bug.cgi?id=595849
parent 6d40818e
......@@ -1817,9 +1817,9 @@ paint_setup_Y41B (paintinfo * p, unsigned char *dest)
p->yp = dest;
p->ystride = GST_ROUND_UP_4 (p->width);
p->up = p->yp + p->ystride * p->height;
p->ustride = GST_ROUND_UP_8 (p->width) / 4;
p->ustride = GST_ROUND_UP_16 (p->width) / 4;
p->vp = p->up + p->ustride * p->height;
p->vstride = GST_ROUND_UP_8 (p->width) / 4;
p->vstride = GST_ROUND_UP_16 (p->width) / 4;
p->endptr = p->vp + p->vstride * p->height;
}
......@@ -1827,13 +1827,15 @@ static void
paint_hline_Y41B (paintinfo * p, int x, int y, int w)
{
int x1 = x / 4;
int x2 = (x + w) / 4;
int w1 = (x + w) / 4 - x1;
int offset = y * p->ystride;
int offset1 = y * p->ustride;
if (x + w == p->width && p->width % 4 != 0)
w1++;
oil_splat_u8_ns (p->yp + offset + x, &p->yuv_color->Y, w);
oil_splat_u8_ns (p->up + offset1 + x1, &p->yuv_color->U, x2 - x1);
oil_splat_u8_ns (p->vp + offset1 + x1, &p->yuv_color->V, x2 - x1);
oil_splat_u8_ns (p->up + offset1 + x1, &p->yuv_color->U, w1);
oil_splat_u8_ns (p->vp + offset1 + x1, &p->yuv_color->V, w1);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment