pixfmt.xml 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. <title>Image Formats</title>
  2. <para>The V4L2 API was primarily designed for devices exchanging
  3. image data with applications. The
  4. <structname>v4l2_pix_format</structname> and <structname>v4l2_pix_format_mplane
  5. </structname> structures define the format and layout of an image in memory.
  6. The former is used with the single-planar API, while the latter is used with the
  7. multi-planar version (see <xref linkend="planar-apis"/>). Image formats are
  8. negotiated with the &VIDIOC-S-FMT; ioctl. (The explanations here focus on video
  9. capturing and output, for overlay frame buffer formats see also
  10. &VIDIOC-G-FBUF;.)</para>
  11. <section>
  12. <title>Single-planar format structure</title>
  13. <table pgwide="1" frame="none" id="v4l2-pix-format">
  14. <title>struct <structname>v4l2_pix_format</structname></title>
  15. <tgroup cols="3">
  16. &cs-str;
  17. <tbody valign="top">
  18. <row>
  19. <entry>__u32</entry>
  20. <entry><structfield>width</structfield></entry>
  21. <entry>Image width in pixels.</entry>
  22. </row>
  23. <row>
  24. <entry>__u32</entry>
  25. <entry><structfield>height</structfield></entry>
  26. <entry>Image height in pixels. If <structfield>field</structfield> is
  27. one of <constant>V4L2_FIELD_TOP</constant>, <constant>V4L2_FIELD_BOTTOM</constant>
  28. or <constant>V4L2_FIELD_ALTERNATE</constant> then height refers to the
  29. number of lines in the field, otherwise it refers to the number of
  30. lines in the frame (which is twice the field height for interlaced
  31. formats).</entry>
  32. </row>
  33. <row>
  34. <entry spanname="hspan">Applications set these fields to
  35. request an image size, drivers return the closest possible values. In
  36. case of planar formats the <structfield>width</structfield> and
  37. <structfield>height</structfield> applies to the largest plane. To
  38. avoid ambiguities drivers must return values rounded up to a multiple
  39. of the scale factor of any smaller planes. For example when the image
  40. format is YUV 4:2:0, <structfield>width</structfield> and
  41. <structfield>height</structfield> must be multiples of two.</entry>
  42. </row>
  43. <row>
  44. <entry>__u32</entry>
  45. <entry><structfield>pixelformat</structfield></entry>
  46. <entry>The pixel format or type of compression, set by the
  47. application. This is a little endian <link
  48. linkend="v4l2-fourcc">four character code</link>. V4L2 defines
  49. standard RGB formats in <xref linkend="rgb-formats" />, YUV formats in <xref
  50. linkend="yuv-formats" />, and reserved codes in <xref
  51. linkend="reserved-formats" /></entry>
  52. </row>
  53. <row>
  54. <entry>&v4l2-field;</entry>
  55. <entry><structfield>field</structfield></entry>
  56. <entry>Video images are typically interlaced. Applications
  57. can request to capture or output only the top or bottom field, or both
  58. fields interlaced or sequentially stored in one buffer or alternating
  59. in separate buffers. Drivers return the actual field order selected.
  60. For more details on fields see <xref linkend="field-order" />.</entry>
  61. </row>
  62. <row>
  63. <entry>__u32</entry>
  64. <entry><structfield>bytesperline</structfield></entry>
  65. <entry>Distance in bytes between the leftmost pixels in two
  66. adjacent lines.</entry>
  67. </row>
  68. <row>
  69. <entry spanname="hspan"><para>Both applications and drivers
  70. can set this field to request padding bytes at the end of each line.
  71. Drivers however may ignore the value requested by the application,
  72. returning <structfield>width</structfield> times bytes per pixel or a
  73. larger value required by the hardware. That implies applications can
  74. just set this field to zero to get a reasonable
  75. default.</para><para>Video hardware may access padding bytes,
  76. therefore they must reside in accessible memory. Consider cases where
  77. padding bytes after the last line of an image cross a system page
  78. boundary. Input devices may write padding bytes, the value is
  79. undefined. Output devices ignore the contents of padding
  80. bytes.</para><para>When the image format is planar the
  81. <structfield>bytesperline</structfield> value applies to the largest
  82. plane and is divided by the same factor as the
  83. <structfield>width</structfield> field for any smaller planes. For
  84. example the Cb and Cr planes of a YUV 4:2:0 image have half as many
  85. padding bytes following each line as the Y plane. To avoid ambiguities
  86. drivers must return a <structfield>bytesperline</structfield> value
  87. rounded up to a multiple of the scale factor.</para>
  88. <para>For compressed formats the <structfield>bytesperline</structfield>
  89. value makes no sense. Applications and drivers must set this to 0 in
  90. that case.</para></entry>
  91. </row>
  92. <row>
  93. <entry>__u32</entry>
  94. <entry><structfield>sizeimage</structfield></entry>
  95. <entry>Size in bytes of the buffer to hold a complete image,
  96. set by the driver. Usually this is
  97. <structfield>bytesperline</structfield> times
  98. <structfield>height</structfield>. When the image consists of variable
  99. length compressed data this is the maximum number of bytes required to
  100. hold an image.</entry>
  101. </row>
  102. <row>
  103. <entry>&v4l2-colorspace;</entry>
  104. <entry><structfield>colorspace</structfield></entry>
  105. <entry>This information supplements the
  106. <structfield>pixelformat</structfield> and must be set by the driver for
  107. capture streams and by the application for output streams,
  108. see <xref linkend="colorspaces" />.</entry>
  109. </row>
  110. <row>
  111. <entry>__u32</entry>
  112. <entry><structfield>priv</structfield></entry>
  113. <entry><para>This field indicates whether the remaining fields of the
  114. <structname>v4l2_pix_format</structname> structure, also called the extended
  115. fields, are valid. When set to <constant>V4L2_PIX_FMT_PRIV_MAGIC</constant>, it
  116. indicates that the extended fields have been correctly initialized. When set to
  117. any other value it indicates that the extended fields contain undefined values.
  118. </para>
  119. <para>Applications that wish to use the pixel format extended fields must first
  120. ensure that the feature is supported by querying the device for the
  121. <link linkend="querycap"><constant>V4L2_CAP_EXT_PIX_FORMAT</constant></link>
  122. capability. If the capability isn't set the pixel format extended fields are not
  123. supported and using the extended fields will lead to undefined results.</para>
  124. <para>To use the extended fields, applications must set the
  125. <structfield>priv</structfield> field to
  126. <constant>V4L2_PIX_FMT_PRIV_MAGIC</constant>, initialize all the extended fields
  127. and zero the unused bytes of the <structname>v4l2_format</structname>
  128. <structfield>raw_data</structfield> field.</para>
  129. <para>When the <structfield>priv</structfield> field isn't set to
  130. <constant>V4L2_PIX_FMT_PRIV_MAGIC</constant> drivers must act as if all the
  131. extended fields were set to zero. On return drivers must set the
  132. <structfield>priv</structfield> field to
  133. <constant>V4L2_PIX_FMT_PRIV_MAGIC</constant> and all the extended fields to
  134. applicable values.</para></entry>
  135. </row>
  136. <row>
  137. <entry>__u32</entry>
  138. <entry><structfield>flags</structfield></entry>
  139. <entry>Flags set by the application or driver, see <xref
  140. linkend="format-flags" />.</entry>
  141. </row>
  142. </tbody>
  143. </tgroup>
  144. </table>
  145. </section>
  146. <section>
  147. <title>Multi-planar format structures</title>
  148. <para>The <structname>v4l2_plane_pix_format</structname> structures define
  149. size and layout for each of the planes in a multi-planar format.
  150. The <structname>v4l2_pix_format_mplane</structname> structure contains
  151. information common to all planes (such as image width and height) and
  152. an array of <structname>v4l2_plane_pix_format</structname> structures,
  153. describing all planes of that format.</para>
  154. <table pgwide="1" frame="none" id="v4l2-plane-pix-format">
  155. <title>struct <structname>v4l2_plane_pix_format</structname></title>
  156. <tgroup cols="3">
  157. &cs-str;
  158. <tbody valign="top">
  159. <row>
  160. <entry>__u32</entry>
  161. <entry><structfield>sizeimage</structfield></entry>
  162. <entry>Maximum size in bytes required for image data in this plane.
  163. </entry>
  164. </row>
  165. <row>
  166. <entry>__u16</entry>
  167. <entry><structfield>bytesperline</structfield></entry>
  168. <entry>Distance in bytes between the leftmost pixels in two adjacent
  169. lines. See &v4l2-pix-format;.</entry>
  170. </row>
  171. <row>
  172. <entry>__u16</entry>
  173. <entry><structfield>reserved[7]</structfield></entry>
  174. <entry>Reserved for future extensions. Should be zeroed by the
  175. application.</entry>
  176. </row>
  177. </tbody>
  178. </tgroup>
  179. </table>
  180. <table pgwide="1" frame="none" id="v4l2-pix-format-mplane">
  181. <title>struct <structname>v4l2_pix_format_mplane</structname></title>
  182. <tgroup cols="3">
  183. &cs-str;
  184. <tbody valign="top">
  185. <row>
  186. <entry>__u32</entry>
  187. <entry><structfield>width</structfield></entry>
  188. <entry>Image width in pixels. See &v4l2-pix-format;.</entry>
  189. </row>
  190. <row>
  191. <entry>__u32</entry>
  192. <entry><structfield>height</structfield></entry>
  193. <entry>Image height in pixels. See &v4l2-pix-format;.</entry>
  194. </row>
  195. <row>
  196. <entry>__u32</entry>
  197. <entry><structfield>pixelformat</structfield></entry>
  198. <entry>The pixel format. Both single- and multi-planar four character
  199. codes can be used.</entry>
  200. </row>
  201. <row>
  202. <entry>&v4l2-field;</entry>
  203. <entry><structfield>field</structfield></entry>
  204. <entry>See &v4l2-pix-format;.</entry>
  205. </row>
  206. <row>
  207. <entry>&v4l2-colorspace;</entry>
  208. <entry><structfield>colorspace</structfield></entry>
  209. <entry>See &v4l2-pix-format;.</entry>
  210. </row>
  211. <row>
  212. <entry>&v4l2-plane-pix-format;</entry>
  213. <entry><structfield>plane_fmt[VIDEO_MAX_PLANES]</structfield></entry>
  214. <entry>An array of structures describing format of each plane this
  215. pixel format consists of. The number of valid entries in this array
  216. has to be put in the <structfield>num_planes</structfield>
  217. field.</entry>
  218. </row>
  219. <row>
  220. <entry>__u8</entry>
  221. <entry><structfield>num_planes</structfield></entry>
  222. <entry>Number of planes (i.e. separate memory buffers) for this format
  223. and the number of valid entries in the
  224. <structfield>plane_fmt</structfield> array.</entry>
  225. </row>
  226. <row>
  227. <entry>__u8</entry>
  228. <entry><structfield>flags</structfield></entry>
  229. <entry>Flags set by the application or driver, see <xref
  230. linkend="format-flags" />.</entry>
  231. </row>
  232. <row>
  233. <entry>__u8</entry>
  234. <entry><structfield>reserved[10]</structfield></entry>
  235. <entry>Reserved for future extensions. Should be zeroed by the
  236. application.</entry>
  237. </row>
  238. </tbody>
  239. </tgroup>
  240. </table>
  241. </section>
  242. <section>
  243. <title>Standard Image Formats</title>
  244. <para>In order to exchange images between drivers and
  245. applications, it is necessary to have standard image data formats
  246. which both sides will interpret the same way. V4L2 includes several
  247. such formats, and this section is intended to be an unambiguous
  248. specification of the standard image data formats in V4L2.</para>
  249. <para>V4L2 drivers are not limited to these formats, however.
  250. Driver-specific formats are possible. In that case the application may
  251. depend on a codec to convert images to one of the standard formats
  252. when needed. But the data can still be stored and retrieved in the
  253. proprietary format. For example, a device may support a proprietary
  254. compressed format. Applications can still capture and save the data in
  255. the compressed format, saving much disk space, and later use a codec
  256. to convert the images to the X Windows screen format when the video is
  257. to be displayed.</para>
  258. <para>Even so, ultimately, some standard formats are needed, so
  259. the V4L2 specification would not be complete without well-defined
  260. standard formats.</para>
  261. <para>The V4L2 standard formats are mainly uncompressed formats. The
  262. pixels are always arranged in memory from left to right, and from top
  263. to bottom. The first byte of data in the image buffer is always for
  264. the leftmost pixel of the topmost row. Following that is the pixel
  265. immediately to its right, and so on until the end of the top row of
  266. pixels. Following the rightmost pixel of the row there may be zero or
  267. more bytes of padding to guarantee that each row of pixel data has a
  268. certain alignment. Following the pad bytes, if any, is data for the
  269. leftmost pixel of the second row from the top, and so on. The last row
  270. has just as many pad bytes after it as the other rows.</para>
  271. <para>In V4L2 each format has an identifier which looks like
  272. <constant>PIX_FMT_XXX</constant>, defined in the <link
  273. linkend="videodev">videodev2.h</link> header file. These identifiers
  274. represent <link linkend="v4l2-fourcc">four character (FourCC) codes</link>
  275. which are also listed below, however they are not the same as those
  276. used in the Windows world.</para>
  277. <para>For some formats, data is stored in separate, discontiguous
  278. memory buffers. Those formats are identified by a separate set of FourCC codes
  279. and are referred to as "multi-planar formats". For example, a YUV422 frame is
  280. normally stored in one memory buffer, but it can also be placed in two or three
  281. separate buffers, with Y component in one buffer and CbCr components in another
  282. in the 2-planar version or with each component in its own buffer in the
  283. 3-planar case. Those sub-buffers are referred to as "planes".</para>
  284. </section>
  285. <section id="colorspaces">
  286. <title>Colorspaces</title>
  287. <para>[intro]</para>
  288. <!-- See proposal by Billy Biggs, video4linux-list@redhat.com
  289. on 11 Oct 2002, subject: "Re: [V4L] Re: v4l2 api", and
  290. http://vektor.theorem.ca/graphics/ycbcr/ and
  291. http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html -->
  292. <para>
  293. <variablelist>
  294. <varlistentry>
  295. <term>Gamma Correction</term>
  296. <listitem>
  297. <para>[to do]</para>
  298. <para>E'<subscript>R</subscript> = f(R)</para>
  299. <para>E'<subscript>G</subscript> = f(G)</para>
  300. <para>E'<subscript>B</subscript> = f(B)</para>
  301. </listitem>
  302. </varlistentry>
  303. <varlistentry>
  304. <term>Construction of luminance and color-difference
  305. signals</term>
  306. <listitem>
  307. <para>[to do]</para>
  308. <para>E'<subscript>Y</subscript> =
  309. Coeff<subscript>R</subscript> E'<subscript>R</subscript>
  310. + Coeff<subscript>G</subscript> E'<subscript>G</subscript>
  311. + Coeff<subscript>B</subscript> E'<subscript>B</subscript></para>
  312. <para>(E'<subscript>R</subscript> - E'<subscript>Y</subscript>) = E'<subscript>R</subscript>
  313. - Coeff<subscript>R</subscript> E'<subscript>R</subscript>
  314. - Coeff<subscript>G</subscript> E'<subscript>G</subscript>
  315. - Coeff<subscript>B</subscript> E'<subscript>B</subscript></para>
  316. <para>(E'<subscript>B</subscript> - E'<subscript>Y</subscript>) = E'<subscript>B</subscript>
  317. - Coeff<subscript>R</subscript> E'<subscript>R</subscript>
  318. - Coeff<subscript>G</subscript> E'<subscript>G</subscript>
  319. - Coeff<subscript>B</subscript> E'<subscript>B</subscript></para>
  320. </listitem>
  321. </varlistentry>
  322. <varlistentry>
  323. <term>Re-normalized color-difference signals</term>
  324. <listitem>
  325. <para>The color-difference signals are scaled back to unity
  326. range [-0.5;+0.5]:</para>
  327. <para>K<subscript>B</subscript> = 0.5 / (1 - Coeff<subscript>B</subscript>)</para>
  328. <para>K<subscript>R</subscript> = 0.5 / (1 - Coeff<subscript>R</subscript>)</para>
  329. <para>P<subscript>B</subscript> =
  330. K<subscript>B</subscript> (E'<subscript>B</subscript> - E'<subscript>Y</subscript>) =
  331. 0.5 (Coeff<subscript>R</subscript> / Coeff<subscript>B</subscript>) E'<subscript>R</subscript>
  332. + 0.5 (Coeff<subscript>G</subscript> / Coeff<subscript>B</subscript>) E'<subscript>G</subscript>
  333. + 0.5 E'<subscript>B</subscript></para>
  334. <para>P<subscript>R</subscript> =
  335. K<subscript>R</subscript> (E'<subscript>R</subscript> - E'<subscript>Y</subscript>) =
  336. 0.5 E'<subscript>R</subscript>
  337. + 0.5 (Coeff<subscript>G</subscript> / Coeff<subscript>R</subscript>) E'<subscript>G</subscript>
  338. + 0.5 (Coeff<subscript>B</subscript> / Coeff<subscript>R</subscript>) E'<subscript>B</subscript></para>
  339. </listitem>
  340. </varlistentry>
  341. <varlistentry>
  342. <term>Quantization</term>
  343. <listitem>
  344. <para>[to do]</para>
  345. <para>Y' = (Lum. Levels - 1) &middot; E'<subscript>Y</subscript> + Lum. Offset</para>
  346. <para>C<subscript>B</subscript> = (Chrom. Levels - 1)
  347. &middot; P<subscript>B</subscript> + Chrom. Offset</para>
  348. <para>C<subscript>R</subscript> = (Chrom. Levels - 1)
  349. &middot; P<subscript>R</subscript> + Chrom. Offset</para>
  350. <para>Rounding to the nearest integer and clamping to the range
  351. [0;255] finally yields the digital color components Y'CbCr
  352. stored in YUV images.</para>
  353. </listitem>
  354. </varlistentry>
  355. </variablelist>
  356. </para>
  357. <example>
  358. <title>ITU-R Rec. BT.601 color conversion</title>
  359. <para>Forward Transformation</para>
  360. <programlisting>
  361. int ER, EG, EB; /* gamma corrected RGB input [0;255] */
  362. int Y1, Cb, Cr; /* output [0;255] */
  363. double r, g, b; /* temporaries */
  364. double y1, pb, pr;
  365. int
  366. clamp (double x)
  367. {
  368. int r = x; /* round to nearest */
  369. if (r &lt; 0) return 0;
  370. else if (r &gt; 255) return 255;
  371. else return r;
  372. }
  373. r = ER / 255.0;
  374. g = EG / 255.0;
  375. b = EB / 255.0;
  376. y1 = 0.299 * r + 0.587 * g + 0.114 * b;
  377. pb = -0.169 * r - 0.331 * g + 0.5 * b;
  378. pr = 0.5 * r - 0.419 * g - 0.081 * b;
  379. Y1 = clamp (219 * y1 + 16);
  380. Cb = clamp (224 * pb + 128);
  381. Cr = clamp (224 * pr + 128);
  382. /* or shorter */
  383. y1 = 0.299 * ER + 0.587 * EG + 0.114 * EB;
  384. Y1 = clamp ( (219 / 255.0) * y1 + 16);
  385. Cb = clamp (((224 / 255.0) / (2 - 2 * 0.114)) * (EB - y1) + 128);
  386. Cr = clamp (((224 / 255.0) / (2 - 2 * 0.299)) * (ER - y1) + 128);
  387. </programlisting>
  388. <para>Inverse Transformation</para>
  389. <programlisting>
  390. int Y1, Cb, Cr; /* gamma pre-corrected input [0;255] */
  391. int ER, EG, EB; /* output [0;255] */
  392. double r, g, b; /* temporaries */
  393. double y1, pb, pr;
  394. int
  395. clamp (double x)
  396. {
  397. int r = x; /* round to nearest */
  398. if (r &lt; 0) return 0;
  399. else if (r &gt; 255) return 255;
  400. else return r;
  401. }
  402. y1 = (Y1 - 16) / 219.0;
  403. pb = (Cb - 128) / 224.0;
  404. pr = (Cr - 128) / 224.0;
  405. r = 1.0 * y1 + 0 * pb + 1.402 * pr;
  406. g = 1.0 * y1 - 0.344 * pb - 0.714 * pr;
  407. b = 1.0 * y1 + 1.772 * pb + 0 * pr;
  408. ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */
  409. EG = clamp (g * 255);
  410. EB = clamp (b * 255);
  411. </programlisting>
  412. </example>
  413. <table pgwide="1" id="v4l2-colorspace" orient="land">
  414. <title>enum v4l2_colorspace</title>
  415. <tgroup cols="11" align="center">
  416. <colspec align="left" />
  417. <colspec align="center" />
  418. <colspec align="left" />
  419. <colspec colname="cr" />
  420. <colspec colname="cg" />
  421. <colspec colname="cb" />
  422. <colspec colname="wp" />
  423. <colspec colname="gc" />
  424. <colspec colname="lum" />
  425. <colspec colname="qy" />
  426. <colspec colname="qc" />
  427. <spanspec namest="cr" nameend="cb" spanname="chrom" />
  428. <spanspec namest="qy" nameend="qc" spanname="quant" />
  429. <spanspec namest="lum" nameend="qc" spanname="spam" />
  430. <thead>
  431. <row>
  432. <entry morerows="1">Identifier</entry>
  433. <entry morerows="1">Value</entry>
  434. <entry morerows="1">Description</entry>
  435. <entry spanname="chrom">Chromaticities<footnote>
  436. <para>The coordinates of the color primaries are
  437. given in the CIE system (1931)</para>
  438. </footnote></entry>
  439. <entry morerows="1">White Point</entry>
  440. <entry morerows="1">Gamma Correction</entry>
  441. <entry morerows="1">Luminance E'<subscript>Y</subscript></entry>
  442. <entry spanname="quant">Quantization</entry>
  443. </row>
  444. <row>
  445. <entry>Red</entry>
  446. <entry>Green</entry>
  447. <entry>Blue</entry>
  448. <entry>Y'</entry>
  449. <entry>Cb, Cr</entry>
  450. </row>
  451. </thead>
  452. <tbody valign="top">
  453. <row>
  454. <entry><constant>V4L2_COLORSPACE_SMPTE170M</constant></entry>
  455. <entry>1</entry>
  456. <entry>NTSC/PAL according to <xref linkend="smpte170m" />,
  457. <xref linkend="itu601" /></entry>
  458. <entry>x&nbsp;=&nbsp;0.630, y&nbsp;=&nbsp;0.340</entry>
  459. <entry>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.595</entry>
  460. <entry>x&nbsp;=&nbsp;0.155, y&nbsp;=&nbsp;0.070</entry>
  461. <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
  462. Illuminant D<subscript>65</subscript></entry>
  463. <entry>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
  464. 1.099&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</entry>
  465. <entry>0.299&nbsp;E'<subscript>R</subscript>
  466. +&nbsp;0.587&nbsp;E'<subscript>G</subscript>
  467. +&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
  468. <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
  469. <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
  470. </row>
  471. <row>
  472. <entry><constant>V4L2_COLORSPACE_SMPTE240M</constant></entry>
  473. <entry>2</entry>
  474. <entry>1125-Line (US) HDTV, see <xref
  475. linkend="smpte240m" /></entry>
  476. <entry>x&nbsp;=&nbsp;0.630, y&nbsp;=&nbsp;0.340</entry>
  477. <entry>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.595</entry>
  478. <entry>x&nbsp;=&nbsp;0.155, y&nbsp;=&nbsp;0.070</entry>
  479. <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
  480. Illuminant D<subscript>65</subscript></entry>
  481. <entry>E' = 4&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.0228,
  482. 1.1115&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.1115&nbsp;for&nbsp;0.0228&nbsp;&lt;&nbsp;I</entry>
  483. <entry>0.212&nbsp;E'<subscript>R</subscript>
  484. +&nbsp;0.701&nbsp;E'<subscript>G</subscript>
  485. +&nbsp;0.087&nbsp;E'<subscript>B</subscript></entry>
  486. <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
  487. <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
  488. </row>
  489. <row>
  490. <entry><constant>V4L2_COLORSPACE_REC709</constant></entry>
  491. <entry>3</entry>
  492. <entry>HDTV and modern devices, see <xref
  493. linkend="itu709" /></entry>
  494. <entry>x&nbsp;=&nbsp;0.640, y&nbsp;=&nbsp;0.330</entry>
  495. <entry>x&nbsp;=&nbsp;0.300, y&nbsp;=&nbsp;0.600</entry>
  496. <entry>x&nbsp;=&nbsp;0.150, y&nbsp;=&nbsp;0.060</entry>
  497. <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
  498. Illuminant D<subscript>65</subscript></entry>
  499. <entry>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
  500. 1.099&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</entry>
  501. <entry>0.2125&nbsp;E'<subscript>R</subscript>
  502. +&nbsp;0.7154&nbsp;E'<subscript>G</subscript>
  503. +&nbsp;0.0721&nbsp;E'<subscript>B</subscript></entry>
  504. <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
  505. <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
  506. </row>
  507. <row>
  508. <entry><constant>V4L2_COLORSPACE_BT878</constant></entry>
  509. <entry>4</entry>
  510. <entry>Broken Bt878 extents<footnote>
  511. <para>The ubiquitous Bt878 video capture chip
  512. quantizes E'<subscript>Y</subscript> to 238 levels, yielding a range
  513. of Y' = 16 &hellip; 253, unlike Rec. 601 Y' = 16 &hellip;
  514. 235. This is not a typo in the Bt878 documentation, it has been
  515. implemented in silicon. The chroma extents are unclear.</para>
  516. </footnote>, <xref linkend="itu601" /></entry>
  517. <entry>?</entry>
  518. <entry>?</entry>
  519. <entry>?</entry>
  520. <entry>?</entry>
  521. <entry>?</entry>
  522. <entry>0.299&nbsp;E'<subscript>R</subscript>
  523. +&nbsp;0.587&nbsp;E'<subscript>G</subscript>
  524. +&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
  525. <entry><emphasis>237</emphasis>&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
  526. <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128 (probably)</entry>
  527. </row>
  528. <row>
  529. <entry><constant>V4L2_COLORSPACE_470_SYSTEM_M</constant></entry>
  530. <entry>5</entry>
  531. <entry>M/NTSC<footnote>
  532. <para>No identifier exists for M/PAL which uses
  533. the chromaticities of M/NTSC, the remaining parameters are equal to B and
  534. G/PAL.</para>
  535. </footnote> according to <xref linkend="itu470" />, <xref
  536. linkend="itu601" /></entry>
  537. <entry>x&nbsp;=&nbsp;0.67, y&nbsp;=&nbsp;0.33</entry>
  538. <entry>x&nbsp;=&nbsp;0.21, y&nbsp;=&nbsp;0.71</entry>
  539. <entry>x&nbsp;=&nbsp;0.14, y&nbsp;=&nbsp;0.08</entry>
  540. <entry>x&nbsp;=&nbsp;0.310, y&nbsp;=&nbsp;0.316, Illuminant C</entry>
  541. <entry>?</entry>
  542. <entry>0.299&nbsp;E'<subscript>R</subscript>
  543. +&nbsp;0.587&nbsp;E'<subscript>G</subscript>
  544. +&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
  545. <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
  546. <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
  547. </row>
  548. <row>
  549. <entry><constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant></entry>
  550. <entry>6</entry>
  551. <entry>625-line PAL and SECAM systems according to <xref
  552. linkend="itu470" />, <xref linkend="itu601" /></entry>
  553. <entry>x&nbsp;=&nbsp;0.64, y&nbsp;=&nbsp;0.33</entry>
  554. <entry>x&nbsp;=&nbsp;0.29, y&nbsp;=&nbsp;0.60</entry>
  555. <entry>x&nbsp;=&nbsp;0.15, y&nbsp;=&nbsp;0.06</entry>
  556. <entry>x&nbsp;=&nbsp;0.313, y&nbsp;=&nbsp;0.329,
  557. Illuminant D<subscript>65</subscript></entry>
  558. <entry>?</entry>
  559. <entry>0.299&nbsp;E'<subscript>R</subscript>
  560. +&nbsp;0.587&nbsp;E'<subscript>G</subscript>
  561. +&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
  562. <entry>219&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16</entry>
  563. <entry>224&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
  564. </row>
  565. <row>
  566. <entry><constant>V4L2_COLORSPACE_JPEG</constant></entry>
  567. <entry>7</entry>
  568. <entry>JPEG Y'CbCr, see <xref linkend="jfif" />, <xref linkend="itu601" /></entry>
  569. <entry>?</entry>
  570. <entry>?</entry>
  571. <entry>?</entry>
  572. <entry>?</entry>
  573. <entry>?</entry>
  574. <entry>0.299&nbsp;E'<subscript>R</subscript>
  575. +&nbsp;0.587&nbsp;E'<subscript>G</subscript>
  576. +&nbsp;0.114&nbsp;E'<subscript>B</subscript></entry>
  577. <entry>256&nbsp;E'<subscript>Y</subscript>&nbsp;+&nbsp;16<footnote>
  578. <para>Note JFIF quantizes
  579. Y'P<subscript>B</subscript>P<subscript>R</subscript> in range [0;+1] and
  580. [-0.5;+0.5] to <emphasis>257</emphasis> levels, however Y'CbCr signals
  581. are still clamped to [0;255].</para>
  582. </footnote></entry>
  583. <entry>256&nbsp;P<subscript>B,R</subscript>&nbsp;+&nbsp;128</entry>
  584. </row>
  585. <row>
  586. <entry><constant>V4L2_COLORSPACE_SRGB</constant></entry>
  587. <entry>8</entry>
  588. <entry>[?]</entry>
  589. <entry>x&nbsp;=&nbsp;0.640, y&nbsp;=&nbsp;0.330</entry>
  590. <entry>x&nbsp;=&nbsp;0.300, y&nbsp;=&nbsp;0.600</entry>
  591. <entry>x&nbsp;=&nbsp;0.150, y&nbsp;=&nbsp;0.060</entry>
  592. <entry>x&nbsp;=&nbsp;0.3127, y&nbsp;=&nbsp;0.3290,
  593. Illuminant D<subscript>65</subscript></entry>
  594. <entry>E' = 4.5&nbsp;I&nbsp;for&nbsp;I&nbsp;&le;0.018,
  595. 1.099&nbsp;I<superscript>0.45</superscript>&nbsp;-&nbsp;0.099&nbsp;for&nbsp;0.018&nbsp;&lt;&nbsp;I</entry>
  596. <entry spanname="spam">n/a</entry>
  597. </row>
  598. </tbody>
  599. </tgroup>
  600. </table>
  601. </section>
  602. <section id="pixfmt-indexed">
  603. <title>Indexed Format</title>
  604. <para>In this format each pixel is represented by an 8 bit index
  605. into a 256 entry ARGB palette. It is intended for <link
  606. linkend="osd">Video Output Overlays</link> only. There are no ioctls to
  607. access the palette, this must be done with ioctls of the Linux framebuffer API.</para>
  608. <table pgwide="0" frame="none">
  609. <title>Indexed Image Format</title>
  610. <tgroup cols="37" align="center">
  611. <colspec colname="id" align="left" />
  612. <colspec colname="fourcc" />
  613. <colspec colname="bit" />
  614. <colspec colnum="4" colname="b07" align="center" />
  615. <colspec colnum="5" colname="b06" align="center" />
  616. <colspec colnum="6" colname="b05" align="center" />
  617. <colspec colnum="7" colname="b04" align="center" />
  618. <colspec colnum="8" colname="b03" align="center" />
  619. <colspec colnum="9" colname="b02" align="center" />
  620. <colspec colnum="10" colname="b01" align="center" />
  621. <colspec colnum="11" colname="b00" align="center" />
  622. <spanspec namest="b07" nameend="b00" spanname="b0" />
  623. <spanspec namest="b17" nameend="b10" spanname="b1" />
  624. <spanspec namest="b27" nameend="b20" spanname="b2" />
  625. <spanspec namest="b37" nameend="b30" spanname="b3" />
  626. <thead>
  627. <row>
  628. <entry>Identifier</entry>
  629. <entry>Code</entry>
  630. <entry>&nbsp;</entry>
  631. <entry spanname="b0">Byte&nbsp;0</entry>
  632. </row>
  633. <row>
  634. <entry>&nbsp;</entry>
  635. <entry>&nbsp;</entry>
  636. <entry>Bit</entry>
  637. <entry>7</entry>
  638. <entry>6</entry>
  639. <entry>5</entry>
  640. <entry>4</entry>
  641. <entry>3</entry>
  642. <entry>2</entry>
  643. <entry>1</entry>
  644. <entry>0</entry>
  645. </row>
  646. </thead>
  647. <tbody valign="top">
  648. <row id="V4L2-PIX-FMT-PAL8">
  649. <entry><constant>V4L2_PIX_FMT_PAL8</constant></entry>
  650. <entry>'PAL8'</entry>
  651. <entry></entry>
  652. <entry>i<subscript>7</subscript></entry>
  653. <entry>i<subscript>6</subscript></entry>
  654. <entry>i<subscript>5</subscript></entry>
  655. <entry>i<subscript>4</subscript></entry>
  656. <entry>i<subscript>3</subscript></entry>
  657. <entry>i<subscript>2</subscript></entry>
  658. <entry>i<subscript>1</subscript></entry>
  659. <entry>i<subscript>0</subscript></entry>
  660. </row>
  661. </tbody>
  662. </tgroup>
  663. </table>
  664. </section>
  665. <section id="pixfmt-rgb">
  666. <title>RGB Formats</title>
  667. &sub-packed-rgb;
  668. &sub-sbggr8;
  669. &sub-sgbrg8;
  670. &sub-sgrbg8;
  671. &sub-srggb8;
  672. &sub-sbggr16;
  673. &sub-srggb10;
  674. &sub-srggb10alaw8;
  675. &sub-srggb10dpcm8;
  676. &sub-srggb12;
  677. </section>
  678. <section id="yuv-formats">
  679. <title>YUV Formats</title>
  680. <para>YUV is the format native to TV broadcast and composite video
  681. signals. It separates the brightness information (Y) from the color
  682. information (U and V or Cb and Cr). The color information consists of
  683. red and blue <emphasis>color difference</emphasis> signals, this way
  684. the green component can be reconstructed by subtracting from the
  685. brightness component. See <xref linkend="colorspaces" /> for conversion
  686. examples. YUV was chosen because early television would only transmit
  687. brightness information. To add color in a way compatible with existing
  688. receivers a new signal carrier was added to transmit the color
  689. difference signals. Secondary in the YUV format the U and V components
  690. usually have lower resolution than the Y component. This is an analog
  691. video compression technique taking advantage of a property of the
  692. human visual system, being more sensitive to brightness
  693. information.</para>
  694. &sub-packed-yuv;
  695. &sub-grey;
  696. &sub-y10;
  697. &sub-y12;
  698. &sub-y10b;
  699. &sub-y16;
  700. &sub-uv8;
  701. &sub-yuyv;
  702. &sub-uyvy;
  703. &sub-yvyu;
  704. &sub-vyuy;
  705. &sub-y41p;
  706. &sub-yuv420;
  707. &sub-yuv420m;
  708. &sub-yvu420m;
  709. &sub-yuv410;
  710. &sub-yuv422p;
  711. &sub-yuv411p;
  712. &sub-nv12;
  713. &sub-nv12m;
  714. &sub-nv12mt;
  715. &sub-nv16;
  716. &sub-nv16m;
  717. &sub-nv24;
  718. &sub-m420;
  719. </section>
  720. <section>
  721. <title>Compressed Formats</title>
  722. <table pgwide="1" frame="none" id="compressed-formats">
  723. <title>Compressed Image Formats</title>
  724. <tgroup cols="3" align="left">
  725. &cs-def;
  726. <thead>
  727. <row>
  728. <entry>Identifier</entry>
  729. <entry>Code</entry>
  730. <entry>Details</entry>
  731. </row>
  732. </thead>
  733. <tbody valign="top">
  734. <row id="V4L2-PIX-FMT-JPEG">
  735. <entry><constant>V4L2_PIX_FMT_JPEG</constant></entry>
  736. <entry>'JPEG'</entry>
  737. <entry>TBD. See also &VIDIOC-G-JPEGCOMP;,
  738. &VIDIOC-S-JPEGCOMP;.</entry>
  739. </row>
  740. <row id="V4L2-PIX-FMT-MPEG">
  741. <entry><constant>V4L2_PIX_FMT_MPEG</constant></entry>
  742. <entry>'MPEG'</entry>
  743. <entry>MPEG multiplexed stream. The actual format is determined by
  744. extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see
  745. <xref linkend="mpeg-control-id" />.</entry>
  746. </row>
  747. <row id="V4L2-PIX-FMT-H264">
  748. <entry><constant>V4L2_PIX_FMT_H264</constant></entry>
  749. <entry>'H264'</entry>
  750. <entry>H264 video elementary stream with start codes.</entry>
  751. </row>
  752. <row id="V4L2-PIX-FMT-H264-NO-SC">
  753. <entry><constant>V4L2_PIX_FMT_H264_NO_SC</constant></entry>
  754. <entry>'AVC1'</entry>
  755. <entry>H264 video elementary stream without start codes.</entry>
  756. </row>
  757. <row id="V4L2-PIX-FMT-H264-MVC">
  758. <entry><constant>V4L2_PIX_FMT_H264_MVC</constant></entry>
  759. <entry>'M264'</entry>
  760. <entry>H264 MVC video elementary stream.</entry>
  761. </row>
  762. <row id="V4L2-PIX-FMT-H263">
  763. <entry><constant>V4L2_PIX_FMT_H263</constant></entry>
  764. <entry>'H263'</entry>
  765. <entry>H263 video elementary stream.</entry>
  766. </row>
  767. <row id="V4L2-PIX-FMT-MPEG1">
  768. <entry><constant>V4L2_PIX_FMT_MPEG1</constant></entry>
  769. <entry>'MPG1'</entry>
  770. <entry>MPEG1 video elementary stream.</entry>
  771. </row>
  772. <row id="V4L2-PIX-FMT-MPEG2">
  773. <entry><constant>V4L2_PIX_FMT_MPEG2</constant></entry>
  774. <entry>'MPG2'</entry>
  775. <entry>MPEG2 video elementary stream.</entry>
  776. </row>
  777. <row id="V4L2-PIX-FMT-MPEG4">
  778. <entry><constant>V4L2_PIX_FMT_MPEG4</constant></entry>
  779. <entry>'MPG4'</entry>
  780. <entry>MPEG4 video elementary stream.</entry>
  781. </row>
  782. <row id="V4L2-PIX-FMT-XVID">
  783. <entry><constant>V4L2_PIX_FMT_XVID</constant></entry>
  784. <entry>'XVID'</entry>
  785. <entry>Xvid video elementary stream.</entry>
  786. </row>
  787. <row id="V4L2-PIX-FMT-VC1-ANNEX-G">
  788. <entry><constant>V4L2_PIX_FMT_VC1_ANNEX_G</constant></entry>
  789. <entry>'VC1G'</entry>
  790. <entry>VC1, SMPTE 421M Annex G compliant stream.</entry>
  791. </row>
  792. <row id="V4L2-PIX-FMT-VC1-ANNEX-L">
  793. <entry><constant>V4L2_PIX_FMT_VC1_ANNEX_L</constant></entry>
  794. <entry>'VC1L'</entry>
  795. <entry>VC1, SMPTE 421M Annex L compliant stream.</entry>
  796. </row>
  797. <row id="V4L2-PIX-FMT-VP8">
  798. <entry><constant>V4L2_PIX_FMT_VP8</constant></entry>
  799. <entry>'VP80'</entry>
  800. <entry>VP8 video elementary stream.</entry>
  801. </row>
  802. </tbody>
  803. </tgroup>
  804. </table>
  805. </section>
  806. <section id="sdr-formats">
  807. <title>SDR Formats</title>
  808. <para>These formats are used for <link linkend="sdr">SDR Capture</link>
  809. interface only.</para>
  810. &sub-sdr-cu08;
  811. &sub-sdr-cu16le;
  812. &sub-sdr-cs08;
  813. &sub-sdr-cs14le;
  814. &sub-sdr-ru12le;
  815. </section>
  816. <section id="pixfmt-reserved">
  817. <title>Reserved Format Identifiers</title>
  818. <para>These formats are not defined by this specification, they
  819. are just listed for reference and to avoid naming conflicts. If you
  820. want to register your own format, send an e-mail to the linux-media mailing
  821. list &v4l-ml; for inclusion in the <filename>videodev2.h</filename>
  822. file. If you want to share your format with other developers add a
  823. link to your documentation and send a copy to the linux-media mailing list
  824. for inclusion in this section. If you think your format should be listed
  825. in a standard format section please make a proposal on the linux-media mailing
  826. list.</para>
  827. <table pgwide="1" frame="none" id="reserved-formats">
  828. <title>Reserved Image Formats</title>
  829. <tgroup cols="3" align="left">
  830. &cs-def;
  831. <thead>
  832. <row>
  833. <entry>Identifier</entry>
  834. <entry>Code</entry>
  835. <entry>Details</entry>
  836. </row>
  837. </thead>
  838. <tbody valign="top">
  839. <row id="V4L2-PIX-FMT-DV">
  840. <entry><constant>V4L2_PIX_FMT_DV</constant></entry>
  841. <entry>'dvsd'</entry>
  842. <entry>unknown</entry>
  843. </row>
  844. <row id="V4L2-PIX-FMT-ET61X251">
  845. <entry><constant>V4L2_PIX_FMT_ET61X251</constant></entry>
  846. <entry>'E625'</entry>
  847. <entry>Compressed format of the ET61X251 driver.</entry>
  848. </row>
  849. <row id="V4L2-PIX-FMT-HI240">
  850. <entry><constant>V4L2_PIX_FMT_HI240</constant></entry>
  851. <entry>'HI24'</entry>
  852. <entry><para>8 bit RGB format used by the BTTV driver.</para></entry>
  853. </row>
  854. <row id="V4L2-PIX-FMT-HM12">
  855. <entry><constant>V4L2_PIX_FMT_HM12</constant></entry>
  856. <entry>'HM12'</entry>
  857. <entry><para>YUV 4:2:0 format used by the
  858. IVTV driver, <ulink url="http://www.ivtvdriver.org/">
  859. http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the
  860. kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename>
  861. </para></entry>
  862. </row>
  863. <row id="V4L2-PIX-FMT-CPIA1">
  864. <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry>
  865. <entry>'CPIA'</entry>
  866. <entry>YUV format used by the gspca cpia1 driver.</entry>
  867. </row>
  868. <row id="V4L2-PIX-FMT-JPGL">
  869. <entry><constant>V4L2_PIX_FMT_JPGL</constant></entry>
  870. <entry>'JPGL'</entry>
  871. <entry>JPEG-Light format (Pegasus Lossless JPEG)
  872. used in Divio webcams NW 80x.</entry>
  873. </row>
  874. <row id="V4L2-PIX-FMT-SPCA501">
  875. <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry>
  876. <entry>'S501'</entry>
  877. <entry>YUYV per line used by the gspca driver.</entry>
  878. </row>
  879. <row id="V4L2-PIX-FMT-SPCA505">
  880. <entry><constant>V4L2_PIX_FMT_SPCA505</constant></entry>
  881. <entry>'S505'</entry>
  882. <entry>YYUV per line used by the gspca driver.</entry>
  883. </row>
  884. <row id="V4L2-PIX-FMT-SPCA508">
  885. <entry><constant>V4L2_PIX_FMT_SPCA508</constant></entry>
  886. <entry>'S508'</entry>
  887. <entry>YUVY per line used by the gspca driver.</entry>
  888. </row>
  889. <row id="V4L2-PIX-FMT-SPCA561">
  890. <entry><constant>V4L2_PIX_FMT_SPCA561</constant></entry>
  891. <entry>'S561'</entry>
  892. <entry>Compressed GBRG Bayer format used by the gspca driver.</entry>
  893. </row>
  894. <row id="V4L2-PIX-FMT-PAC207">
  895. <entry><constant>V4L2_PIX_FMT_PAC207</constant></entry>
  896. <entry>'P207'</entry>
  897. <entry>Compressed BGGR Bayer format used by the gspca driver.</entry>
  898. </row>
  899. <row id="V4L2-PIX-FMT-MR97310A">
  900. <entry><constant>V4L2_PIX_FMT_MR97310A</constant></entry>
  901. <entry>'M310'</entry>
  902. <entry>Compressed BGGR Bayer format used by the gspca driver.</entry>
  903. </row>
  904. <row id="V4L2-PIX-FMT-JL2005BCD">
  905. <entry><constant>V4L2_PIX_FMT_JL2005BCD</constant></entry>
  906. <entry>'JL20'</entry>
  907. <entry>JPEG compressed RGGB Bayer format used by the gspca driver.</entry>
  908. </row>
  909. <row id="V4L2-PIX-FMT-OV511">
  910. <entry><constant>V4L2_PIX_FMT_OV511</constant></entry>
  911. <entry>'O511'</entry>
  912. <entry>OV511 JPEG format used by the gspca driver.</entry>
  913. </row>
  914. <row id="V4L2-PIX-FMT-OV518">
  915. <entry><constant>V4L2_PIX_FMT_OV518</constant></entry>
  916. <entry>'O518'</entry>
  917. <entry>OV518 JPEG format used by the gspca driver.</entry>
  918. </row>
  919. <row id="V4L2-PIX-FMT-PJPG">
  920. <entry><constant>V4L2_PIX_FMT_PJPG</constant></entry>
  921. <entry>'PJPG'</entry>
  922. <entry>Pixart 73xx JPEG format used by the gspca driver.</entry>
  923. </row>
  924. <row id="V4L2-PIX-FMT-SE401">
  925. <entry><constant>V4L2_PIX_FMT_SE401</constant></entry>
  926. <entry>'S401'</entry>
  927. <entry>Compressed RGB format used by the gspca se401 driver</entry>
  928. </row>
  929. <row id="V4L2-PIX-FMT-SQ905C">
  930. <entry><constant>V4L2_PIX_FMT_SQ905C</constant></entry>
  931. <entry>'905C'</entry>
  932. <entry>Compressed RGGB bayer format used by the gspca driver.</entry>
  933. </row>
  934. <row id="V4L2-PIX-FMT-MJPEG">
  935. <entry><constant>V4L2_PIX_FMT_MJPEG</constant></entry>
  936. <entry>'MJPG'</entry>
  937. <entry>Compressed format used by the Zoran driver</entry>
  938. </row>
  939. <row id="V4L2-PIX-FMT-PWC1">
  940. <entry><constant>V4L2_PIX_FMT_PWC1</constant></entry>
  941. <entry>'PWC1'</entry>
  942. <entry>Compressed format of the PWC driver.</entry>
  943. </row>
  944. <row id="V4L2-PIX-FMT-PWC2">
  945. <entry><constant>V4L2_PIX_FMT_PWC2</constant></entry>
  946. <entry>'PWC2'</entry>
  947. <entry>Compressed format of the PWC driver.</entry>
  948. </row>
  949. <row id="V4L2-PIX-FMT-SN9C10X">
  950. <entry><constant>V4L2_PIX_FMT_SN9C10X</constant></entry>
  951. <entry>'S910'</entry>
  952. <entry>Compressed format of the SN9C102 driver.</entry>
  953. </row>
  954. <row id="V4L2-PIX-FMT-SN9C20X-I420">
  955. <entry><constant>V4L2_PIX_FMT_SN9C20X_I420</constant></entry>
  956. <entry>'S920'</entry>
  957. <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry>
  958. </row>
  959. <row id="V4L2-PIX-FMT-SN9C2028">
  960. <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry>
  961. <entry>'SONX'</entry>
  962. <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry>
  963. </row>
  964. <row id="V4L2-PIX-FMT-STV0680">
  965. <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry>
  966. <entry>'S680'</entry>
  967. <entry>Bayer format of the gspca stv0680 driver.</entry>
  968. </row>
  969. <row id="V4L2-PIX-FMT-WNVA">
  970. <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry>
  971. <entry>'WNVA'</entry>
  972. <entry><para>Used by the Winnov Videum driver, <ulink
  973. url="http://www.thedirks.org/winnov/">
  974. http://www.thedirks.org/winnov/</ulink></para></entry>
  975. </row>
  976. <row id="V4L2-PIX-FMT-TM6000">
  977. <entry><constant>V4L2_PIX_FMT_TM6000</constant></entry>
  978. <entry>'TM60'</entry>
  979. <entry><para>Used by Trident tm6000</para></entry>
  980. </row>
  981. <row id="V4L2-PIX-FMT-CIT-YYVYUY">
  982. <entry><constant>V4L2_PIX_FMT_CIT_YYVYUY</constant></entry>
  983. <entry>'CITV'</entry>
  984. <entry><para>Used by xirlink CIT, found at IBM webcams.</para>
  985. <para>Uses one line of Y then 1 line of VYUY</para>
  986. </entry>
  987. </row>
  988. <row id="V4L2-PIX-FMT-KONICA420">
  989. <entry><constant>V4L2_PIX_FMT_KONICA420</constant></entry>
  990. <entry>'KONI'</entry>
  991. <entry><para>Used by Konica webcams.</para>
  992. <para>YUV420 planar in blocks of 256 pixels.</para>
  993. </entry>
  994. </row>
  995. <row id="V4L2-PIX-FMT-YYUV">
  996. <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry>
  997. <entry>'YYUV'</entry>
  998. <entry>unknown</entry>
  999. </row>
  1000. <row id="V4L2-PIX-FMT-Y4">
  1001. <entry><constant>V4L2_PIX_FMT_Y4</constant></entry>
  1002. <entry>'Y04 '</entry>
  1003. <entry>Old 4-bit greyscale format. Only the most significant 4 bits of each byte are used,
  1004. the other bits are set to 0.</entry>
  1005. </row>
  1006. <row id="V4L2-PIX-FMT-Y6">
  1007. <entry><constant>V4L2_PIX_FMT_Y6</constant></entry>
  1008. <entry>'Y06 '</entry>
  1009. <entry>Old 6-bit greyscale format. Only the most significant 6 bits of each byte are used,
  1010. the other bits are set to 0.</entry>
  1011. </row>
  1012. <row id="V4L2-PIX-FMT-S5C-UYVY-JPG">
  1013. <entry><constant>V4L2_PIX_FMT_S5C_UYVY_JPG</constant></entry>
  1014. <entry>'S5CI'</entry>
  1015. <entry>Two-planar format used by Samsung S5C73MX cameras. The
  1016. first plane contains interleaved JPEG and UYVY image data, followed by meta data
  1017. in form of an array of offsets to the UYVY data blocks. The actual pointer array
  1018. follows immediately the interleaved JPEG/UYVY data, the number of entries in
  1019. this array equals the height of the UYVY image. Each entry is a 4-byte unsigned
  1020. integer in big endian order and it's an offset to a single pixel line of the
  1021. UYVY image. The first plane can start either with JPEG or UYVY data chunk. The
  1022. size of a single UYVY block equals the UYVY image's width multiplied by 2. The
  1023. size of a JPEG chunk depends on the image and can vary with each line.
  1024. <para>The second plane, at an offset of 4084 bytes, contains a 4-byte offset to
  1025. the pointer array in the first plane. This offset is followed by a 4-byte value
  1026. indicating size of the pointer array. All numbers in the second plane are also
  1027. in big endian order. Remaining data in the second plane is undefined. The
  1028. information in the second plane allows to easily find location of the pointer
  1029. array, which can be different for each frame. The size of the pointer array is
  1030. constant for given UYVY image height.</para>
  1031. <para>In order to extract UYVY and JPEG frames an application can initially set
  1032. a data pointer to the start of first plane and then add an offset from the first
  1033. entry of the pointers table. Such a pointer indicates start of an UYVY image
  1034. pixel line. Whole UYVY line can be copied to a separate buffer. These steps
  1035. should be repeated for each line, i.e. the number of entries in the pointer
  1036. array. Anything what's in between the UYVY lines is JPEG data and should be
  1037. concatenated to form the JPEG stream. </para>
  1038. </entry>
  1039. </row>
  1040. </tbody>
  1041. </tgroup>
  1042. </table>
  1043. <table frame="none" pgwide="1" id="format-flags">
  1044. <title>Format Flags</title>
  1045. <tgroup cols="3">
  1046. &cs-def;
  1047. <tbody valign="top">
  1048. <row>
  1049. <entry><constant>V4L2_PIX_FMT_FLAG_PREMUL_ALPHA</constant></entry>
  1050. <entry>0x00000001</entry>
  1051. <entry>The color values are premultiplied by the alpha channel
  1052. value. For example, if a light blue pixel with 50% transparency was described by
  1053. RGBA values (128, 192, 255, 128), the same pixel described with premultiplied
  1054. colors would be described by RGBA values (64, 96, 128, 128) </entry>
  1055. </row>
  1056. </tbody>
  1057. </tgroup>
  1058. </table>
  1059. </section>