pixfmt-nv12m.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <refentry>
  2. <refmeta>
  3. <refentrytitle>V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="V4L2-PIX-FMT-NV12M"><constant>V4L2_PIX_FMT_NV12M</constant></refname>
  8. <refname id="V4L2-PIX-FMT-NV21M"><constant>V4L2_PIX_FMT_NV21M</constant></refname>
  9. <refname id="V4L2-PIX-FMT-NV12MT-16X16"><constant>V4L2_PIX_FMT_NV12MT_16X16</constant></refname>
  10. <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV12</constant> and <constant>V4L2_PIX_FMT_NV21</constant> with planes
  11. non contiguous in memory. </refpurpose>
  12. </refnamediv>
  13. <refsect1>
  14. <title>Description</title>
  15. <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
  16. The three components are separated into two sub-images or planes.
  17. <constant>V4L2_PIX_FMT_NV12M</constant> differs from <constant>V4L2_PIX_FMT_NV12
  18. </constant> in that the two planes are non-contiguous in memory, i.e. the chroma
  19. plane do not necessarily immediately follows the luma plane.
  20. The luminance data occupies the first plane. The Y plane has one byte per pixel.
  21. In the second plane there is a chrominance data with alternating chroma samples.
  22. The CbCr plane is the same width, in bytes, as the Y plane (and of the image),
  23. but is half as tall in pixels. Each CbCr pair belongs to four pixels. For example,
  24. Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
  25. Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
  26. Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
  27. <constant>V4L2_PIX_FMT_NV12MT_16X16</constant> is the tiled version of
  28. <constant>V4L2_PIX_FMT_NV12M</constant> with 16x16 macroblock tiles. Here pixels
  29. are arranged in 16x16 2D tiles and tiles are arranged in linear order in memory.
  30. <constant>V4L2_PIX_FMT_NV21M</constant> is the same as <constant>V4L2_PIX_FMT_NV12M</constant>
  31. except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
  32. <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be
  33. used only in drivers and applications that support the multi-planar API,
  34. described in <xref linkend="planar-apis"/>. </para>
  35. <para>If the Y plane has pad bytes after each row, then the
  36. CbCr plane has as many pad bytes after its rows.</para>
  37. <example>
  38. <title><constant>V4L2_PIX_FMT_NV12M</constant> 4 &times; 4 pixel image</title>
  39. <formalpara>
  40. <title>Byte Order.</title>
  41. <para>Each cell is one byte.
  42. <informaltable frame="none">
  43. <tgroup cols="5" align="center">
  44. <colspec align="left" colwidth="2*" />
  45. <tbody valign="top">
  46. <row>
  47. <entry>start0&nbsp;+&nbsp;0:</entry>
  48. <entry>Y'<subscript>00</subscript></entry>
  49. <entry>Y'<subscript>01</subscript></entry>
  50. <entry>Y'<subscript>02</subscript></entry>
  51. <entry>Y'<subscript>03</subscript></entry>
  52. </row>
  53. <row>
  54. <entry>start0&nbsp;+&nbsp;4:</entry>
  55. <entry>Y'<subscript>10</subscript></entry>
  56. <entry>Y'<subscript>11</subscript></entry>
  57. <entry>Y'<subscript>12</subscript></entry>
  58. <entry>Y'<subscript>13</subscript></entry>
  59. </row>
  60. <row>
  61. <entry>start0&nbsp;+&nbsp;8:</entry>
  62. <entry>Y'<subscript>20</subscript></entry>
  63. <entry>Y'<subscript>21</subscript></entry>
  64. <entry>Y'<subscript>22</subscript></entry>
  65. <entry>Y'<subscript>23</subscript></entry>
  66. </row>
  67. <row>
  68. <entry>start0&nbsp;+&nbsp;12:</entry>
  69. <entry>Y'<subscript>30</subscript></entry>
  70. <entry>Y'<subscript>31</subscript></entry>
  71. <entry>Y'<subscript>32</subscript></entry>
  72. <entry>Y'<subscript>33</subscript></entry>
  73. </row>
  74. <row>
  75. <entry></entry>
  76. </row>
  77. <row>
  78. <entry>start1&nbsp;+&nbsp;0:</entry>
  79. <entry>Cb<subscript>00</subscript></entry>
  80. <entry>Cr<subscript>00</subscript></entry>
  81. <entry>Cb<subscript>01</subscript></entry>
  82. <entry>Cr<subscript>01</subscript></entry>
  83. </row>
  84. <row>
  85. <entry>start1&nbsp;+&nbsp;4:</entry>
  86. <entry>Cb<subscript>10</subscript></entry>
  87. <entry>Cr<subscript>10</subscript></entry>
  88. <entry>Cb<subscript>11</subscript></entry>
  89. <entry>Cr<subscript>11</subscript></entry>
  90. </row>
  91. </tbody>
  92. </tgroup>
  93. </informaltable>
  94. </para>
  95. </formalpara>
  96. <formalpara>
  97. <title>Color Sample Location.</title>
  98. <para>
  99. <informaltable frame="none">
  100. <tgroup cols="7" align="center">
  101. <tbody valign="top">
  102. <row>
  103. <entry></entry>
  104. <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
  105. <entry>2</entry><entry></entry><entry>3</entry>
  106. </row>
  107. <row>
  108. <entry>0</entry>
  109. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  110. <entry>Y</entry><entry></entry><entry>Y</entry>
  111. </row>
  112. <row>
  113. <entry></entry>
  114. <entry></entry><entry>C</entry><entry></entry><entry></entry>
  115. <entry></entry><entry>C</entry><entry></entry>
  116. </row>
  117. <row>
  118. <entry>1</entry>
  119. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  120. <entry>Y</entry><entry></entry><entry>Y</entry>
  121. </row>
  122. <row>
  123. <entry></entry>
  124. </row>
  125. <row>
  126. <entry>2</entry>
  127. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  128. <entry>Y</entry><entry></entry><entry>Y</entry>
  129. </row>
  130. <row>
  131. <entry></entry>
  132. <entry></entry><entry>C</entry><entry></entry><entry></entry>
  133. <entry></entry><entry>C</entry><entry></entry>
  134. </row>
  135. <row>
  136. <entry>3</entry>
  137. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  138. <entry>Y</entry><entry></entry><entry>Y</entry>
  139. </row>
  140. </tbody>
  141. </tgroup>
  142. </informaltable>
  143. </para>
  144. </formalpara>
  145. </example>
  146. </refsect1>
  147. </refentry>