Skip to content

Commit 2470d3c

Browse files
6by9popcornmix
authored andcommitted
media: Add a pixel format for MIPI packed 14bit luma only.
This is the format used by monochrome 14bit image sensors. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent c12a380 commit 2470d3c

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.. Permission is granted to copy, distribute and/or modify this
2+
.. document under the terms of the GNU Free Documentation License,
3+
.. Version 1.1 or any later version published by the Free Software
4+
.. Foundation, with no Invariant Sections, no Front-Cover Texts
5+
.. and no Back-Cover Texts. A copy of the license is included at
6+
.. Documentation/media/uapi/fdl-appendix.rst.
7+
..
8+
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9+
10+
.. _V4L2-PIX-FMT-Y14P:
11+
12+
**************************
13+
V4L2_PIX_FMT_Y14P ('Y14P')
14+
**************************
15+
16+
Grey-scale image as a MIPI RAW14 packed array
17+
18+
19+
Description
20+
===========
21+
22+
This is a packed grey-scale image format with a depth of 14 bits per
23+
pixel. Every four consecutive samples are packed into seven bytes. Each
24+
of the first four bytes contain the eight high order bits of the pixels,
25+
and the three following bytes contains the six least significants bits of
26+
each pixel, in the same order.
27+
28+
**Byte Order.**
29+
Each cell is one byte.
30+
31+
.. tabularcolumns:: |p{1.8cm}|p{1.0cm}|p{1.0cm}|p{1.0cm}|p{1.1cm}|p{3.3cm}|p{3.3cm}|p{3.3cm}|
32+
33+
.. flat-table::
34+
:header-rows: 0
35+
:stub-columns: 0
36+
:widths: 2 1 1 1 1 3 3 3
37+
38+
39+
- - start + 0:
40+
- Y'\ :sub:`00high`
41+
- Y'\ :sub:`01high`
42+
- Y'\ :sub:`02high`
43+
- Y'\ :sub:`03high`
44+
- Y'\ :sub:`01low bits 1--0`\ (bits 7--6)
45+
46+
Y'\ :sub:`00low bits 5--0`\ (bits 5--0)
47+
48+
- Y'\ :sub:`02low bits 3--0`\ (bits 7--4)
49+
50+
Y'\ :sub:`01low bits 5--2`\ (bits 3--0)
51+
52+
- Y'\ :sub:`03low bits 5--0`\ (bits 7--2)
53+
54+
Y'\ :sub:`02low bits 5--4`\ (bits 1--0)

‎Documentation/userspace-api/media/v4l/yuv-formats.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ image.
268268
pixfmt-yuv-planar
269269
pixfmt-yuv-luma
270270
pixfmt-y12p
271+
pixfmt-y14p
271272
pixfmt-y8i
272273
pixfmt-y12i
273274
pixfmt-uv8

‎drivers/media/v4l2-core/v4l2-ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
12851285
case V4L2_PIX_FMT_Y10BPACK: descr = "10-bit Greyscale (Packed)"; break;
12861286
case V4L2_PIX_FMT_Y10P: descr = "10-bit Greyscale (MIPI Packed)"; break;
12871287
case V4L2_PIX_FMT_Y12P: descr = "12-bit Greyscale (MIPI Packed)"; break;
1288+
case V4L2_PIX_FMT_Y14P: descr = "14-bit Greyscale (MIPI Packed)"; break;
12881289
case V4L2_PIX_FMT_Y8I: descr = "Interleaved 8-bit Greyscale"; break;
12891290
case V4L2_PIX_FMT_Y12I: descr = "Interleaved 12-bit Greyscale"; break;
12901291
case V4L2_PIX_FMT_Z16: descr = "16-bit Depth"; break;

‎include/uapi/linux/videodev2.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ struct v4l2_pix_format {
575575
#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
576576
#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale, MIPI RAW10 packed */
577577
#define V4L2_PIX_FMT_Y12P v4l2_fourcc('Y', '1', '2', 'P') /* 12 Greyscale, MIPI RAW12 packed */
578+
#define V4L2_PIX_FMT_Y14P v4l2_fourcc('Y', '1', '4', 'P') /* 14 Greyscale, MIPI RAW12 packed */
578579

579580
/* Palette formats */
580581
#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */

0 commit comments

Comments
 (0)