mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-22 02:13:46 +00:00
videotestsrc: Fix YVU9 and YUV9
- Buffer sizes were computed different from ffmpegcolorspace - Green bar on right size for widths not divisable by 4
This commit is contained in:
parent
35fdfcc625
commit
7ed2531b27
1 changed files with 10 additions and 8 deletions
|
@ -1865,11 +1865,11 @@ paint_setup_YVU9 (paintinfo * p, unsigned char *dest)
|
||||||
|
|
||||||
p->yp = dest;
|
p->yp = dest;
|
||||||
p->ystride = GST_ROUND_UP_4 (p->width);
|
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 * h;
|
||||||
p->vstride = GST_ROUND_UP_4 (p->ystride / 4);
|
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 * h / 4;
|
||||||
p->ustride = GST_ROUND_UP_4 (p->ystride / 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 * h / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1882,22 +1882,24 @@ paint_setup_YUV9 (paintinfo * p, unsigned char *dest)
|
||||||
p->ystride = GST_ROUND_UP_4 (p->width);
|
p->ystride = GST_ROUND_UP_4 (p->width);
|
||||||
p->up = p->yp + p->ystride * h;
|
p->up = p->yp + p->ystride * h;
|
||||||
p->ustride = GST_ROUND_UP_4 (p->ystride / 4);
|
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 * h / 4;
|
||||||
p->vstride = GST_ROUND_UP_4 (p->ystride / 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 * h / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paint_hline_YUV9 (paintinfo * p, int x, int y, int w)
|
paint_hline_YUV9 (paintinfo * p, int x, int y, int w)
|
||||||
{
|
{
|
||||||
int x1 = x / 4;
|
int x1 = x / 4;
|
||||||
int x2 = (x + w) / 4;
|
int w1 = (x + w) / 4 - x1;
|
||||||
int offset = y * p->ystride;
|
int offset = y * p->ystride;
|
||||||
int offset1 = (y / 4) * p->ustride;
|
int offset1 = (y / 4) * p->ustride;
|
||||||
|
|
||||||
|
if (x + w == p->width)
|
||||||
|
w1++;
|
||||||
oil_splat_u8_ns (p->yp + offset + x, &p->yuv_color->Y, w);
|
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->up + offset1 + x1, &p->yuv_color->U, w1);
|
||||||
oil_splat_u8_ns (p->vp + offset1 + x1, &p->yuv_color->V, x2 - x1);
|
oil_splat_u8_ns (p->vp + offset1 + x1, &p->yuv_color->V, w1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue