xref: /linux/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst (revision 778b8ebe5192e7a7f00563a7456517dfa63e1d90)
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2.. c:namespace:: V4L
3
4.. _yuv-luma-only:
5
6*****************
7Luma-Only Formats
8*****************
9
10This family of formats only store the luma component of a Y'CbCr image. They
11are often referred to as greyscale formats.
12
13.. note::
14
15   - In all the tables that follow, bit 7 is the most significant bit in a byte.
16   - Formats are described with the minimum number of pixels needed to create a
17     byte-aligned repeating pattern. `...` indicates repetition of the pattern.
18   - Y'\ :sub:`x`\ [9:2] denotes bits 9 to 2 of the Y' value for pixel at column
19     `x`.
20   - `0` denotes padding bits set to 0.
21
22
23.. raw:: latex
24
25    \tiny
26
27.. tabularcolumns:: |p{3.6cm}|p{2.4cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|
28
29.. flat-table:: Luma-Only Image Formats
30    :header-rows: 1
31    :stub-columns: 0
32
33    * - Identifier
34      - Code
35      - Byte 0
36      - Byte 1
37      - Byte 2
38      - Byte 3
39      - Byte 4
40      - Byte 5
41      - Byte 6
42
43    * .. _V4L2-PIX-FMT-GREY:
44
45      - ``V4L2_PIX_FMT_GREY``
46      - 'GREY'
47
48      - Y'\ :sub:`0`\ [7:0]
49      - ...
50      - ...
51      - ...
52      - ...
53      - ...
54      - ...
55
56    * .. _V4L2-PIX-FMT-IPU3-Y10:
57
58      - ``V4L2_PIX_FMT_IPU3_Y10``
59      - 'ip3y'
60
61      - Y'\ :sub:`0`\ [7:0]
62      - Y'\ :sub:`1`\ [5:0] Y'\ :sub:`0`\ [9:8]
63      - Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [9:6]
64      - Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [9:4]
65      - Y'\ :sub:`3`\ [9:2]
66      - ...
67      - ...
68
69    * .. _V4L2-PIX-FMT-Y10:
70
71      - ``V4L2_PIX_FMT_Y10``
72      - 'Y10 '
73
74      - Y'\ :sub:`0`\ [7:0]
75      - `000000` Y'\ :sub:`0`\ [9:8]
76      - ...
77      - ...
78      - ...
79      - ...
80      - ...
81
82    * .. _V4L2-PIX-FMT-Y10BPACK:
83
84      - ``V4L2_PIX_FMT_Y10BPACK``
85      - 'Y10B'
86
87      - Y'\ :sub:`0`\ [9:2]
88      - Y'\ :sub:`0`\ [1:0] Y'\ :sub:`1`\ [9:4]
89      - Y'\ :sub:`1`\ [3:0] Y'\ :sub:`2`\ [9:6]
90      - Y'\ :sub:`2`\ [5:0] Y'\ :sub:`3`\ [9:8]
91      - Y'\ :sub:`3`\ [7:0]
92      - ...
93      - ...
94
95    * .. _V4L2-PIX-FMT-Y10P:
96
97      - ``V4L2_PIX_FMT_Y10P``
98      - 'Y10P'
99
100      - Y'\ :sub:`0`\ [9:2]
101      - Y'\ :sub:`1`\ [9:2]
102      - Y'\ :sub:`2`\ [9:2]
103      - Y'\ :sub:`3`\ [9:2]
104      - Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [1:0] Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [1:0]
105      - ...
106      - ...
107
108    * .. _V4L2-PIX-FMT-Y12:
109
110      - ``V4L2_PIX_FMT_Y12``
111      - 'Y12 '
112
113      - Y'\ :sub:`0`\ [7:0]
114      - `0000` Y'\ :sub:`0`\ [11:8]
115      - ...
116      - ...
117      - ...
118      - ...
119      - ...
120
121    * .. _V4L2-PIX-FMT-Y012:
122
123      - ``V4L2_PIX_FMT_Y012``
124      - 'Y012'
125
126      - Y'\ :sub:`0`\ [3:0] `0000`
127      - Y'\ :sub:`0`\ [11:4]
128      - ...
129      - ...
130      - ...
131      - ...
132      - ...
133
134    * .. _V4L2-PIX-FMT-Y12P:
135
136      - ``V4L2_PIX_FMT_Y12P``
137      - 'Y12P'
138
139      - Y'\ :sub:`0`\ [11:4]
140      - Y'\ :sub:`1`\ [11:4]
141      - Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [3:0]
142      - ...
143      - ...
144      - ...
145      - ...
146
147    * .. _V4L2-PIX-FMT-Y14:
148
149      - ``V4L2_PIX_FMT_Y14``
150      - 'Y14 '
151
152      - Y'\ :sub:`0`\ [7:0]
153      - `00` Y'\ :sub:`0`\ [13:8]
154      - ...
155      - ...
156      - ...
157      - ...
158      - ...
159
160    * .. _V4L2-PIX-FMT-Y14P:
161
162      - ``V4L2_PIX_FMT_Y14P``
163      - 'Y14P'
164
165      - Y'\ :sub:`0`\ [13:6]
166      - Y'\ :sub:`1`\ [13:6]
167      - Y'\ :sub:`2`\ [13:6]
168      - Y'\ :sub:`3`\ [13:6]
169      - Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [5:0]
170      - Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [5:2]
171      - Y'\ :sub:`3`\ [5:0] Y'\ :sub:`2`\ [5:4]
172
173    * .. _V4L2-PIX-FMT-Y16:
174
175      - ``V4L2_PIX_FMT_Y16``
176      - 'Y16 '
177
178      - Y'\ :sub:`0`\ [7:0]
179      - Y'\ :sub:`0`\ [15:8]
180      - ...
181      - ...
182      - ...
183      - ...
184      - ...
185
186    * .. _V4L2-PIX-FMT-Y16-BE:
187
188      - ``V4L2_PIX_FMT_Y16_BE``
189      - 'Y16 ' | (1U << 31)
190
191      - Y'\ :sub:`0`\ [15:8]
192      - Y'\ :sub:`0`\ [7:0]
193      - ...
194      - ...
195      - ...
196      - ...
197      - ...
198
199.. raw:: latex
200
201    \normalsize
202
203.. note::
204
205    For the Y16 and Y16_BE formats, the actual sampling precision may be lower
206    than 16 bits. For example, 10 bits per pixel uses values in the range 0 to
207    1023. For the IPU3_Y10 format 25 pixels are packed into 32 bytes, which
208    leaves the 6 most significant bits of the last byte padded with 0.
209
210    For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
211    padding zeros in the 4 low bits, in contrast to the Y12 format, which has
212    its padding located in the most significant bits of the 16 bit word.
213
214    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
215    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
216    specification.
217