diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-05-11 08:56:20 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 11:17:35 -0400 |
commit | 0e59fd0592430cee4595c600427899a3404861e7 (patch) | |
tree | 8c5ecbab4e4548b329f12ae32080133247aa1d02 | |
parent | 7296944759c41001122fc95110468a1a572352cd (diff) |
[media] v4l: Add M420 format definition
M420 is a hybrid YUV 4:2:0 packet/planar format. Two Y lines are
followed by an interleaved U/V line.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[laurent.pinchart@ideasonboard.com: split into v4l/uvcvideo patches]
[laurent.pinchart@ideasonboard.com: add documentation]
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | Documentation/DocBook/media-entities.tmpl | 1 | ||||
-rw-r--r-- | Documentation/DocBook/v4l/pixfmt-m420.xml | 147 | ||||
-rw-r--r-- | Documentation/DocBook/v4l/pixfmt.xml | 1 | ||||
-rw-r--r-- | Documentation/DocBook/v4l/videodev2.h.xml | 1 | ||||
-rw-r--r-- | include/linux/videodev2.h | 1 |
5 files changed, 151 insertions, 0 deletions
diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl index 7a9570887d21..c8abb23ef1e7 100644 --- a/Documentation/DocBook/media-entities.tmpl +++ b/Documentation/DocBook/media-entities.tmpl | |||
@@ -270,6 +270,7 @@ | |||
270 | <!ENTITY sub-write SYSTEM "v4l/func-write.xml"> | 270 | <!ENTITY sub-write SYSTEM "v4l/func-write.xml"> |
271 | <!ENTITY sub-io SYSTEM "v4l/io.xml"> | 271 | <!ENTITY sub-io SYSTEM "v4l/io.xml"> |
272 | <!ENTITY sub-grey SYSTEM "v4l/pixfmt-grey.xml"> | 272 | <!ENTITY sub-grey SYSTEM "v4l/pixfmt-grey.xml"> |
273 | <!ENTITY sub-m420 SYSTEM "v4l/pixfmt-m420.xml"> | ||
273 | <!ENTITY sub-nv12 SYSTEM "v4l/pixfmt-nv12.xml"> | 274 | <!ENTITY sub-nv12 SYSTEM "v4l/pixfmt-nv12.xml"> |
274 | <!ENTITY sub-nv12m SYSTEM "v4l/pixfmt-nv12m.xml"> | 275 | <!ENTITY sub-nv12m SYSTEM "v4l/pixfmt-nv12m.xml"> |
275 | <!ENTITY sub-nv12mt SYSTEM "v4l/pixfmt-nv12mt.xml"> | 276 | <!ENTITY sub-nv12mt SYSTEM "v4l/pixfmt-nv12mt.xml"> |
diff --git a/Documentation/DocBook/v4l/pixfmt-m420.xml b/Documentation/DocBook/v4l/pixfmt-m420.xml new file mode 100644 index 000000000000..ce4bc019e5c0 --- /dev/null +++ b/Documentation/DocBook/v4l/pixfmt-m420.xml | |||
@@ -0,0 +1,147 @@ | |||
1 | <refentry id="V4L2-PIX-FMT-M420"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>V4L2_PIX_FMT_M420 ('M420')</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | <refnamediv> | ||
7 | <refname><constant>V4L2_PIX_FMT_M420</constant></refname> | ||
8 | <refpurpose>Format with ½ horizontal and vertical chroma | ||
9 | resolution, also known as YUV 4:2:0. Hybrid plane line-interleaved | ||
10 | layout.</refpurpose> | ||
11 | </refnamediv> | ||
12 | <refsect1> | ||
13 | <title>Description</title> | ||
14 | |||
15 | <para>M420 is a YUV format with ½ horizontal and vertical chroma | ||
16 | subsampling (YUV 4:2:0). Pixels are organized as interleaved luma and | ||
17 | chroma planes. Two lines of luma data are followed by one line of chroma | ||
18 | data.</para> | ||
19 | <para>The luma plane has one byte per pixel. The chroma plane contains | ||
20 | interleaved CbCr pixels subsampled by ½ in the horizontal and | ||
21 | vertical directions. Each CbCr pair belongs to four pixels. For example, | ||
22 | Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to | ||
23 | Y'<subscript>00</subscript>, Y'<subscript>01</subscript>, | ||
24 | Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.</para> | ||
25 | |||
26 | <para>All line lengths are identical: if the Y lines include pad bytes | ||
27 | so do the CbCr lines.</para> | ||
28 | |||
29 | <example> | ||
30 | <title><constant>V4L2_PIX_FMT_M420</constant> 4 × 4 | ||
31 | pixel image</title> | ||
32 | |||
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 + 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 + 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 + 8:</entry> | ||
56 | <entry>Cb<subscript>00</subscript></entry> | ||
57 | <entry>Cr<subscript>00</subscript></entry> | ||
58 | <entry>Cb<subscript>01</subscript></entry> | ||
59 | <entry>Cr<subscript>01</subscript></entry> | ||
60 | </row> | ||
61 | <row> | ||
62 | <entry>start + 16:</entry> | ||
63 | <entry>Y'<subscript>20</subscript></entry> | ||
64 | <entry>Y'<subscript>21</subscript></entry> | ||
65 | <entry>Y'<subscript>22</subscript></entry> | ||
66 | <entry>Y'<subscript>23</subscript></entry> | ||
67 | </row> | ||
68 | <row> | ||
69 | <entry>start + 20:</entry> | ||
70 | <entry>Y'<subscript>30</subscript></entry> | ||
71 | <entry>Y'<subscript>31</subscript></entry> | ||
72 | <entry>Y'<subscript>32</subscript></entry> | ||
73 | <entry>Y'<subscript>33</subscript></entry> | ||
74 | </row> | ||
75 | <row> | ||
76 | <entry>start + 24:</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 | |||
88 | <formalpara> | ||
89 | <title>Color Sample Location.</title> | ||
90 | <para> | ||
91 | <informaltable frame="none"> | ||
92 | <tgroup cols="7" align="center"> | ||
93 | <tbody valign="top"> | ||
94 | <row> | ||
95 | <entry></entry> | ||
96 | <entry>0</entry><entry></entry><entry>1</entry><entry></entry> | ||
97 | <entry>2</entry><entry></entry><entry>3</entry> | ||
98 | </row> | ||
99 | <row> | ||
100 | <entry>0</entry> | ||
101 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
102 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
103 | </row> | ||
104 | <row> | ||
105 | <entry></entry> | ||
106 | <entry></entry><entry>C</entry><entry></entry><entry></entry> | ||
107 | <entry></entry><entry>C</entry><entry></entry> | ||
108 | </row> | ||
109 | <row> | ||
110 | <entry>1</entry> | ||
111 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
112 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
113 | </row> | ||
114 | <row> | ||
115 | <entry></entry> | ||
116 | </row> | ||
117 | <row> | ||
118 | <entry>2</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 | <entry></entry><entry>C</entry><entry></entry><entry></entry> | ||
125 | <entry></entry><entry>C</entry><entry></entry> | ||
126 | </row> | ||
127 | <row> | ||
128 | <entry>3</entry> | ||
129 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
130 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
131 | </row> | ||
132 | </tbody> | ||
133 | </tgroup> | ||
134 | </informaltable> | ||
135 | </para> | ||
136 | </formalpara> | ||
137 | </example> | ||
138 | </refsect1> | ||
139 | </refentry> | ||
140 | |||
141 | <!-- | ||
142 | Local Variables: | ||
143 | mode: sgml | ||
144 | sgml-parent-document: "pixfmt.sgml" | ||
145 | indent-tabs-mode: nil | ||
146 | End: | ||
147 | --> | ||
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index 3486a068fe46..dbfe3b08435f 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml | |||
@@ -713,6 +713,7 @@ information.</para> | |||
713 | &sub-nv12m; | 713 | &sub-nv12m; |
714 | &sub-nv12mt; | 714 | &sub-nv12mt; |
715 | &sub-nv16; | 715 | &sub-nv16; |
716 | &sub-m420; | ||
716 | </section> | 717 | </section> |
717 | 718 | ||
718 | <section> | 719 | <section> |
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml index 937acf54da9c..c50536a4f596 100644 --- a/Documentation/DocBook/v4l/videodev2.h.xml +++ b/Documentation/DocBook/v4l/videodev2.h.xml | |||
@@ -336,6 +336,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
336 | #define <link linkend="V4L2-PIX-FMT-YUV420">V4L2_PIX_FMT_YUV420</link> v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ | 336 | #define <link linkend="V4L2-PIX-FMT-YUV420">V4L2_PIX_FMT_YUV420</link> v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ |
337 | #define <link linkend="V4L2-PIX-FMT-HI240">V4L2_PIX_FMT_HI240</link> v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ | 337 | #define <link linkend="V4L2-PIX-FMT-HI240">V4L2_PIX_FMT_HI240</link> v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ |
338 | #define <link linkend="V4L2-PIX-FMT-HM12">V4L2_PIX_FMT_HM12</link> v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ | 338 | #define <link linkend="V4L2-PIX-FMT-HM12">V4L2_PIX_FMT_HM12</link> v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ |
339 | #define <link linkend="V4L2-PIX-FMT-M420">V4L2_PIX_FMT_M420</link> v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ | ||
339 | 340 | ||
340 | /* two planes -- one Y, one Cr + Cb interleaved */ | 341 | /* two planes -- one Y, one Cr + Cb interleaved */ |
341 | #define <link linkend="V4L2-PIX-FMT-NV12">V4L2_PIX_FMT_NV12</link> v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ | 342 | #define <link linkend="V4L2-PIX-FMT-NV12">V4L2_PIX_FMT_NV12</link> v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index a417270b337f..8a4c309d2344 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -336,6 +336,7 @@ struct v4l2_pix_format { | |||
336 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ | 336 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ |
337 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ | 337 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ |
338 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ | 338 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ |
339 | #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ | ||
339 | 340 | ||
340 | /* two planes -- one Y, one Cr + Cb interleaved */ | 341 | /* two planes -- one Y, one Cr + Cb interleaved */ |
341 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ | 342 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |