Merge tag 'xtensa-20161005' of git://github.com/jcmvbkbc/linux-xtensa
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / pixfmt-nv12mt.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _V4L2-PIX-FMT-NV12MT:
4
5 ****************************
6 V4L2_PIX_FMT_NV12MT ('TM12')
7 ****************************
8
9 *man V4L2_PIX_FMT_NV12MT(2)*
10
11 Formats with ½ horizontal and vertical chroma resolution. This format
12 has two planes - one for luminance and one for chrominance. Chroma
13 samples are interleaved. The difference to ``V4L2_PIX_FMT_NV12`` is the
14 memory layout. Pixels are grouped in macroblocks of 64x32 size. The
15 order of macroblocks in memory is also not standard.
16
17
18 Description
19 ===========
20
21 This is the two-plane versions of the YUV 4:2:0 format where data is
22 grouped into 64x32 macroblocks. The three components are separated into
23 two sub-images or planes. The Y plane has one byte per pixel and pixels
24 are grouped into 64x32 macroblocks. The CbCr plane has the same width,
25 in bytes, as the Y plane (and the image), but is half as tall in pixels.
26 The chroma plane is also grouped into 64x32 macroblocks.
27
28 Width of the buffer has to be aligned to the multiple of 128, and height
29 alignment is 32. Every four adjacent buffers - two horizontally and two
30 vertically are grouped together and are located in memory in Z or
31 flipped Z order.
32
33 Layout of macroblocks in memory is presented in the following figure.
34
35
36 .. _nv12mt:
37
38 .. figure::  pixfmt-nv12mt_files/nv12mt.*
39     :alt:    nv12mt.gif
40     :align:  center
41
42     V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
43
44 The requirement that width is multiple of 128 is implemented because,
45 the Z shape cannot be cut in half horizontally. In case the vertical
46 resolution of macroblocks is odd then the last row of macroblocks is
47 arranged in a linear order.
48
49 In case of chroma the layout is identical. Cb and Cr samples are
50 interleaved. Height of the buffer is aligned to 32.
51
52
53 .. _nv12mt_ex:
54
55 .. figure::  pixfmt-nv12mt_files/nv12mt_example.*
56     :alt:    nv12mt_example.gif
57     :align:  center
58
59     Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
60
61 Memory layout of macroblocks of ``V4L2_PIX_FMT_NV12MT`` format in most
62 extreme case.