Commit babcf4d3 authored by Göran Jönsson's avatar Göran Jönsson Committed by Tim-Philipp Müller

video-converter: add direct UYVY to GRAY8 conversion function

https://bugzilla.gnome.org/show_bug.cgi?id=761851
parent 625bd68d
......@@ -3182,6 +3182,24 @@ convert_UYVY_Y444 (GstVideoConverter * convert, const GstVideoFrame * src,
convert_fill_border (convert, dest);
}
static void
convert_UYVY_GRAY8 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
{
gint width = convert->in_width;
gint height = convert->in_height;
guint16 *s;
guint8 *d;
s = GST_VIDEO_FRAME_PLANE_DATA (src, 0);
d = GST_VIDEO_FRAME_PLANE_DATA (dest, 0);
video_orc_convert_UYVY_GRAY8 (d,
FRAME_GET_STRIDE (dest), s, FRAME_GET_STRIDE (src), width, height);
convert_fill_border (convert, dest);
}
static void
convert_AYUV_I420 (GstVideoConverter * convert, const GstVideoFrame * src,
GstVideoFrame * dest)
......@@ -4353,6 +4371,8 @@ static const VideoTransform transforms[] = {
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_YUY2_Y42B},
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_FORMAT_Y444, TRUE, FALSE, TRUE, TRUE,
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_YUY2_Y444},
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_FORMAT_GRAY8, TRUE, TRUE, TRUE, TRUE,
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_UYVY_GRAY8},
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_FORMAT_I420, TRUE, FALSE, TRUE, FALSE,
FALSE, FALSE, FALSE, FALSE, 0, 0, convert_UYVY_I420},
......
......@@ -2552,3 +2552,14 @@ x4 convsuswb d, p
loadpq m, masks
x4 addusw p, d, e1
x4 andnw d, m, p
.function video_orc_convert_UYVY_GRAY8
.flags 2d
.dest 1 d guint8
.source 2 s
.temp 1 t1
.temp 2 t2
loadw t2, s
convhwb t1, t2
storeb d, t1
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