pixfmt-nv12.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <refentry>
  2. <refmeta>
  3. <refentrytitle>V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="V4L2-PIX-FMT-NV12"><constant>V4L2_PIX_FMT_NV12</constant></refname>
  8. <refname id="V4L2-PIX-FMT-NV21"><constant>V4L2_PIX_FMT_NV21</constant></refname>
  9. <refpurpose>Formats with &frac12; horizontal and vertical
  10. chroma resolution, also known as YUV 4:2:0. One luminance and one
  11. chrominance plane with alternating chroma samples as opposed to
  12. <constant>V4L2_PIX_FMT_YVU420</constant></refpurpose>
  13. </refnamediv>
  14. <refsect1>
  15. <title>Description</title>
  16. <para>These are two-plane versions of the YUV 4:2:0 format.
  17. The three components are separated into two sub-images or planes. The
  18. Y plane is first. The Y plane has one byte per pixel. For
  19. <constant>V4L2_PIX_FMT_NV12</constant>, a combined CbCr plane
  20. immediately follows the Y plane in memory. The CbCr plane is the same
  21. width, in bytes, as the Y plane (and of the image), but is half as
  22. tall in pixels. Each CbCr pair belongs to four pixels. For example,
  23. Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
  24. Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
  25. Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
  26. <constant>V4L2_PIX_FMT_NV21</constant> is the same except the Cb and
  27. Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
  28. <para>If the Y plane has pad bytes after each row, then the
  29. CbCr plane has as many pad bytes after its rows.</para>
  30. <example>
  31. <title><constant>V4L2_PIX_FMT_NV12</constant> 4 &times; 4
  32. pixel image</title>
  33. <formalpara>
  34. <title>Byte Order.</title>
  35. <para>Each cell is one byte.
  36. <informaltable frame="none">
  37. <tgroup cols="5" align="center">
  38. <colspec align="left" colwidth="2*" />
  39. <tbody valign="top">
  40. <row>
  41. <entry>start&nbsp;+&nbsp;0:</entry>
  42. <entry>Y'<subscript>00</subscript></entry>
  43. <entry>Y'<subscript>01</subscript></entry>
  44. <entry>Y'<subscript>02</subscript></entry>
  45. <entry>Y'<subscript>03</subscript></entry>
  46. </row>
  47. <row>
  48. <entry>start&nbsp;+&nbsp;4:</entry>
  49. <entry>Y'<subscript>10</subscript></entry>
  50. <entry>Y'<subscript>11</subscript></entry>
  51. <entry>Y'<subscript>12</subscript></entry>
  52. <entry>Y'<subscript>13</subscript></entry>
  53. </row>
  54. <row>
  55. <entry>start&nbsp;+&nbsp;8:</entry>
  56. <entry>Y'<subscript>20</subscript></entry>
  57. <entry>Y'<subscript>21</subscript></entry>
  58. <entry>Y'<subscript>22</subscript></entry>
  59. <entry>Y'<subscript>23</subscript></entry>
  60. </row>
  61. <row>
  62. <entry>start&nbsp;+&nbsp;12:</entry>
  63. <entry>Y'<subscript>30</subscript></entry>
  64. <entry>Y'<subscript>31</subscript></entry>
  65. <entry>Y'<subscript>32</subscript></entry>
  66. <entry>Y'<subscript>33</subscript></entry>
  67. </row>
  68. <row>
  69. <entry>start&nbsp;+&nbsp;16:</entry>
  70. <entry>Cb<subscript>00</subscript></entry>
  71. <entry>Cr<subscript>00</subscript></entry>
  72. <entry>Cb<subscript>01</subscript></entry>
  73. <entry>Cr<subscript>01</subscript></entry>
  74. </row>
  75. <row>
  76. <entry>start&nbsp;+&nbsp;20:</entry>
  77. <entry>Cb<subscript>10</subscript></entry>
  78. <entry>Cr<subscript>10</subscript></entry>
  79. <entry>Cb<subscript>11</subscript></entry>
  80. <entry>Cr<subscript>11</subscript></entry>
  81. </row>
  82. </tbody>
  83. </tgroup>
  84. </informaltable>
  85. </para>
  86. </formalpara>
  87. <formalpara>
  88. <title>Color Sample Location.</title>
  89. <para>
  90. <informaltable frame="none">
  91. <tgroup cols="7" align="center">
  92. <tbody valign="top">
  93. <row>
  94. <entry></entry>
  95. <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
  96. <entry>2</entry><entry></entry><entry>3</entry>
  97. </row>
  98. <row>
  99. <entry>0</entry>
  100. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  101. <entry>Y</entry><entry></entry><entry>Y</entry>
  102. </row>
  103. <row>
  104. <entry></entry>
  105. <entry></entry><entry>C</entry><entry></entry><entry></entry>
  106. <entry></entry><entry>C</entry><entry></entry>
  107. </row>
  108. <row>
  109. <entry>1</entry>
  110. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  111. <entry>Y</entry><entry></entry><entry>Y</entry>
  112. </row>
  113. <row>
  114. <entry></entry>
  115. </row>
  116. <row>
  117. <entry>2</entry>
  118. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  119. <entry>Y</entry><entry></entry><entry>Y</entry>
  120. </row>
  121. <row>
  122. <entry></entry>
  123. <entry></entry><entry>C</entry><entry></entry><entry></entry>
  124. <entry></entry><entry>C</entry><entry></entry>
  125. </row>
  126. <row>
  127. <entry>3</entry>
  128. <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
  129. <entry>Y</entry><entry></entry><entry>Y</entry>
  130. </row>
  131. </tbody>
  132. </tgroup>
  133. </informaltable>
  134. </para>
  135. </formalpara>
  136. </example>
  137. </refsect1>
  138. </refentry>