mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
videoconvert: rework YUV->RGB fastpaths
Rework the orc code to be around 10% faster and support arbitrary matrices. Pass the matrix parameters to the YUV->RGB functions to make them work for all matrices. This enables more and faster fastpath conversions. See https://bugzilla.gnome.org/show_bug.cgi?id=721701
This commit is contained in:
parent
5ca04cb798
commit
14b5999bca
2 changed files with 276 additions and 247 deletions
|
@ -451,8 +451,11 @@ mergewl ayuv, ay, uv
|
||||||
.flags 2d
|
.flags 2d
|
||||||
.dest 4 argb guint8
|
.dest 4 argb guint8
|
||||||
.source 4 ayuv guint8
|
.source 4 ayuv guint8
|
||||||
.temp 2 t1
|
.param 2 p1
|
||||||
.temp 2 t2
|
.param 2 p2
|
||||||
|
.param 2 p3
|
||||||
|
.param 2 p4
|
||||||
|
.param 2 p5
|
||||||
.temp 1 a
|
.temp 1 a
|
||||||
.temp 1 y
|
.temp 1 y
|
||||||
.temp 1 u
|
.temp 1 u
|
||||||
|
@ -467,57 +470,48 @@ mergewl ayuv, ay, uv
|
||||||
.temp 1 g
|
.temp 1 g
|
||||||
.temp 1 b
|
.temp 1 b
|
||||||
.temp 4 x
|
.temp 4 x
|
||||||
.const 1 c8 8
|
.const 1 c128 128
|
||||||
|
|
||||||
x4 subb x, ayuv, 128
|
x4 subb x, ayuv, c128
|
||||||
splitlw t1, t2, x
|
splitlw wv, wy, x
|
||||||
splitwb y, a, t2
|
splitwb y, a, wy
|
||||||
splitwb v, u, t1
|
splitwb v, u, wv
|
||||||
convsbw wy, y
|
|
||||||
convsbw wu, u
|
|
||||||
convsbw wv, v
|
|
||||||
|
|
||||||
mullw t1, wy, 42
|
splatbw wy, y
|
||||||
shrsw t1, t1, c8
|
splatbw wu, u
|
||||||
addssw wy, wy, t1
|
splatbw wv, v
|
||||||
|
|
||||||
addssw wr, wy, wv
|
mulhsw wy, wy, p1
|
||||||
mullw t1, wv, 103
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
subssw wr, wr, t1
|
|
||||||
addssw wr, wr, wv
|
|
||||||
|
|
||||||
addssw wb, wy, wu
|
mulhsw wr, wv, p2
|
||||||
addssw wb, wb, wu
|
addssw wr, wy, wr
|
||||||
mullw t1, wu, 4
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
addssw wb, wb, t1
|
|
||||||
|
|
||||||
mullw t1, wu, 100
|
mulhsw wb, wu, p3
|
||||||
shrsw t1, t1, c8
|
addssw wb, wy, wb
|
||||||
subssw wg, wy, t1
|
|
||||||
mullw t1, wv, 104
|
mulhsw wg, wu, p4
|
||||||
shrsw t1, t1, c8
|
addssw wg, wy, wg
|
||||||
subssw wg, wg, t1
|
mulhsw wy, wv, p5
|
||||||
subssw wg, wg, t1
|
addssw wg, wg, wy
|
||||||
|
|
||||||
convssswb r, wr
|
convssswb r, wr
|
||||||
convssswb g, wg
|
convssswb g, wg
|
||||||
convssswb b, wb
|
convssswb b, wb
|
||||||
|
|
||||||
mergebw t1, a, r
|
mergebw wr, a, r
|
||||||
mergebw t2, g, b
|
mergebw wb, g, b
|
||||||
mergewl x, t1, t2
|
mergewl x, wr, wb
|
||||||
x4 addb argb, x, 128
|
x4 addb argb, x, c128
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.function video_convert_orc_convert_AYUV_BGRA
|
.function video_convert_orc_convert_AYUV_BGRA
|
||||||
.flags 2d
|
.flags 2d
|
||||||
.dest 4 argb guint8
|
.dest 4 bgra guint8
|
||||||
.source 4 ayuv guint8
|
.source 4 ayuv guint8
|
||||||
.temp 2 t1
|
.param 2 p1
|
||||||
.temp 2 t2
|
.param 2 p2
|
||||||
|
.param 2 p3
|
||||||
|
.param 2 p4
|
||||||
|
.param 2 p5
|
||||||
.temp 1 a
|
.temp 1 a
|
||||||
.temp 1 y
|
.temp 1 y
|
||||||
.temp 1 u
|
.temp 1 u
|
||||||
|
@ -532,58 +526,49 @@ x4 addb argb, x, 128
|
||||||
.temp 1 g
|
.temp 1 g
|
||||||
.temp 1 b
|
.temp 1 b
|
||||||
.temp 4 x
|
.temp 4 x
|
||||||
.const 1 c8 8
|
.const 1 c128 128
|
||||||
|
|
||||||
x4 subb x, ayuv, 128
|
x4 subb x, ayuv, c128
|
||||||
splitlw t1, t2, x
|
splitlw wv, wy, x
|
||||||
splitwb y, a, t2
|
splitwb y, a, wy
|
||||||
splitwb v, u, t1
|
splitwb v, u, wv
|
||||||
convsbw wy, y
|
|
||||||
convsbw wu, u
|
|
||||||
convsbw wv, v
|
|
||||||
|
|
||||||
mullw t1, wy, 42
|
splatbw wy, y
|
||||||
shrsw t1, t1, c8
|
splatbw wu, u
|
||||||
addssw wy, wy, t1
|
splatbw wv, v
|
||||||
|
|
||||||
addssw wr, wy, wv
|
mulhsw wy, wy, p1
|
||||||
mullw t1, wv, 103
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
subssw wr, wr, t1
|
|
||||||
addssw wr, wr, wv
|
|
||||||
|
|
||||||
addssw wb, wy, wu
|
mulhsw wr, wv, p2
|
||||||
addssw wb, wb, wu
|
addssw wr, wy, wr
|
||||||
mullw t1, wu, 4
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
addssw wb, wb, t1
|
|
||||||
|
|
||||||
mullw t1, wu, 100
|
mulhsw wb, wu, p3
|
||||||
shrsw t1, t1, c8
|
addssw wb, wy, wb
|
||||||
subssw wg, wy, t1
|
|
||||||
mullw t1, wv, 104
|
mulhsw wg, wu, p4
|
||||||
shrsw t1, t1, c8
|
addssw wg, wy, wg
|
||||||
subssw wg, wg, t1
|
mulhsw wy, wv, p5
|
||||||
subssw wg, wg, t1
|
addssw wg, wg, wy
|
||||||
|
|
||||||
convssswb r, wr
|
convssswb r, wr
|
||||||
convssswb g, wg
|
convssswb g, wg
|
||||||
convssswb b, wb
|
convssswb b, wb
|
||||||
|
|
||||||
mergebw t1, b, g
|
mergebw wb, b, g
|
||||||
mergebw t2, r, a
|
mergebw wr, r, a
|
||||||
mergewl x, t1, t2
|
mergewl x, wb, wr
|
||||||
x4 addb argb, x, 128
|
x4 addb bgra, x, c128
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.function video_convert_orc_convert_AYUV_ABGR
|
.function video_convert_orc_convert_AYUV_ABGR
|
||||||
.flags 2d
|
.flags 2d
|
||||||
.dest 4 argb guint8
|
.dest 4 argb guint8
|
||||||
.source 4 ayuv guint8
|
.source 4 ayuv guint8
|
||||||
.temp 2 t1
|
.param 2 p1
|
||||||
.temp 2 t2
|
.param 2 p2
|
||||||
|
.param 2 p3
|
||||||
|
.param 2 p4
|
||||||
|
.param 2 p5
|
||||||
.temp 1 a
|
.temp 1 a
|
||||||
.temp 1 y
|
.temp 1 y
|
||||||
.temp 1 u
|
.temp 1 u
|
||||||
|
@ -598,57 +583,48 @@ x4 addb argb, x, 128
|
||||||
.temp 1 g
|
.temp 1 g
|
||||||
.temp 1 b
|
.temp 1 b
|
||||||
.temp 4 x
|
.temp 4 x
|
||||||
.const 1 c8 8
|
.const 1 c128 128
|
||||||
|
|
||||||
x4 subb x, ayuv, 128
|
x4 subb x, ayuv, c128
|
||||||
splitlw t1, t2, x
|
splitlw wv, wy, x
|
||||||
splitwb y, a, t2
|
splitwb y, a, wy
|
||||||
splitwb v, u, t1
|
splitwb v, u, wv
|
||||||
convsbw wy, y
|
|
||||||
convsbw wu, u
|
|
||||||
convsbw wv, v
|
|
||||||
|
|
||||||
mullw t1, wy, 42
|
splatbw wy, y
|
||||||
shrsw t1, t1, c8
|
splatbw wu, u
|
||||||
addssw wy, wy, t1
|
splatbw wv, v
|
||||||
|
|
||||||
addssw wr, wy, wv
|
mulhsw wy, wy, p1
|
||||||
mullw t1, wv, 103
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
subssw wr, wr, t1
|
|
||||||
addssw wr, wr, wv
|
|
||||||
|
|
||||||
addssw wb, wy, wu
|
mulhsw wr, wv, p2
|
||||||
addssw wb, wb, wu
|
addssw wr, wy, wr
|
||||||
mullw t1, wu, 4
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
addssw wb, wb, t1
|
|
||||||
|
|
||||||
mullw t1, wu, 100
|
mulhsw wb, wu, p3
|
||||||
shrsw t1, t1, c8
|
addssw wb, wy, wb
|
||||||
subssw wg, wy, t1
|
|
||||||
mullw t1, wv, 104
|
mulhsw wg, wu, p4
|
||||||
shrsw t1, t1, c8
|
addssw wg, wy, wg
|
||||||
subssw wg, wg, t1
|
mulhsw wy, wv, p5
|
||||||
subssw wg, wg, t1
|
addssw wg, wg, wy
|
||||||
|
|
||||||
convssswb r, wr
|
convssswb r, wr
|
||||||
convssswb g, wg
|
convssswb g, wg
|
||||||
convssswb b, wb
|
convssswb b, wb
|
||||||
|
|
||||||
mergebw t1, a, b
|
mergebw wb, a, b
|
||||||
mergebw t2, g, r
|
mergebw wr, g, r
|
||||||
mergewl x, t1, t2
|
mergewl x, wb, wr
|
||||||
x4 addb argb, x, 128
|
x4 addb argb, x, c128
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.function video_convert_orc_convert_AYUV_RGBA
|
.function video_convert_orc_convert_AYUV_RGBA
|
||||||
.flags 2d
|
.flags 2d
|
||||||
.dest 4 argb guint8
|
.dest 4 argb guint8
|
||||||
.source 4 ayuv guint8
|
.source 4 ayuv guint8
|
||||||
.temp 2 t1
|
.param 2 p1
|
||||||
.temp 2 t2
|
.param 2 p2
|
||||||
|
.param 2 p3
|
||||||
|
.param 2 p4
|
||||||
|
.param 2 p5
|
||||||
.temp 1 a
|
.temp 1 a
|
||||||
.temp 1 y
|
.temp 1 y
|
||||||
.temp 1 u
|
.temp 1 u
|
||||||
|
@ -663,48 +639,38 @@ x4 addb argb, x, 128
|
||||||
.temp 1 g
|
.temp 1 g
|
||||||
.temp 1 b
|
.temp 1 b
|
||||||
.temp 4 x
|
.temp 4 x
|
||||||
.const 1 c8 8
|
.const 1 c128 128
|
||||||
|
|
||||||
x4 subb x, ayuv, 128
|
x4 subb x, ayuv, c128
|
||||||
splitlw t1, t2, x
|
splitlw wv, wy, x
|
||||||
splitwb y, a, t2
|
splitwb y, a, wy
|
||||||
splitwb v, u, t1
|
splitwb v, u, wv
|
||||||
convsbw wy, y
|
|
||||||
convsbw wu, u
|
|
||||||
convsbw wv, v
|
|
||||||
|
|
||||||
mullw t1, wy, 42
|
splatbw wy, y
|
||||||
shrsw t1, t1, c8
|
splatbw wu, u
|
||||||
addssw wy, wy, t1
|
splatbw wv, v
|
||||||
|
|
||||||
addssw wr, wy, wv
|
mulhsw wy, wy, p1
|
||||||
mullw t1, wv, 103
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
subssw wr, wr, t1
|
|
||||||
addssw wr, wr, wv
|
|
||||||
|
|
||||||
addssw wb, wy, wu
|
mulhsw wr, wv, p2
|
||||||
addssw wb, wb, wu
|
addssw wr, wy, wr
|
||||||
mullw t1, wu, 4
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
addssw wb, wb, t1
|
|
||||||
|
|
||||||
mullw t1, wu, 100
|
mulhsw wb, wu, p3
|
||||||
shrsw t1, t1, c8
|
addssw wb, wy, wb
|
||||||
subssw wg, wy, t1
|
|
||||||
mullw t1, wv, 104
|
mulhsw wg, wu, p4
|
||||||
shrsw t1, t1, c8
|
addssw wg, wy, wg
|
||||||
subssw wg, wg, t1
|
mulhsw wy, wv, p5
|
||||||
subssw wg, wg, t1
|
addssw wg, wg, wy
|
||||||
|
|
||||||
convssswb r, wr
|
convssswb r, wr
|
||||||
convssswb g, wg
|
convssswb g, wg
|
||||||
convssswb b, wb
|
convssswb b, wb
|
||||||
|
|
||||||
mergebw t1, r, g
|
mergebw wr, r, g
|
||||||
mergebw t2, b, a
|
mergebw wb, b, a
|
||||||
mergewl x, t1, t2
|
mergewl x, wr, wb
|
||||||
x4 addb argb, x, 128
|
x4 addb argb, x, c128
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -713,9 +679,11 @@ x4 addb argb, x, 128
|
||||||
.source 1 y guint8
|
.source 1 y guint8
|
||||||
.source 1 u guint8
|
.source 1 u guint8
|
||||||
.source 1 v guint8
|
.source 1 v guint8
|
||||||
.temp 2 t1
|
.param 2 p1
|
||||||
.temp 2 t2
|
.param 2 p2
|
||||||
.temp 1 t3
|
.param 2 p3
|
||||||
|
.param 2 p4
|
||||||
|
.param 2 p5
|
||||||
.temp 2 wy
|
.temp 2 wy
|
||||||
.temp 2 wu
|
.temp 2 wu
|
||||||
.temp 2 wv
|
.temp 2 wv
|
||||||
|
@ -726,48 +694,36 @@ x4 addb argb, x, 128
|
||||||
.temp 1 g
|
.temp 1 g
|
||||||
.temp 1 b
|
.temp 1 b
|
||||||
.temp 4 x
|
.temp 4 x
|
||||||
.const 1 c8 8
|
|
||||||
.const 1 c128 128
|
.const 1 c128 128
|
||||||
|
|
||||||
subb t3, y, c128
|
subb r, y, c128
|
||||||
convsbw wy, t3
|
splatbw wy, r
|
||||||
loadupib t3, u
|
loadupib r, u
|
||||||
subb t3, t3, c128
|
subb r, r, c128
|
||||||
convsbw wu, t3
|
splatbw wu, r
|
||||||
loadupib t3, v
|
loadupib r, v
|
||||||
subb t3, t3, c128
|
subb r, r, c128
|
||||||
convsbw wv, t3
|
splatbw wv, r
|
||||||
|
|
||||||
mullw t1, wy, 42
|
mulhsw wy, wy, p1
|
||||||
shrsw t1, t1, c8
|
|
||||||
addssw wy, wy, t1
|
|
||||||
|
|
||||||
addssw wr, wy, wv
|
mulhsw wr, wv, p2
|
||||||
mullw t1, wv, 103
|
addssw wr, wy, wr
|
||||||
shrsw t1, t1, c8
|
|
||||||
subssw wr, wr, t1
|
|
||||||
addssw wr, wr, wv
|
|
||||||
|
|
||||||
addssw wb, wy, wu
|
mulhsw wb, wu, p3
|
||||||
addssw wb, wb, wu
|
addssw wb, wy, wb
|
||||||
mullw t1, wu, 4
|
|
||||||
shrsw t1, t1, c8
|
|
||||||
addssw wb, wb, t1
|
|
||||||
|
|
||||||
mullw t1, wu, 100
|
mulhsw wg, wu, p4
|
||||||
shrsw t1, t1, c8
|
addssw wg, wy, wg
|
||||||
subssw wg, wy, t1
|
mulhsw wy, wv, p5
|
||||||
mullw t1, wv, 104
|
addssw wg, wg, wy
|
||||||
shrsw t1, t1, c8
|
|
||||||
subssw wg, wg, t1
|
|
||||||
subssw wg, wg, t1
|
|
||||||
|
|
||||||
convssswb r, wr
|
convssswb r, wr
|
||||||
convssswb g, wg
|
convssswb g, wg
|
||||||
convssswb b, wb
|
convssswb b, wb
|
||||||
|
|
||||||
mergebw t1, b, g
|
mergebw wb, b, g
|
||||||
mergebw t2, r, 127
|
mergebw wr, r, 127
|
||||||
mergewl x, t1, t2
|
mergewl x, wb, wr
|
||||||
x4 addb argb, x, c128
|
x4 addb argb, x, c128
|
||||||
|
|
||||||
|
|
|
@ -276,6 +276,7 @@ videoconvert_convert_compute_matrix (VideoConvert * convert)
|
||||||
/* 1, bring color components to [0..1.0] range */
|
/* 1, bring color components to [0..1.0] range */
|
||||||
gst_video_color_range_offsets (in_info->colorimetry.range, suinfo, offset,
|
gst_video_color_range_offsets (in_info->colorimetry.range, suinfo, offset,
|
||||||
scale);
|
scale);
|
||||||
|
|
||||||
color_matrix_offset_components (&dst, -offset[0], -offset[1], -offset[2]);
|
color_matrix_offset_components (&dst, -offset[0], -offset[1], -offset[2]);
|
||||||
|
|
||||||
color_matrix_scale_components (&dst, 1 / ((float) scale[0]),
|
color_matrix_scale_components (&dst, 1 / ((float) scale[0]),
|
||||||
|
@ -300,6 +301,7 @@ videoconvert_convert_compute_matrix (VideoConvert * convert)
|
||||||
/* 8, bring color components to nominal range */
|
/* 8, bring color components to nominal range */
|
||||||
gst_video_color_range_offsets (out_info->colorimetry.range, duinfo, offset,
|
gst_video_color_range_offsets (out_info->colorimetry.range, duinfo, offset,
|
||||||
scale);
|
scale);
|
||||||
|
|
||||||
color_matrix_scale_components (&dst, (float) scale[0], (float) scale[1],
|
color_matrix_scale_components (&dst, (float) scale[0], (float) scale[1],
|
||||||
(float) scale[2]);
|
(float) scale[2]);
|
||||||
|
|
||||||
|
@ -1202,7 +1204,9 @@ convert_AYUV_ARGB (VideoConvert * convert, GstVideoFrame * dest,
|
||||||
|
|
||||||
video_convert_orc_convert_AYUV_ARGB (FRAME_GET_LINE (dest, 0),
|
video_convert_orc_convert_AYUV_ARGB (FRAME_GET_LINE (dest, 0),
|
||||||
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
||||||
FRAME_GET_STRIDE (src), width, height);
|
FRAME_GET_STRIDE (src), convert->cmatrix[0][0], convert->cmatrix[0][2],
|
||||||
|
convert->cmatrix[2][1], convert->cmatrix[1][1], convert->cmatrix[1][2],
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1214,7 +1218,9 @@ convert_AYUV_BGRA (VideoConvert * convert, GstVideoFrame * dest,
|
||||||
|
|
||||||
video_convert_orc_convert_AYUV_BGRA (FRAME_GET_LINE (dest, 0),
|
video_convert_orc_convert_AYUV_BGRA (FRAME_GET_LINE (dest, 0),
|
||||||
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
||||||
FRAME_GET_STRIDE (src), width, height);
|
FRAME_GET_STRIDE (src), convert->cmatrix[0][0], convert->cmatrix[0][2],
|
||||||
|
convert->cmatrix[2][1], convert->cmatrix[1][1], convert->cmatrix[1][2],
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1226,7 +1232,9 @@ convert_AYUV_ABGR (VideoConvert * convert, GstVideoFrame * dest,
|
||||||
|
|
||||||
video_convert_orc_convert_AYUV_ABGR (FRAME_GET_LINE (dest, 0),
|
video_convert_orc_convert_AYUV_ABGR (FRAME_GET_LINE (dest, 0),
|
||||||
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
||||||
FRAME_GET_STRIDE (src), width, height);
|
FRAME_GET_STRIDE (src), convert->cmatrix[0][0], convert->cmatrix[0][2],
|
||||||
|
convert->cmatrix[2][1], convert->cmatrix[1][1], convert->cmatrix[1][2],
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1238,7 +1246,9 @@ convert_AYUV_RGBA (VideoConvert * convert, GstVideoFrame * dest,
|
||||||
|
|
||||||
video_convert_orc_convert_AYUV_RGBA (FRAME_GET_LINE (dest, 0),
|
video_convert_orc_convert_AYUV_RGBA (FRAME_GET_LINE (dest, 0),
|
||||||
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
FRAME_GET_STRIDE (dest), FRAME_GET_LINE (src, 0),
|
||||||
FRAME_GET_STRIDE (src), width, height);
|
FRAME_GET_STRIDE (src), convert->cmatrix[0][0], convert->cmatrix[0][2],
|
||||||
|
convert->cmatrix[2][1], convert->cmatrix[1][1], convert->cmatrix[1][2],
|
||||||
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1252,7 +1262,10 @@ convert_I420_BGRA (VideoConvert * convert, GstVideoFrame * dest,
|
||||||
for (i = 0; i < height; i++) {
|
for (i = 0; i < height; i++) {
|
||||||
video_convert_orc_convert_I420_BGRA (FRAME_GET_LINE (dest, i),
|
video_convert_orc_convert_I420_BGRA (FRAME_GET_LINE (dest, i),
|
||||||
FRAME_GET_Y_LINE (src, i),
|
FRAME_GET_Y_LINE (src, i),
|
||||||
FRAME_GET_U_LINE (src, i >> 1), FRAME_GET_V_LINE (src, i >> 1), width);
|
FRAME_GET_U_LINE (src, i >> 1), FRAME_GET_V_LINE (src, i >> 1),
|
||||||
|
convert->cmatrix[0][0], convert->cmatrix[0][2],
|
||||||
|
convert->cmatrix[2][1], convert->cmatrix[1][1], convert->cmatrix[1][2],
|
||||||
|
width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1269,6 +1282,7 @@ typedef struct
|
||||||
GstVideoColorMatrix out_matrix;
|
GstVideoColorMatrix out_matrix;
|
||||||
gboolean keeps_color_matrix;
|
gboolean keeps_color_matrix;
|
||||||
gboolean keeps_interlaced;
|
gboolean keeps_interlaced;
|
||||||
|
gboolean needs_color_matrix;
|
||||||
gint width_align, height_align;
|
gint width_align, height_align;
|
||||||
void (*convert) (VideoConvert * convert, GstVideoFrame * dest,
|
void (*convert) (VideoConvert * convert, GstVideoFrame * dest,
|
||||||
const GstVideoFrame * src);
|
const GstVideoFrame * src);
|
||||||
|
@ -1276,118 +1290,165 @@ typedef struct
|
||||||
|
|
||||||
static const VideoTransform transforms[] = {
|
static const VideoTransform transforms[] = {
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_I420_YUY2},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_I420_YUY2},
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_I420_UYVY},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_I420_UYVY},
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_I420_AYUV},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_I420_AYUV},
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 0, 0, convert_I420_Y42B},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 0, 0,
|
||||||
|
convert_I420_Y42B},
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 0, 0, convert_I420_Y444},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 0, 0,
|
||||||
|
convert_I420_Y444},
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_I420_YUY2},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_I420_YUY2},
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_I420_UYVY},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_I420_UYVY},
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_I420_AYUV},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_I420_AYUV},
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 0, 0, convert_I420_Y42B},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 0, 0,
|
||||||
|
convert_I420_Y42B},
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 0, 0, convert_I420_Y444},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 0, 0,
|
||||||
|
convert_I420_Y444},
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_YUY2_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_YUY2_I420},
|
||||||
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_YUY2_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_YUY2_I420},
|
||||||
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_YUY2}, /* alias */
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0, convert_UYVY_YUY2}, /* alias */
|
||||||
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_YUY2_AYUV},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_YUY2_AYUV},
|
||||||
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_YUY2_Y42B},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_YUY2_Y42B},
|
||||||
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
{GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_YUY2_Y444},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_YUY2_Y444},
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_UYVY_I420},
|
||||||
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_UYVY_I420},
|
||||||
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_YUY2},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_UYVY_YUY2},
|
||||||
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_AYUV},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_UYVY_AYUV},
|
||||||
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_Y42B},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_UYVY_Y42B},
|
||||||
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
{GST_VIDEO_FORMAT_UYVY, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_UYVY_Y444},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_UYVY_Y444},
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 1, 1, convert_AYUV_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 1, 1,
|
||||||
|
convert_AYUV_I420},
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 1, 1, convert_AYUV_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 1, 1,
|
||||||
|
convert_AYUV_I420},
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_AYUV_YUY2},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_AYUV_YUY2},
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_AYUV_UYVY},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_AYUV_UYVY},
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_AYUV_Y42B},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_AYUV_Y42B},
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_AYUV_Y444},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_AYUV_Y444},
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 0, 0, convert_Y42B_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 0, 0,
|
||||||
|
convert_Y42B_I420},
|
||||||
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 0, 0, convert_Y42B_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 0, 0,
|
||||||
|
convert_Y42B_I420},
|
||||||
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_Y42B_YUY2},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_Y42B_YUY2},
|
||||||
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_Y42B_UYVY},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_Y42B_UYVY},
|
||||||
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_Y42B_AYUV},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_Y42B_AYUV},
|
||||||
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
{GST_VIDEO_FORMAT_Y42B, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y444,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_Y42B_Y444},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_Y42B_Y444},
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_I420,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 1, 0, convert_Y444_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 1, 0,
|
||||||
|
convert_Y444_I420},
|
||||||
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YV12,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, 1, 0, convert_Y444_I420},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, FALSE, 1, 0,
|
||||||
|
convert_Y444_I420},
|
||||||
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_YUY2,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_Y444_YUY2},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_Y444_YUY2},
|
||||||
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_UYVY,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_Y444_UYVY},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_Y444_UYVY},
|
||||||
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_AYUV,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 0, 0, convert_Y444_AYUV},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 0, 0,
|
||||||
|
convert_Y444_AYUV},
|
||||||
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
{GST_VIDEO_FORMAT_Y444, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_Y42B,
|
||||||
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, 1, 0, convert_Y444_Y42B},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, FALSE, 1, 0,
|
||||||
|
convert_Y444_Y42B},
|
||||||
|
|
||||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_ARGB,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_ARGB,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_ARGB},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0,
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_BGRA,
|
convert_AYUV_ARGB},
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_BGRA},
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_BGRA,
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_xRGB,
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_ARGB}, /* alias */
|
convert_AYUV_BGRA},
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_BGRx,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_xRGB,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_BGRA}, /* alias */
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0, convert_AYUV_ARGB}, /* alias */
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_ABGR,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_BGRx,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_ABGR},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0, convert_AYUV_BGRA}, /* alias */
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_RGBA,
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_ABGR,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_RGBA},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0,
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_xBGR,
|
convert_AYUV_ABGR},
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_ABGR}, /* alias */
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_RGBA,
|
||||||
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_RGBx,
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, TRUE, 0, 0, convert_AYUV_RGBA}, /* alias */
|
convert_AYUV_RGBA},
|
||||||
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_xBGR,
|
||||||
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0, convert_AYUV_ABGR}, /* alias */
|
||||||
|
{GST_VIDEO_FORMAT_AYUV, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_RGBx,
|
||||||
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, TRUE, TRUE, 0, 0, convert_AYUV_RGBA}, /* alias */
|
||||||
|
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_BGRA,
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_BGRA,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, FALSE, 0, 0, convert_I420_BGRA},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, TRUE, 0, 0,
|
||||||
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_BGRx,
|
convert_I420_BGRA},
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, FALSE, 0, 0, convert_I420_BGRA},
|
{GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_BGRx,
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_BGRA,
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, TRUE, 0, 0,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, FALSE, 0, 0, convert_I420_BGRA},
|
convert_I420_BGRA},
|
||||||
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT601, GST_VIDEO_FORMAT_BGRx,
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_BGRA,
|
||||||
GST_VIDEO_COLOR_MATRIX_RGB, FALSE, FALSE, 0, 0, convert_I420_BGRA},
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, TRUE, 0, 0,
|
||||||
|
convert_I420_BGRA},
|
||||||
|
{GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_UNKNOWN, GST_VIDEO_FORMAT_BGRx,
|
||||||
|
GST_VIDEO_COLOR_MATRIX_UNKNOWN, TRUE, FALSE, TRUE, 0, 0,
|
||||||
|
convert_I420_BGRA},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1409,6 +1470,8 @@ videoconvert_convert_lookup_fastpath (VideoConvert * convert)
|
||||||
in_matrix = convert->in_info.colorimetry.matrix;
|
in_matrix = convert->in_info.colorimetry.matrix;
|
||||||
out_matrix = convert->out_info.colorimetry.matrix;
|
out_matrix = convert->out_info.colorimetry.matrix;
|
||||||
|
|
||||||
|
// return FALSE;
|
||||||
|
|
||||||
interlaced = GST_VIDEO_INFO_IS_INTERLACED (&convert->in_info);
|
interlaced = GST_VIDEO_INFO_IS_INTERLACED (&convert->in_info);
|
||||||
interlaced |= GST_VIDEO_INFO_IS_INTERLACED (&convert->out_info);
|
interlaced |= GST_VIDEO_INFO_IS_INTERLACED (&convert->out_info);
|
||||||
|
|
||||||
|
@ -1422,10 +1485,20 @@ videoconvert_convert_lookup_fastpath (VideoConvert * convert)
|
||||||
(transforms[i].width_align & width) == 0 &&
|
(transforms[i].width_align & width) == 0 &&
|
||||||
(transforms[i].height_align & height) == 0) {
|
(transforms[i].height_align & height) == 0) {
|
||||||
GST_DEBUG ("using fastpath");
|
GST_DEBUG ("using fastpath");
|
||||||
|
if (transforms[i].needs_color_matrix)
|
||||||
|
if (!videoconvert_convert_compute_matrix (convert))
|
||||||
|
goto no_convert;
|
||||||
convert->convert = transforms[i].convert;
|
convert->convert = transforms[i].convert;
|
||||||
alloc_tmplines (convert, 1, GST_VIDEO_INFO_WIDTH (&convert->in_info));
|
alloc_tmplines (convert, 1, GST_VIDEO_INFO_WIDTH (&convert->in_info));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GST_DEBUG ("no fastpath found");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
no_convert:
|
||||||
|
{
|
||||||
|
GST_DEBUG ("can't create matrix");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue