1 .. -*- coding: utf-8; mode: rst -*-
3 .. _V4L2-PIX-FMT-YUV420M:
4 .. _v4l2-pix-fmt-yvu420m:
6 ************************************************************
7 V4L2_PIX_FMT_YUV420M ('YM12'), V4L2_PIX_FMT_YVU420M ('YM21')
8 ************************************************************
12 Variation of ``V4L2_PIX_FMT_YUV420`` and ``V4L2_PIX_FMT_YVU420`` with
13 planes non contiguous in memory.
19 This is a multi-planar format, as opposed to a packed format. The three
20 components are separated into three sub-images or planes.
22 The Y plane is first. The Y plane has one byte per pixel. For
23 ``V4L2_PIX_FMT_YUV420M`` the Cb data constitutes the second plane which
24 is half the width and half the height of the Y plane (and of the image).
25 Each Cb belongs to four pixels, a two-by-two square of the image. For
26 example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`,
27 Y'\ :sub:`10`, and Y'\ :sub:`11`. The Cr data, just like the Cb plane,
28 is in the third plane.
30 ``V4L2_PIX_FMT_YVU420M`` is the same except the Cr data is stored in the
31 second plane and the Cb data in the third plane.
33 If the Y plane has pad bytes after each row, then the Cb and Cr planes
34 have half as many pad bytes after their rows. In other words, two Cx
35 rows (including padding) is exactly as long as one Y row (including
38 ``V4L2_PIX_FMT_YUV420M`` and ``V4L2_PIX_FMT_YVU420M`` are intended to be
39 used only in drivers and applications that support the multi-planar API,
40 described in :ref:`planar-apis`.
43 Each cell is one byte.
88 **Color Sample Location..**