1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>V4L2_PIX_FMT_NV12MT ('TM12')</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="re31.html" title="V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16"><link rel="next" href="re33.html" title="V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61')"></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_NV12MT ('TM12')</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re31.html">Prev</a> </td><th width="60%" align="center">YUV Formats</th><td width="20%" align="right"> <a accesskey="n" href="re33.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="idp1102576364"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p><code class="constant">V4L2_PIX_FMT_NV12MT 2</code> — Formats with ½ horizontal and vertical 3chroma resolution. This format has two planes - one for luminance and one for 4chrominance. Chroma samples are interleaved. The difference to 5<code class="constant">V4L2_PIX_FMT_NV12</code> is the memory layout. Pixels are 6grouped in macroblocks of 64x32 size. The order of macroblocks in memory is 7also not standard. 8 </p></div><div class="refsect1"><a name="idp1102579108"></a><h2>Description</h2><p>This is the two-plane versions of the YUV 4:2:0 format where data 9is grouped into 64x32 macroblocks. The three components are separated into two 10sub-images or planes. The Y plane has one byte per pixel and pixels are grouped 11into 64x32 macroblocks. The CbCr plane has the same width, in bytes, as the Y 12plane (and the image), but is half as tall in pixels. The chroma plane is also 13grouped into 64x32 macroblocks.</p><p>Width of the buffer has to be aligned to the multiple of 128, and 14height alignment is 32. Every four adjacent buffers - two horizontally and two 15vertically are grouped together and are located in memory in Z or flipped Z 16order. </p><p>Layout of macroblocks in memory is presented in the following 17figure.</p><div class="figure"><a name="nv12mt"></a><p class="title"><b>Figure 2.1. <code class="constant">V4L2_PIX_FMT_NV12MT</code> macroblock Z shape 18memory layout</b></p><div class="figure-contents"><div class="mediaobject"><img src="nv12mt.gif" alt="V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout"></div></div></div><p><br class="figure-break"> 19 The requirement that width is multiple of 128 is implemented because, 20the Z shape cannot be cut in half horizontally. In case the vertical resolution 21of macroblocks is odd then the last row of macroblocks is arranged in a linear 22order. </p><p>In case of chroma the layout is identical. Cb and Cr samples are 23interleaved. Height of the buffer is aligned to 32. 24 </p><div class="example"><a name="idp1102643932"></a><p class="title"><b>Example 2.29. Memory layout of macroblocks in <code class="constant">V4L2_PIX_FMT_NV12 25</code> format pixel image - extreme case</b></p><div class="example-contents"><p> 26 </p><div class="figure"><a name="nv12mt_ex"></a><p class="title"><b>Figure 2.2. Example <code class="constant">V4L2_PIX_FMT_NV12MT</code> memory 27layout of macroblocks</b></p><div class="figure-contents"><div class="mediaobject"><img src="nv12mt_example.gif" alt="Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks"></div></div></div><p><br class="figure-break"> 28 Memory layout of macroblocks of <code class="constant">V4L2_PIX_FMT_NV12MT 29</code> format in most extreme case. 30 </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="re31.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="yuv-formats.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re33.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61')</td></tr></table></div></body></html> 31