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