}
}
+#define PACK_GRAY10_LE32 GST_VIDEO_FORMAT_AYUV64, unpack_GRAY10_LE32, 1, pack_GRAY10_LE32
+static void
+unpack_GRAY10_LE32 (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 i;
+ const guint32 *restrict sy = GET_PLANE_LINE (0, y);
+ guint16 *restrict d = dest;
+ gint num_words = (width + 2) / 3;
+
+ /* Y data is packed into little endian 32bit words, with the 2 MSB being
+ * padding. There is only 1 pattern.
+ * -> padding | Y1 | Y2 | Y3
+ */
+
+ for (i = 0; i < num_words; i++) {
+ gint num_comps = MIN (3, width - i * 3);
+ guint pix = i * 3;
+ gsize doff = pix * 4;
+ gint c;
+ guint32 Y;
+
+ Y = GST_READ_UINT32_LE (sy + i);
+
+ for (c = 0; c < num_comps; c++) {
+ guint16 Yn;
+
+ /* For Y, we simply read 10 bit and shift it out */
+ Yn = (Y & 0x03ff) << 6;
+ Y >>= 10;
+
+ if (G_UNLIKELY (pix + c < x))
+ continue;
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE))
+ Yn |= Yn >> 10;
+
+ d[doff + 0] = 0xffff;
+ d[doff + 1] = Yn;
+ d[doff + 2] = 0x8000;
+ d[doff + 3] = 0x8000;
+
+ doff += 4;
+ }
+ }
+}
+
+static void
+pack_GRAY10_LE32 (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 i;
+ guint32 *restrict dy = GET_PLANE_LINE (0, y);
+ const guint16 *restrict s = src;
+ gint num_words = (width + 2) / 3;
+
+ for (i = 0; i < num_words; i++) {
+ gint num_comps = MIN (3, width - i * 3);
+ guint pix = i * 3;
+ gsize soff = pix * 4;
+ gint c;
+ guint32 Y = 0;
+
+ for (c = 0; c < num_comps; c++) {
+ Y <<= 10;
+ Y |= s[soff + 1] >> 6;
+ }
+
+ GST_WRITE_UINT32_LE (dy + i, Y);
+
+ soff += 4;
+ }
+}
+
#define PACK_NV12_10LE32 GST_VIDEO_FORMAT_AYUV64, unpack_NV12_10LE32, 1, pack_NV12_10LE32
static void
unpack_NV12_10LE32 (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
{ 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY, depth, pstride, plane, offs, sub, pack } }
#define MAKE_GRAY_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
{ 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_GRAY_C_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
static const VideoFormat formats[] = {
{0x00000000, {GST_VIDEO_FORMAT_UNKNOWN, "UNKNOWN", "unknown video", 0, DPTH0,
PSTR222, PLANE012, OFFS0, SUB444, PACK_Y444_12BE),
MAKE_YUV_LE_FORMAT (Y444_12LE, "raw video", 0x00000000, DPTH12_12_12,
PSTR222, PLANE012, OFFS0, SUB444, PACK_Y444_12LE),
+ MAKE_GRAY_C_LE_FORMAT (GRAY10_LE32, "raw video", DPTH8, PSTR0, PLANE0, OFFS0,
+ SUB4, PACK_GRAY10_LE32),
MAKE_YUV_C_LE_FORMAT (NV12_10LE32, "raw video",
GST_MAKE_FOURCC ('X', 'V', '1', '5'), DPTH10_10_10, PSTR0, PLANE011,
OFFS001, SUB420, PACK_NV12_10LE32),
return GST_VIDEO_FORMAT_IYU1;
case GST_MAKE_FOURCC ('A', 'Y', '6', '4'):
return GST_VIDEO_FORMAT_AYUV64;
+ case GST_MAKE_FOURCC ('X', 'V', '1', '0'):
+ return GST_VIDEO_FORMAT_GRAY10_LE32;
case GST_MAKE_FOURCC ('X', 'V', '1', '5'):
return GST_VIDEO_FORMAT_NV12_10LE32;
default:
* @GST_VIDEO_FORMAT_NV21: planar 4:2:0 YUV with interleaved VU plane
* @GST_VIDEO_FORMAT_NV12_10LE32: 10-bit variant of @GST_VIDEO_FORMAT_NV12, packet in 32bit words (MSB 2 bits padding) (Since: 1.X)
* @GST_VIDEO_FORMAT_GRAY8: 8-bit grayscale
+ * @GST_VIDEO_FORMAT_GRAY10_LE32: 10-bit grayscale, packet in 32bit words (2 bits padding)
* @GST_VIDEO_FORMAT_GRAY16_BE: 16-bit grayscale, most significant byte first
* @GST_VIDEO_FORMAT_GRAY16_LE: 16-bit grayscale, least significant byte first
* @GST_VIDEO_FORMAT_v308: packed 4:4:4 YUV (Y-U-V ...)
GST_VIDEO_FORMAT_I422_12LE,
GST_VIDEO_FORMAT_Y444_12BE,
GST_VIDEO_FORMAT_Y444_12LE,
+ GST_VIDEO_FORMAT_GRAY10_LE32,
GST_VIDEO_FORMAT_NV12_10LE32,
} GstVideoFormat;
"A420_10LE, A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, " \
"P010_10LE, IYU2, VYUY, GBRA, GBRA_10BE, GBRA_10LE, GBR_12BE, GBR_12LE, " \
"GBRA_12BE, GBRA_12LE, I420_12BE, I420_12LE, I422_12BE, I422_12LE, " \
- "Y444_12BE, Y444_12LE, NV12_10LE32 }"
+ "Y444_12BE, Y444_12LE, GRAY10_LE32, NV12_10LE32 }"
/**
* GST_VIDEO_CAPS_MAKE: