mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
colorspace: Add support for A420
This commit is contained in:
parent
cd135c24e4
commit
d29423fd76
3 changed files with 60 additions and 3 deletions
|
@ -707,6 +707,27 @@ putline_UYVP (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
getline_A420 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
|
||||||
|
int j)
|
||||||
|
{
|
||||||
|
cogorc_getline_A420 (dest,
|
||||||
|
FRAME_GET_LINE (src, 0, j),
|
||||||
|
FRAME_GET_LINE (src, 1, j >> 1),
|
||||||
|
FRAME_GET_LINE (src, 2, j >> 1),
|
||||||
|
FRAME_GET_LINE (src, 3, j), convert->width);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
putline_A420 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
|
||||||
|
int j)
|
||||||
|
{
|
||||||
|
cogorc_putline_A420 (FRAME_GET_LINE (dest, 0, j),
|
||||||
|
FRAME_GET_LINE (dest, 1, j >> 1),
|
||||||
|
FRAME_GET_LINE (dest, 2, j >> 1),
|
||||||
|
FRAME_GET_LINE (dest, 3, j), src, convert->width / 2);
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
|
@ -749,8 +770,8 @@ static const ColorspaceLine lines[] = {
|
||||||
//{GST_VIDEO_FORMAT_BGR16, getline_BGR16, putline_BGR16},
|
//{GST_VIDEO_FORMAT_BGR16, getline_BGR16, putline_BGR16},
|
||||||
//{GST_VIDEO_FORMAT_RGB15, getline_RGB15, putline_RGB15},
|
//{GST_VIDEO_FORMAT_RGB15, getline_RGB15, putline_RGB15},
|
||||||
//{GST_VIDEO_FORMAT_BGR15, getline_BGR15, putline_BGR15},
|
//{GST_VIDEO_FORMAT_BGR15, getline_BGR15, putline_BGR15},
|
||||||
{GST_VIDEO_FORMAT_UYVP, getline_UYVP, putline_UYVP}
|
{GST_VIDEO_FORMAT_UYVP, getline_UYVP, putline_UYVP},
|
||||||
//{GST_VIDEO_FORMAT_A420, getline_A420, putline_A420}
|
{GST_VIDEO_FORMAT_A420, getline_A420, putline_A420}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -47,7 +47,7 @@ GST_DEBUG_CATEGORY (colorspace_performance);
|
||||||
#define CSP_VIDEO_CAPS \
|
#define CSP_VIDEO_CAPS \
|
||||||
"video/x-raw-yuv, width = "GST_VIDEO_SIZE_RANGE" , " \
|
"video/x-raw-yuv, width = "GST_VIDEO_SIZE_RANGE" , " \
|
||||||
"height="GST_VIDEO_SIZE_RANGE",framerate="GST_VIDEO_FPS_RANGE"," \
|
"height="GST_VIDEO_SIZE_RANGE",framerate="GST_VIDEO_FPS_RANGE"," \
|
||||||
"format= (fourcc) { I420 , NV12 , NV21 , YV12 , YUY2 , Y42B , Y444 , YUV9 , YVU9 , Y41B , Y800 , Y8 , GREY , Y16 , UYVY , YVYU , IYU1 , v308 , AYUV, v210 } ;" \
|
"format= (fourcc) { I420 , NV12 , NV21 , YV12 , YUY2 , Y42B , Y444 , YUV9 , YVU9 , Y41B , Y800 , Y8 , GREY , Y16 , UYVY , YVYU , IYU1 , v308 , AYUV, v210, A420 } ;" \
|
||||||
GST_VIDEO_CAPS_RGB";" \
|
GST_VIDEO_CAPS_RGB";" \
|
||||||
GST_VIDEO_CAPS_BGR";" \
|
GST_VIDEO_CAPS_BGR";" \
|
||||||
GST_VIDEO_CAPS_RGBx";" \
|
GST_VIDEO_CAPS_RGBx";" \
|
||||||
|
|
|
@ -1488,6 +1488,22 @@ mergewl uvuv, uv, uv
|
||||||
x2 mergebw ay, c255, y
|
x2 mergebw ay, c255, y
|
||||||
x2 mergewl d, ay, uvuv
|
x2 mergewl d, ay, uvuv
|
||||||
|
|
||||||
|
.function cogorc_getline_A420
|
||||||
|
.dest 4 d guint8
|
||||||
|
.source 1 y guint8
|
||||||
|
.source 1 u guint8
|
||||||
|
.source 1 v guint8
|
||||||
|
.source 1 a guint8
|
||||||
|
.temp 2 uv
|
||||||
|
.temp 2 ay
|
||||||
|
.temp 1 tu
|
||||||
|
.temp 1 tv
|
||||||
|
|
||||||
|
loadupdb tu, u
|
||||||
|
loadupdb tv, v
|
||||||
|
mergebw uv, tu, tv
|
||||||
|
mergebw ay, a, y
|
||||||
|
mergewl d, ay, uv
|
||||||
|
|
||||||
.function cogorc_putline_I420
|
.function cogorc_putline_I420
|
||||||
.dest 2 y guint8
|
.dest 2 y guint8
|
||||||
|
@ -1678,4 +1694,24 @@ splitlw uv1, uv2, uvuv
|
||||||
x2 avgub uv, uv1, uv2
|
x2 avgub uv, uv1, uv2
|
||||||
swapw vu, uv
|
swapw vu, uv
|
||||||
|
|
||||||
|
.function cogorc_putline_A420
|
||||||
|
.dest 2 y guint8
|
||||||
|
.dest 1 u guint8
|
||||||
|
.dest 1 v guint8
|
||||||
|
.dest 2 a guint8
|
||||||
|
.source 8 ayuv guint8
|
||||||
|
.temp 4 ay
|
||||||
|
.temp 4 uv
|
||||||
|
.temp 2 uu
|
||||||
|
.temp 2 vv
|
||||||
|
.temp 1 t1
|
||||||
|
.temp 1 t2
|
||||||
|
|
||||||
|
x2 splitlw uv, ay, ayuv
|
||||||
|
x2 select1wb y, ay
|
||||||
|
x2 select0wb a, ay
|
||||||
|
x2 splitwb vv, uu, uv
|
||||||
|
splitwb t1, t2, uu
|
||||||
|
avgub u, t1, t2
|
||||||
|
splitwb t1, t2, vv
|
||||||
|
avgub v, t1, t2
|
||||||
|
|
Loading…
Reference in a new issue