Commit 7b81fd69 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

WIP: video: Add MT21C support

This is just an experiement, basically this code only detiled the format as
this is all we know about it for now.

This is NV12, tiled 16x32 (linear), but then in each tiles there seems to be a
compression and in the chroma there seems to be some extra data at the bottom
right. The sample does not have anough chroma complexity to show if there is
some bit that does not get compressed.
parent 05458f05
Pipeline #457970 waiting for manual action with stages
in 49 seconds
......@@ -7311,6 +7311,7 @@ get_scale_format (GstVideoFormat format, gint plane)
case GST_VIDEO_FORMAT_NV12_64Z32:
case GST_VIDEO_FORMAT_NV12_4L4:
case GST_VIDEO_FORMAT_NV12_32L32:
case GST_VIDEO_FORMAT_NV12_16L32:
case GST_VIDEO_FORMAT_A420_10BE:
case GST_VIDEO_FORMAT_A420_10LE:
case GST_VIDEO_FORMAT_A422_10BE:
......
......@@ -6848,6 +6848,7 @@ typedef struct
/* tile_mode, tile_ws (width shift), tile_hs (height shift) */
#define TILE_4x4(mode) GST_VIDEO_TILE_MODE_ ##mode, 2, 2
#define TILE_16x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 4, 5
#define TILE_32x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 5, 5
#define TILE_64x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 6, 5
......@@ -7145,6 +7146,9 @@ static const VideoFormat formats[] = {
PLANE0, OFFS6420, SUB444, PACK_ABGR64_LE),
MAKE_RGBA_FORMAT (ABGR64_BE, "raw video", DPTH16_16_16_16, PSTR8888, PLANE0,
OFFS6420, SUB4444, PACK_ABGR64_BE),
MAKE_YUV_T_FORMAT (NV12_16L32, "raw video",
GST_MAKE_FOURCC ('M', 'T', '2', '1'), DPTH888, PSTR122, PLANE011,
OFFS001, SUB420, PACK_NV12_TILED, TILE_16x32 (LINEAR)),
};
static GstVideoFormat
......
......@@ -142,6 +142,7 @@ G_BEGIN_DECLS
* @GST_VIDEO_FORMAT_BGRA64_BE: reverse RGB with alpha channel last, 16 bits per channel
* @GST_VIDEO_FORMAT_ABGR64_LE: reverse RGB with alpha channel first, 16 bits per channel
* @GST_VIDEO_FORMAT_ABGR64_BE: reverse RGB with alpha channel first, 16 bits per channel
* @GST_VIDEO_FORMAT_NV12_16L32: NV12 with 16x32 tiles in linear order (Since: 1.18)
*
* Enum value describing the most common video formats.
*
......@@ -370,6 +371,15 @@ typedef enum {
* Since: 1.20
*/
GST_VIDEO_FORMAT_ABGR64_BE,
/**
* GST_VIDEO_FORMAT_NV12_16L32:
*
* NV12 with 16x32 tiles in linear order.
*
* Since: 1.18
*/
GST_VIDEO_FORMAT_NV12_16L32,
} GstVideoFormat;
#define GST_VIDEO_MAX_PLANES 4
......@@ -745,7 +755,7 @@ gconstpointer gst_video_format_get_palette (GstVideoFormat format, gsi
"I422_10BE, I422_10LE, NV16_10LE32, Y210, v210, UYVP, I420_10BE, I420_10LE, " \
"P010_10BE, P010_10LE, NV12_10LE32, NV12_10LE40, Y444, RGBP, GBR, BGRP, NV24, xBGR, BGRx, " \
"xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, " \
"YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, Y41B, IYU1, YVU9, YUV9, RGB16, " \
"YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, NV12_16L32, Y41B, IYU1, YVU9, YUV9, RGB16, " \
"BGR16, RGB15, BGR15, RGB8P, GRAY16_BE, GRAY16_LE, GRAY10_LE32, GRAY8 }"
#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
#define GST_VIDEO_FORMATS_ALL "{ ABGR64_LE, BGRA64_LE, AYUV64, ARGB64_LE, ARGB64, " \
......@@ -758,7 +768,7 @@ gconstpointer gst_video_format_get_palette (GstVideoFormat format, gsi
"I422_10LE, I422_10BE, NV16_10LE32, Y210, v210, UYVP, I420_10LE, I420_10BE, " \
"P010_10LE, NV12_10LE32, NV12_10LE40, P010_10BE, Y444, RGBP, GBR, BGRP, NV24, xBGR, BGRx, " \
"xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, " \
"YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, Y41B, IYU1, YVU9, YUV9, RGB16, " \
"YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, NV12_16L32, Y41B, IYU1, YVU9, YUV9, RGB16, " \
"BGR16, RGB15, BGR15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }"
#endif
......
......@@ -1078,6 +1078,7 @@ fill_planes (GstVideoInfo * info, gsize plane_size[GST_VIDEO_MAX_PLANES])
break;
case GST_VIDEO_FORMAT_NV12_4L4:
case GST_VIDEO_FORMAT_NV12_32L32:
case GST_VIDEO_FORMAT_NV12_16L32:
{
gint ws = GST_VIDEO_FORMAT_INFO_TILE_WS (info->finfo);
gint hs = GST_VIDEO_FORMAT_INFO_TILE_HS (info->finfo);
......
......@@ -126,6 +126,7 @@ check_pad_template (GstPadTemplate * tmpl)
case GST_VIDEO_FORMAT_NV12_64Z32:
case GST_VIDEO_FORMAT_NV12_4L4:
case GST_VIDEO_FORMAT_NV12_32L32:
case GST_VIDEO_FORMAT_NV12_16L32:
GST_LOG ("Ignoring lack of support for format %s", fmt_str);
break;
default:
......
......@@ -3203,6 +3203,7 @@ GST_START_TEST (test_video_formats_pstrides)
|| fmt == GST_VIDEO_FORMAT_NV12_64Z32
|| fmt == GST_VIDEO_FORMAT_NV12_4L4
|| fmt == GST_VIDEO_FORMAT_NV12_32L32
|| fmt == GST_VIDEO_FORMAT_NV12_16L32
|| fmt == GST_VIDEO_FORMAT_NV12_10LE32
|| fmt == GST_VIDEO_FORMAT_NV16_10LE32
|| fmt == GST_VIDEO_FORMAT_NV12_10LE40
......
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