1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="yuv-formats.html" title="YUV Formats"><link rel="prev" href="re30.html" title="V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')"><link rel="next" href="re32.html" title="V4L2_PIX_FMT_NV12MT ('TM12')"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re30.html">Prev</a>&#160;</td><th width="60%" align="center">YUV Formats</th><td width="20%" align="right">&#160;<a accesskey="n" href="re32.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="idp1102513484"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p><code class="constant">V4L2_PIX_FMT_NV12M</code>, <code class="constant">V4L2_PIX_FMT_NV21M</code>, <code class="constant">V4L2_PIX_FMT_NV12MT_16X16</code> &#8212; Variation of <code class="constant">V4L2_PIX_FMT_NV12</code> and <code class="constant">V4L2_PIX_FMT_NV21</code> with planes
2	  non contiguous in memory. </p></div><div class="refsect1"><a name="idp1102512316"></a><h2>Description</h2><p>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
3The three components are separated into two sub-images or planes.
4<code class="constant">V4L2_PIX_FMT_NV12M</code> differs from <code class="constant">V4L2_PIX_FMT_NV12
5</code> in that the two planes are non-contiguous in memory, i.e. the chroma
6plane do not necessarily immediately follows the luma plane.
7The luminance data occupies the first plane. The Y plane has one byte per pixel.
8In the second plane there is a chrominance data with alternating chroma samples.
9The CbCr plane is the same width, in bytes, as the Y plane (and of the image),
10but is half as tall in pixels. Each CbCr pair belongs to four pixels. For example,
11Cb<sub>0</sub>/Cr<sub>0</sub> belongs to
12Y'<sub>00</sub>, Y'<sub>01</sub>,
13Y'<sub>10</sub>, Y'<sub>11</sub>.
14<code class="constant">V4L2_PIX_FMT_NV12MT_16X16</code> is the tiled version of
15<code class="constant">V4L2_PIX_FMT_NV12M</code> with 16x16 macroblock tiles. Here pixels
16are arranged in 16x16 2D tiles and tiles are arranged in linear order in memory.
17<code class="constant">V4L2_PIX_FMT_NV21M</code> is the same as <code class="constant">V4L2_PIX_FMT_NV12M</code>
18except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</p><p><code class="constant">V4L2_PIX_FMT_NV12M</code> is intended to be
19used only in drivers and applications that support the multi-planar API,
20described in <a class="xref" href="planar-apis.html" title="Single- and multi-planar APIs">the section called &#8220;Single- and multi-planar APIs&#8221;</a>. </p><p>If the Y plane has pad bytes after each row, then the
21CbCr plane has as many pad bytes after its rows.</p><div class="example"><a name="idp1102579452"></a><p class="title"><b>Example&#160;2.28.&#160;<code class="constant">V4L2_PIX_FMT_NV12M</code> 4 &#215; 4 pixel image</b></p><div class="example-contents"><p><b>Byte Order.&#160;</b>Each cell is one byte.
22		</p><div class="informaltable"><table border="0"><colgroup><col align="left"><col><col><col><col></colgroup><tbody valign="top"><tr><td align="left" valign="top">start0&#160;+&#160;0:</td><td align="center" valign="top">Y'<sub>00</sub></td><td align="center" valign="top">Y'<sub>01</sub></td><td align="center" valign="top">Y'<sub>02</sub></td><td align="center" valign="top">Y'<sub>03</sub></td></tr><tr><td align="left" valign="top">start0&#160;+&#160;4:</td><td align="center" valign="top">Y'<sub>10</sub></td><td align="center" valign="top">Y'<sub>11</sub></td><td align="center" valign="top">Y'<sub>12</sub></td><td align="center" valign="top">Y'<sub>13</sub></td></tr><tr><td align="left" valign="top">start0&#160;+&#160;8:</td><td align="center" valign="top">Y'<sub>20</sub></td><td align="center" valign="top">Y'<sub>21</sub></td><td align="center" valign="top">Y'<sub>22</sub></td><td align="center" valign="top">Y'<sub>23</sub></td></tr><tr><td align="left" valign="top">start0&#160;+&#160;12:</td><td align="center" valign="top">Y'<sub>30</sub></td><td align="center" valign="top">Y'<sub>31</sub></td><td align="center" valign="top">Y'<sub>32</sub></td><td align="center" valign="top">Y'<sub>33</sub></td></tr><tr><td align="left" valign="top">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td></tr><tr><td align="left" valign="top">start1&#160;+&#160;0:</td><td align="center" valign="top">Cb<sub>00</sub></td><td align="center" valign="top">Cr<sub>00</sub></td><td align="center" valign="top">Cb<sub>01</sub></td><td align="center" valign="top">Cr<sub>01</sub></td></tr><tr><td align="left" valign="top">start1&#160;+&#160;4:</td><td align="center" valign="top">Cb<sub>10</sub></td><td align="center" valign="top">Cr<sub>10</sub></td><td align="center" valign="top">Cb<sub>11</sub></td><td align="center" valign="top">Cr<sub>11</sub></td></tr></tbody></table></div><p>
23	      </p><p><b>Color Sample Location.&#160;</b>
24		</p><div class="informaltable"><table border="0"><colgroup><col><col><col><col><col><col><col></colgroup><tbody valign="top"><tr><td align="center" valign="top">&#160;</td><td align="center" valign="top">0</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">1</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">2</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">3</td></tr><tr><td align="center" valign="top">0</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td></tr><tr><td align="center" valign="top">&#160;</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">C</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">C</td><td align="center" valign="top">&#160;</td></tr><tr><td align="center" valign="top">1</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td></tr><tr><td align="center" valign="top">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td><td class="auto-generated">&#160;</td></tr><tr><td align="center" valign="top">2</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td></tr><tr><td align="center" valign="top">&#160;</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">C</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">C</td><td align="center" valign="top">&#160;</td></tr><tr><td align="center" valign="top">3</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td><td align="center" valign="top">&#160;</td><td align="center" valign="top">Y</td></tr></tbody></table></div><p>
25	      </p></div></div><br class="example-break"></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re30.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="yuv-formats.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re32.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;V4L2_PIX_FMT_NV12MT ('TM12')</td></tr></table></div></body></html>
26