Commit d924de09cac6e18bdfbe9461a2ab2adeb36e77b0

Authored by Michael Jones
Committed by Mauro Carvalho Chehab
1 parent 5a3ddcde35

[media] v4l: add V4L2_PIX_FMT_Y12 format

Y12 is a grey-scale format with a depth of 12 bits per pixel stored in
16-bit words.

Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Showing 4 changed files with 82 additions and 0 deletions Side-by-side Diff

Documentation/DocBook/media-entities.tmpl
... ... @@ -294,6 +294,7 @@
294 294 <!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml">
295 295 <!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml">
296 296 <!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml">
  297 +<!ENTITY sub-y12 SYSTEM "v4l/pixfmt-y12.xml">
297 298 <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml">
298 299 <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml">
299 300 <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
Documentation/DocBook/v4l/pixfmt-y12.xml
  1 +<refentry id="V4L2-PIX-FMT-Y12">
  2 + <refmeta>
  3 + <refentrytitle>V4L2_PIX_FMT_Y12 ('Y12 ')</refentrytitle>
  4 + &manvol;
  5 + </refmeta>
  6 + <refnamediv>
  7 + <refname><constant>V4L2_PIX_FMT_Y12</constant></refname>
  8 + <refpurpose>Grey-scale image</refpurpose>
  9 + </refnamediv>
  10 + <refsect1>
  11 + <title>Description</title>
  12 +
  13 + <para>This is a grey-scale image with a depth of 12 bits per pixel. Pixels
  14 +are stored in 16-bit words with unused high bits padded with 0. The least
  15 +significant byte is stored at lower memory addresses (little-endian).</para>
  16 +
  17 + <example>
  18 + <title><constant>V4L2_PIX_FMT_Y12</constant> 4 &times; 4
  19 +pixel image</title>
  20 +
  21 + <formalpara>
  22 + <title>Byte Order.</title>
  23 + <para>Each cell is one byte.
  24 + <informaltable frame="none">
  25 + <tgroup cols="9" align="center">
  26 + <colspec align="left" colwidth="2*" />
  27 + <tbody valign="top">
  28 + <row>
  29 + <entry>start&nbsp;+&nbsp;0:</entry>
  30 + <entry>Y'<subscript>00low</subscript></entry>
  31 + <entry>Y'<subscript>00high</subscript></entry>
  32 + <entry>Y'<subscript>01low</subscript></entry>
  33 + <entry>Y'<subscript>01high</subscript></entry>
  34 + <entry>Y'<subscript>02low</subscript></entry>
  35 + <entry>Y'<subscript>02high</subscript></entry>
  36 + <entry>Y'<subscript>03low</subscript></entry>
  37 + <entry>Y'<subscript>03high</subscript></entry>
  38 + </row>
  39 + <row>
  40 + <entry>start&nbsp;+&nbsp;8:</entry>
  41 + <entry>Y'<subscript>10low</subscript></entry>
  42 + <entry>Y'<subscript>10high</subscript></entry>
  43 + <entry>Y'<subscript>11low</subscript></entry>
  44 + <entry>Y'<subscript>11high</subscript></entry>
  45 + <entry>Y'<subscript>12low</subscript></entry>
  46 + <entry>Y'<subscript>12high</subscript></entry>
  47 + <entry>Y'<subscript>13low</subscript></entry>
  48 + <entry>Y'<subscript>13high</subscript></entry>
  49 + </row>
  50 + <row>
  51 + <entry>start&nbsp;+&nbsp;16:</entry>
  52 + <entry>Y'<subscript>20low</subscript></entry>
  53 + <entry>Y'<subscript>20high</subscript></entry>
  54 + <entry>Y'<subscript>21low</subscript></entry>
  55 + <entry>Y'<subscript>21high</subscript></entry>
  56 + <entry>Y'<subscript>22low</subscript></entry>
  57 + <entry>Y'<subscript>22high</subscript></entry>
  58 + <entry>Y'<subscript>23low</subscript></entry>
  59 + <entry>Y'<subscript>23high</subscript></entry>
  60 + </row>
  61 + <row>
  62 + <entry>start&nbsp;+&nbsp;24:</entry>
  63 + <entry>Y'<subscript>30low</subscript></entry>
  64 + <entry>Y'<subscript>30high</subscript></entry>
  65 + <entry>Y'<subscript>31low</subscript></entry>
  66 + <entry>Y'<subscript>31high</subscript></entry>
  67 + <entry>Y'<subscript>32low</subscript></entry>
  68 + <entry>Y'<subscript>32high</subscript></entry>
  69 + <entry>Y'<subscript>33low</subscript></entry>
  70 + <entry>Y'<subscript>33high</subscript></entry>
  71 + </row>
  72 + </tbody>
  73 + </tgroup>
  74 + </informaltable>
  75 + </para>
  76 + </formalpara>
  77 + </example>
  78 + </refsect1>
  79 +</refentry>
Documentation/DocBook/v4l/pixfmt.xml
... ... @@ -696,6 +696,7 @@
696 696 &sub-packed-yuv;
697 697 &sub-grey;
698 698 &sub-y10;
  699 + &sub-y12;
699 700 &sub-y16;
700 701 &sub-yuyv;
701 702 &sub-uyvy;
include/linux/videodev2.h
... ... @@ -308,6 +308,7 @@
308 308 #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
309 309 #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
310 310 #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
  311 +#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
311 312 #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
312 313  
313 314 /* Palette formats */