static void
get_tile_NV12 (gint tile_width, gint ts, gint tx, gint ty,
+ GstVideoTileMode mode,
const gpointer data[GST_VIDEO_MAX_PLANES],
const gint stride[GST_VIDEO_MAX_PLANES],
gpointer tile_data[GST_VIDEO_MAX_PLANES],
gsize offset;
/* index of Y tile */
- offset = gst_video_tile_get_index (GST_VIDEO_TILE_MODE_ZFLIPZ_2X2,
+ offset = gst_video_tile_get_index (mode,
tx, ty, GST_VIDEO_TILE_X_TILES (stride[0]),
GST_VIDEO_TILE_Y_TILES (stride[0]));
offset <<= ts;
tile_data[0] = ((guint8 *) data[0]) + offset;
/* index of UV tile */
- offset = gst_video_tile_get_index (GST_VIDEO_TILE_MODE_ZFLIPZ_2X2,
+ offset = gst_video_tile_get_index (mode,
tx, ty >> 1, GST_VIDEO_TILE_X_TILES (stride[1]),
GST_VIDEO_TILE_Y_TILES (stride[1]));
offset <<= ts;
tile_stride[0] = tile_stride[1] = tile_width;
}
-#define PACK_NV12_64Z32 GST_VIDEO_FORMAT_AYUV, unpack_NV12_64Z32, 1, pack_NV12_64Z32
+#define PACK_NV12_TILED GST_VIDEO_FORMAT_AYUV, unpack_NV12_TILED, 1, pack_NV12_TILED
static void
-unpack_NV12_64Z32 (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
+unpack_NV12_TILED (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
gpointer dest, const gpointer data[GST_VIDEO_MAX_PLANES],
const gint stride[GST_VIDEO_MAX_PLANES], gint x, gint y, gint width)
{
gint tstride[GST_VIDEO_MAX_PLANES];
gint unpack_width;
- get_tile_NV12 (tile_width, ts, tx, ty, data, stride, tdata, tstride);
+ get_tile_NV12 (tile_width, ts, tx, ty, info->tile_mode,
+ data, stride, tdata, tstride);
/* the number of bytes left to unpack */
unpack_width = MIN (width - x, tile_width - x);
}
static void
-pack_NV12_64Z32 (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
+pack_NV12_TILED (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
const gpointer src, gint sstride, gpointer data[GST_VIDEO_MAX_PLANES],
const gint stride[GST_VIDEO_MAX_PLANES], GstVideoChromaSite chroma_site,
gint y, gint width)
gint tstride[GST_VIDEO_MAX_PLANES];
gint pack_width;
- get_tile_NV12 (tile_width, ts, tx, ty, data, stride, tdata, tstride);
+ get_tile_NV12 (tile_width, ts, tx, ty, info->tile_mode,
+ data, stride, tdata, tstride);
/* the number of bytes left to pack */
pack_width = MIN (width, tile_width);
/* tile_mode, tile_width, tile_height */
#define TILE_64x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 6, 5
+#define TILE_4x4(mode) GST_VIDEO_TILE_MODE_ ##mode, 2, 2
#define MAKE_YUV_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
{ fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV, depth, pstride, plane, offs, sub, pack } }
DPTH888, PSTR122, PLANE011, OFFS001, SUB444, PACK_NV24),
MAKE_YUV_T_FORMAT (NV12_64Z32, "raw video",
GST_MAKE_FOURCC ('T', 'M', '1', '2'), DPTH888, PSTR122, PLANE011,
- OFFS001, SUB420, PACK_NV12_64Z32, TILE_64x32 (ZFLIPZ_2X2)),
+ OFFS001, SUB420, PACK_NV12_TILED, TILE_64x32 (ZFLIPZ_2X2)),
MAKE_YUVA_FORMAT (A420_10BE, "raw video", 0x00000000, DPTH10_10_10_10,
PSTR2222, PLANE0123, OFFS0, SUB4204, PACK_A420_10BE),
MAKE_YUVA_LE_FORMAT (A420_10LE, "raw video", 0x00000000, DPTH10_10_10_10,
PSTR8888, PLANE0, OFFS0, SUB4444, PACK_Y412_BE),
MAKE_YUV_LE_FORMAT (Y412_LE, "raw video", 0x00000000, DPTH12_12_12_12_HI,
PSTR8888, PLANE0, OFFS0, SUB4444, PACK_Y412_LE),
+ MAKE_YUV_T_FORMAT (NV12_4L4, "raw video",
+ GST_MAKE_FOURCC ('V', 'T', '1', '2'), DPTH888, PSTR122, PLANE011,
+ OFFS001, SUB420, PACK_NV12_TILED, TILE_4x4 (LINEAR)),
};
static GstVideoFormat
* @GST_VIDEO_FORMAT_Y212_LE: packed 4:2:2 YUV, 12 bits per channel (Y-U-Y-V) (Since: 1.18)
* @GST_VIDEO_FORMAT_Y412_BE: packed 4:4:4:4 YUV, 12 bits per channel(U-Y-V-A...) (Since: 1.18)
* @GST_VIDEO_FORMAT_Y412_LE: packed 4:4:4:4 YUV, 12 bits per channel(U-Y-V-A...) (Since: 1.18)
+ * @GST_VIDEO_FORMAT_NV12_4L4: NV12 with 4x4 tiles in linear order (Since: 1.18)
*
* Enum value describing the most common video formats.
*
GST_VIDEO_FORMAT_Y212_LE,
GST_VIDEO_FORMAT_Y412_BE,
GST_VIDEO_FORMAT_Y412_LE,
+ /**
+ * GST_VIDEO_FORMAT_NV12_4L4:
+ *
+ * NV12 with 4x4 tiles in linear order.
+ *
+ * Since: 1.18
+ */
+ GST_VIDEO_FORMAT_NV12_4L4,
} GstVideoFormat;
#define GST_VIDEO_MAX_PLANES 4
"I422_10BE, I422_10LE, NV16_10LE32, Y210, v210, UYVP, I420_10BE, I420_10LE, " \
"P010_10BE, P010_10LE, NV12_10LE32, NV12_10LE40, Y444, GBR, NV24, xBGR, BGRx, " \
"xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, " \
- "YV12, NV21, NV12, NV12_64Z32, Y41B, IYU1, YVU9, YUV9, RGB16, BGR16, RGB15, BGR15, " \
+ "YV12, NV21, NV12, NV12_64Z32, NV12_4L4, 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 "{ AYUV64, ARGB64, GBRA_12LE, GBRA_12BE, Y412_LE, " \
"I422_10LE, I422_10BE, NV16_10LE32, Y210, v210, UYVP, I420_10LE, I420_10BE, " \
"P010_10LE, NV12_10LE32, NV12_10LE40, P010_10BE, Y444, GBR, NV24, xBGR, BGRx, " \
"xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, " \
- "YV12, NV21, NV12, NV12_64Z32, Y41B, IYU1, YVU9, YUV9, RGB16, BGR16, RGB15, BGR15, " \
+ "YV12, NV21, NV12, NV12_64Z32, NV12_4L4, Y41B, IYU1, YVU9, YUV9, RGB16, BGR16, RGB15, BGR15, " \
"RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }"
#endif