xref: /linux/Documentation/userspace-api/media/v4l/metafmt-generic.rst (revision a5844227e0f030d2af2d85d4aed10c5eca6ca176)
1.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2.. c:namespace:: V4L
3
4********************************************************************************************************************************************************************************************************************************************************************************
5V4L2_META_FMT_GENERIC_8 ('MET8'), V4L2_META_FMT_GENERIC_CSI2_10 ('MC1A'), V4L2_META_FMT_GENERIC_CSI2_12 ('MC1C'), V4L2_META_FMT_GENERIC_CSI2_14 ('MC1E'), V4L2_META_FMT_GENERIC_CSI2_16 ('MC1G'), V4L2_META_FMT_GENERIC_CSI2_20 ('MC1K'), V4L2_META_FMT_GENERIC_CSI2_24 ('MC1O')
6********************************************************************************************************************************************************************************************************************************************************************************
7
8
9Generic line-based metadata formats
10
11
12Description
13===========
14
15These generic line-based metadata formats define the memory layout of the data
16without defining the format or meaning of the metadata itself.
17
18.. _v4l2-meta-fmt-generic-8:
19
20V4L2_META_FMT_GENERIC_8
21-----------------------
22
23The V4L2_META_FMT_GENERIC_8 format is a plain 8-bit metadata format. This format
24is used on CSI-2 for 8 bits per :term:`Data Unit`.
25
26Additionally it is used for 16 bits per Data Unit when two bytes of metadata are
27packed into one 16-bit Data Unit. Otherwise the 16 bits per pixel dataformat is
28:ref:`V4L2_META_FMT_GENERIC_CSI2_16 <v4l2-meta-fmt-generic-csi2-16>`.
29
30**Byte Order Of V4L2_META_FMT_GENERIC_8.**
31Each cell is one byte. "M" denotes a byte of metadata.
32
33.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|
34
35.. flat-table:: Sample 4x2 Metadata Frame
36    :header-rows:  0
37    :stub-columns: 0
38    :widths: 12 8 8 8 8
39
40    * - start + 0:
41      - M\ :sub:`00`
42      - M\ :sub:`10`
43      - M\ :sub:`20`
44      - M\ :sub:`30`
45    * - start + 4:
46      - M\ :sub:`01`
47      - M\ :sub:`11`
48      - M\ :sub:`21`
49      - M\ :sub:`31`
50
51.. _v4l2-meta-fmt-generic-csi2-10:
52
53V4L2_META_FMT_GENERIC_CSI2_10
54-----------------------------
55
56V4L2_META_FMT_GENERIC_CSI2_10 contains 8-bit generic metadata packed in 10-bit
57Data Units, with one padding byte after every four bytes of metadata. This
58format is typically used by CSI-2 receivers with a source that transmits
59MEDIA_BUS_FMT_META_10 and the CSI-2 receiver writes the received data to memory
60as-is.
61
62The packing of the data follows the MIPI CSI-2 specification and the padding of
63the data is defined in the MIPI CCS specification.
64
65This format is also used in conjunction with 20 bits per :term:`Data Unit`
66formats that pack two bytes of metadata into one Data Unit. Otherwise the
6720 bits per pixel dataformat is :ref:`V4L2_META_FMT_GENERIC_CSI2_20
68<v4l2-meta-fmt-generic-csi2-20>`.
69
70This format is little endian.
71
72**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_10.**
73Each cell is one byte. "M" denotes a byte of metadata and "x" a byte of padding.
74
75.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.8cm}|
76
77.. flat-table:: Sample 4x2 Metadata Frame
78    :header-rows:  0
79    :stub-columns: 0
80    :widths: 12 8 8 8 8 8
81
82    * - start + 0:
83      - M\ :sub:`00`
84      - M\ :sub:`10`
85      - M\ :sub:`20`
86      - M\ :sub:`30`
87      - x
88    * - start + 5:
89      - M\ :sub:`01`
90      - M\ :sub:`11`
91      - M\ :sub:`21`
92      - M\ :sub:`31`
93      - x
94
95.. _v4l2-meta-fmt-generic-csi2-12:
96
97V4L2_META_FMT_GENERIC_CSI2_12
98-----------------------------
99
100V4L2_META_FMT_GENERIC_CSI2_12 contains 8-bit generic metadata packed in 12-bit
101Data Units, with one padding byte after every two bytes of metadata. This format
102is typically used by CSI-2 receivers with a source that transmits
103MEDIA_BUS_FMT_META_12 and the CSI-2 receiver writes the received data to memory
104as-is.
105
106The packing of the data follows the MIPI CSI-2 specification and the padding of
107the data is defined in the MIPI CCS specification.
108
109This format is also used in conjunction with 24 bits per :term:`Data Unit`
110formats that pack two bytes of metadata into one Data Unit. Otherwise the
11124 bits per pixel dataformat is :ref:`V4L2_META_FMT_GENERIC_CSI2_24
112<v4l2-meta-fmt-generic-csi2-24>`.
113
114This format is little endian.
115
116**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_12.**
117Each cell is one byte. "M" denotes a byte of metadata and "x" a byte of padding.
118
119.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{1.2cm}|p{1.8cm}|p{1.2cm}|p{1.2cm}|p{1.8cm}|
120
121.. flat-table:: Sample 4x2 Metadata Frame
122    :header-rows:  0
123    :stub-columns: 0
124    :widths: 12 8 8 8 8 8 8
125
126    * - start + 0:
127      - M\ :sub:`00`
128      - M\ :sub:`10`
129      - x
130      - M\ :sub:`20`
131      - M\ :sub:`30`
132      - x
133    * - start + 6:
134      - M\ :sub:`01`
135      - M\ :sub:`11`
136      - x
137      - M\ :sub:`21`
138      - M\ :sub:`31`
139      - x
140
141.. _v4l2-meta-fmt-generic-csi2-14:
142
143V4L2_META_FMT_GENERIC_CSI2_14
144-----------------------------
145
146V4L2_META_FMT_GENERIC_CSI2_14 contains 8-bit generic metadata packed in 14-bit
147Data Units, with three padding bytes after every four bytes of metadata. This
148format is typically used by CSI-2 receivers with a source that transmits
149MEDIA_BUS_FMT_META_14 and the CSI-2 receiver writes the received data to memory
150as-is.
151
152The packing of the data follows the MIPI CSI-2 specification and the padding of
153the data is defined in the MIPI CCS specification.
154
155This format is little endian.
156
157**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_14.**
158Each cell is one byte. "M" denotes a byte of metadata and "x" a byte of padding.
159
160.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.8cm}|p{1.8cm}|p{1.8cm}|
161
162.. flat-table:: Sample 4x2 Metadata Frame
163    :header-rows:  0
164    :stub-columns: 0
165    :widths: 12 8 8 8 8 8 8 8
166
167    * - start + 0:
168      - M\ :sub:`00`
169      - M\ :sub:`10`
170      - M\ :sub:`20`
171      - M\ :sub:`30`
172      - x
173      - x
174      - x
175    * - start + 7:
176      - M\ :sub:`01`
177      - M\ :sub:`11`
178      - M\ :sub:`21`
179      - M\ :sub:`31`
180      - x
181      - x
182      - x
183
184.. _v4l2-meta-fmt-generic-csi2-16:
185
186V4L2_META_FMT_GENERIC_CSI2_16
187-----------------------------
188
189V4L2_META_FMT_GENERIC_CSI2_16 contains 8-bit generic metadata packed in 16-bit
190Data Units, with one padding byte after every byte of metadata. This format is
191typically used by CSI-2 receivers with a source that transmits
192MEDIA_BUS_FMT_META_16 and the CSI-2 receiver writes the received data to memory
193as-is.
194
195The packing of the data follows the MIPI CSI-2 specification and the padding of
196the data is defined in the MIPI CCS specification.
197
198Some devices support more efficient packing of metadata in conjunction with
19916-bit image data. In that case the dataformat is
200:ref:`V4L2_META_FMT_GENERIC_8 <v4l2-meta-fmt-generic-8>`.
201
202This format is little endian.
203
204**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_16.**
205Each cell is one byte. "M" denotes a byte of metadata and "x" a byte of padding.
206
207.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{.8cm}|p{1.2cm}|p{.8cm}|p{1.2cm}|p{.8cm}|p{1.2cm}|p{.8cm}|
208
209.. flat-table:: Sample 4x2 Metadata Frame
210    :header-rows:  0
211    :stub-columns: 0
212    :widths: 12 8 8 8 8 8 8 8 8
213
214    * - start + 0:
215      - M\ :sub:`00`
216      - x
217      - M\ :sub:`10`
218      - x
219      - M\ :sub:`20`
220      - x
221      - M\ :sub:`30`
222      - x
223    * - start + 8:
224      - M\ :sub:`01`
225      - x
226      - M\ :sub:`11`
227      - x
228      - M\ :sub:`21`
229      - x
230      - M\ :sub:`31`
231      - x
232
233.. _v4l2-meta-fmt-generic-csi2-20:
234
235V4L2_META_FMT_GENERIC_CSI2_20
236-----------------------------
237
238V4L2_META_FMT_GENERIC_CSI2_20 contains 8-bit generic metadata packed in 20-bit
239Data Units, with alternating one or two padding bytes after every byte of
240metadata. This format is typically used by CSI-2 receivers with a source that
241transmits MEDIA_BUS_FMT_META_20 and the CSI-2 receiver writes the received data
242to memory as-is.
243
244The packing of the data follows the MIPI CSI-2 specification and the padding of
245the data is defined in the MIPI CCS specification.
246
247Some devices support more efficient packing of metadata in conjunction with
24816-bit image data. In that case the dataformat is
249:ref:`V4L2_META_FMT_GENERIC_CSI2_10 <v4l2-meta-fmt-generic-csi2-10>`.
250
251This format is little endian.
252
253**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_20.**
254Each cell is one byte. "M" denotes a byte of metadata and "x" a byte of padding.
255
256.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.8cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.2cm}|p{1.8cm}
257
258.. flat-table:: Sample 4x2 Metadata Frame
259    :header-rows:  0
260    :stub-columns: 0
261    :widths: 12 8 8 8 8 8 8 8 8 8 8
262
263    * - start + 0:
264      - M\ :sub:`00`
265      - x
266      - M\ :sub:`10`
267      - x
268      - x
269      - M\ :sub:`20`
270      - x
271      - M\ :sub:`30`
272      - x
273      - x
274    * - start + 10:
275      - M\ :sub:`01`
276      - x
277      - M\ :sub:`11`
278      - x
279      - x
280      - M\ :sub:`21`
281      - x
282      - M\ :sub:`31`
283      - x
284      - x
285
286.. _v4l2-meta-fmt-generic-csi2-24:
287
288V4L2_META_FMT_GENERIC_CSI2_24
289-----------------------------
290
291V4L2_META_FMT_GENERIC_CSI2_24 contains 8-bit generic metadata packed in 24-bit
292Data Units, with two padding bytes after every byte of metadata. This format is
293typically used by CSI-2 receivers with a source that transmits
294MEDIA_BUS_FMT_META_24 and the CSI-2 receiver writes the received data to memory
295as-is.
296
297The packing of the data follows the MIPI CSI-2 specification and the padding of
298the data is defined in the MIPI CCS specification.
299
300Some devices support more efficient packing of metadata in conjunction with
30116-bit image data. In that case the dataformat is
302:ref:`V4L2_META_FMT_GENERIC_CSI2_12 <v4l2-meta-fmt-generic-csi2-12>`.
303
304This format is little endian.
305
306**Byte Order Of V4L2_META_FMT_GENERIC_CSI2_24.**
307Each cell is one byte. "M" denotes a byte of metadata and "x" a byte of padding.
308
309.. tabularcolumns:: |p{2.4cm}|p{1.2cm}|p{.8cm}|p{.8cm}|p{1.2cm}|p{.8cm}|p{.8cm}|p{1.2cm}|p{.8cm}|p{.8cm}|p{1.2cm}|p{.8cm}|p{.8cm}|
310
311.. flat-table:: Sample 4x2 Metadata Frame
312    :header-rows:  0
313    :stub-columns: 0
314    :widths: 12 8 8 8 8 8 8 8 8 8 8 8 8
315
316    * - start + 0:
317      - M\ :sub:`00`
318      - x
319      - x
320      - M\ :sub:`10`
321      - x
322      - x
323      - M\ :sub:`20`
324      - x
325      - x
326      - M\ :sub:`30`
327      - x
328      - x
329    * - start + 12:
330      - M\ :sub:`01`
331      - x
332      - x
333      - M\ :sub:`11`
334      - x
335      - x
336      - M\ :sub:`21`
337      - x
338      - x
339      - M\ :sub:`31`
340      - x
341      - x
342