mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
video-converter: add direct UYVY to GRAY8 conversion function
https://bugzilla.gnome.org/show_bug.cgi?id=761851
This commit is contained in:
parent
625bd68da7
commit
babcf4d30c
2 changed files with 31 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue