diff mbox

[2/3] Document 8-bit and 16-bit YCrCb media bus pixel codes

Message ID CAH9NwWc+zLqPyBcC99wbsbNkdjzMFfn2zuGm1VfmZctgpOGMew@mail.gmail.com (mailing list archive)
State Under Review
Headers show

Commit Message

Christian Gmeiner July 10, 2011, 6:14 p.m. UTC
Signed-off-by: Christian Gmeiner
---
+    </section>
   </section>
 </section>
--
1.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Laurent Pinchart July 11, 2011, 10:58 a.m. UTC | #1
Hi Christian,

On Sunday 10 July 2011 20:14:21 Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner
> ---
> diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
> b/Documentation/DocBook/media/v4l/subdev-formats.xml
> index 49c532e..18e30b0 100644
> --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
> +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
> @@ -2565,5 +2565,43 @@
>         </tgroup>
>        </table>
>      </section>
> +
> +    <section>
> +      <title>YCrCb Formats</title>
> +
> +      <para>YCbCr represents colors as a combination of three values:
> +      <itemizedlist>
> +       <listitem><para>Y - the luminosity (roughly the
> brightness)</para></listitem>
> +       <listitem><para>Cb - the chrominance of the blue
> primary</para></listitem>
> +       <listitem><para>Cr - the chrominance of the red
> primary</para></listitem>

How does that differ from YUV ?

> +      </itemizedlist>
> +      </para>
> +
> +      <para>The following table lists existing YCrCb compressed
> formats.</para> +
> +      <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-ycrcb">
> +       <title>YCrCb Formats</title>
> +       <tgroup cols="2">
> +         <colspec colname="id" align="left" />
> +         <colspec colname="code" align="left"/>
> +         <thead>
> +           <row>
> +             <entry>Identifier</entry>
> +             <entry>Code</entry>
> +           </row>
> +         </thead>
> +         <tbody valign="top">
> +           <row id="V4L2_MBUS_FMT_YCRCB_1X8">
> +             <entry>V4L2_MBUS_FMT_YCRCB_1X8</entry>
> +             <entry>0x5001</entry>
> +           </row>
> +           <row id="V4L2_MBUS_FMT_YCRCB_1X16">
> +             <entry>V4L2_MBUS_FMT_YCRCB_1X16</entry>
> +             <entry>0x5002</entry>
> +           </row>
> +         </tbody>
> +       </tgroup>
> +       </table>
> +    </section>
>    </section>
>  </section>
Christian Gmeiner July 11, 2011, 9:28 p.m. UTC | #2
Hi Laurent,

2011/7/11 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Hi Christian,
>
> On Sunday 10 July 2011 20:14:21 Christian Gmeiner wrote:
>> Signed-off-by: Christian Gmeiner
>> ---
>> diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
>> b/Documentation/DocBook/media/v4l/subdev-formats.xml
>> index 49c532e..18e30b0 100644
>> --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
>> +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
>> @@ -2565,5 +2565,43 @@
>>         </tgroup>
>>        </table>
>>      </section>
>> +
>> +    <section>
>> +      <title>YCrCb Formats</title>
>> +
>> +      <para>YCbCr represents colors as a combination of three values:
>> +      <itemizedlist>
>> +       <listitem><para>Y - the luminosity (roughly the
>> brightness)</para></listitem>
>> +       <listitem><para>Cb - the chrominance of the blue
>> primary</para></listitem>
>> +       <listitem><para>Cr - the chrominance of the red
>> primary</para></listitem>
>
> How does that differ from YUV ?


I need to say that I am very new to this whole format stuff and so I
am not really sure.
In the data sheet
http://dxr3.sourceforge.net/download/hardware/ADV7175A_6A.pdf there is
on the
first page a FUNCTIONAL BLOCK DIAGRAM which shows that there is a
"YCrCb to YUV Matrix"
stage in the pipeline. I am also fine to use a YUV format for the media bus.
Any suggestions?

Greets,
--
Christian Gmeiner, MSc
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christian Gmeiner July 13, 2011, 6:58 p.m. UTC | #3
2011/7/11 Christian Gmeiner <christian.gmeiner@gmail.com>:
> Hi Laurent,
>
> 2011/7/11 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>> Hi Christian,
>>
>> On Sunday 10 July 2011 20:14:21 Christian Gmeiner wrote:
>>> Signed-off-by: Christian Gmeiner
>>> ---
>>> diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
>>> b/Documentation/DocBook/media/v4l/subdev-formats.xml
>>> index 49c532e..18e30b0 100644
>>> --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
>>> +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
>>> @@ -2565,5 +2565,43 @@
>>>         </tgroup>
>>>        </table>
>>>      </section>
>>> +
>>> +    <section>
>>> +      <title>YCrCb Formats</title>
>>> +
>>> +      <para>YCbCr represents colors as a combination of three values:
>>> +      <itemizedlist>
>>> +       <listitem><para>Y - the luminosity (roughly the
>>> brightness)</para></listitem>
>>> +       <listitem><para>Cb - the chrominance of the blue
>>> primary</para></listitem>
>>> +       <listitem><para>Cr - the chrominance of the red
>>> primary</para></listitem>
>>
>> How does that differ from YUV ?
>
>
> I need to say that I am very new to this whole format stuff and so I
> am not really sure.
> In the data sheet
> http://dxr3.sourceforge.net/download/hardware/ADV7175A_6A.pdf there is
> on the
> first page a FUNCTIONAL BLOCK DIAGRAM which shows that there is a
> "YCrCb to YUV Matrix"
> stage in the pipeline. I am also fine to use a YUV format for the media bus.
> Any suggestions?


Okay I think I have found the difference between YUV and YCrCb - see [1]

YCbCr 4:2:2
(Redirected from YUV 4:2:2)

FourCCs: YUY2, UYVY, YUV2 (Apple Component Video stored in MOV files)
Samples: http://samples.mplayerhq.hu/V-codecs/YUV2/

(These FourCC names only reflect that the YCbCr of digital media is
often falsely mixed up with analog PAL's YUV color space.)

YCbCr 4:2:2 is a packed YCbCr format in which a pair of consecutive
pixels is represented by 1 Y sample each but share a Cb sample and a
Cr sample.

This type of data may be packaged in a container format with a a
FourCC of YUY2 which indicates the following byte formatting:


[1] http://wiki.multimedia.cx/index.php?title=YUV_4:2:2

Greets,
--
Christian Gmeiner, MSc
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart July 14, 2011, 9:45 a.m. UTC | #4
Hi Christian,

On Wednesday 13 July 2011 20:58:12 Christian Gmeiner wrote:
> 2011/7/11 Christian Gmeiner <christian.gmeiner@gmail.com>:
> > 2011/7/11 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> >> On Sunday 10 July 2011 20:14:21 Christian Gmeiner wrote:
> >>> Signed-off-by: Christian Gmeiner
> >>> ---
> >>> diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
> >>> b/Documentation/DocBook/media/v4l/subdev-formats.xml
> >>> index 49c532e..18e30b0 100644
> >>> --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
> >>> +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
> >>> @@ -2565,5 +2565,43 @@
> >>>         </tgroup>
> >>>        </table>
> >>>      </section>
> >>> +
> >>> +    <section>
> >>> +      <title>YCrCb Formats</title>
> >>> +
> >>> +      <para>YCbCr represents colors as a combination of three values:
> >>> +      <itemizedlist>
> >>> +       <listitem><para>Y - the luminosity (roughly the
> >>> brightness)</para></listitem>
> >>> +       <listitem><para>Cb - the chrominance of the blue
> >>> primary</para></listitem>
> >>> +       <listitem><para>Cr - the chrominance of the red
> >>> primary</para></listitem>
> >> 
> >> How does that differ from YUV ?
> > 
> > I need to say that I am very new to this whole format stuff and so I
> > am not really sure.
> > In the data sheet
> > http://dxr3.sourceforge.net/download/hardware/ADV7175A_6A.pdf there is
> > on the
> > first page a FUNCTIONAL BLOCK DIAGRAM which shows that there is a
> > "YCrCb to YUV Matrix"
> > stage in the pipeline. I am also fine to use a YUV format for the media
> > bus. Any suggestions?
> 
> Okay I think I have found the difference between YUV and YCrCb - see [1]
> 
> YCbCr 4:2:2
> (Redirected from YUV 4:2:2)
> 
> FourCCs: YUY2, UYVY, YUV2 (Apple Component Video stored in MOV files)
> Samples: http://samples.mplayerhq.hu/V-codecs/YUV2/
> 
> (These FourCC names only reflect that the YCbCr of digital media is
> often falsely mixed up with analog PAL's YUV color space.)
> 
> YCbCr 4:2:2 is a packed YCbCr format in which a pair of consecutive
> pixels is represented by 1 Y sample each but share a Cb sample and a
> Cr sample.
> 
> This type of data may be packaged in a container format with a a
> FourCC of YUY2 which indicates the following byte formatting:
> 
> 
> [1] http://wiki.multimedia.cx/index.php?title=YUV_4:2:2

According to http://en.wikipedia.org/wiki/Yuv,

"Historically, the terms YUV and Y'UV were used for a specific analog encoding 
of color information in television systems, while YCbCr was used for digital 
encoding of color information suited for video and still-image compression and 
transmission such as MPEG and JPEG. Today, the term YUV is commonly used in 
the computer industry to describe file-formats that are encoded using YCbCr."

V4L2 seems to suffer from the ambiguity, as we use YUV as generic term to mean 
a digital luma/chroma format. I thus think your driver should use the existing 
YUV pixel codes.
diff mbox

Patch

diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 49c532e..18e30b0 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -2565,5 +2565,43 @@ 
        </tgroup>
       </table>
     </section>
+
+    <section>
+      <title>YCrCb Formats</title>
+
+      <para>YCbCr represents colors as a combination of three values:
+      <itemizedlist>
+       <listitem><para>Y - the luminosity (roughly the
brightness)</para></listitem>
+       <listitem><para>Cb - the chrominance of the blue
primary</para></listitem>
+       <listitem><para>Cr - the chrominance of the red
primary</para></listitem>
+      </itemizedlist>
+      </para>
+
+      <para>The following table lists existing YCrCb compressed formats.</para>
+
+      <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-ycrcb">
+       <title>YCrCb Formats</title>
+       <tgroup cols="2">
+         <colspec colname="id" align="left" />
+         <colspec colname="code" align="left"/>
+         <thead>
+           <row>
+             <entry>Identifier</entry>
+             <entry>Code</entry>
+           </row>
+         </thead>
+         <tbody valign="top">
+           <row id="V4L2_MBUS_FMT_YCRCB_1X8">
+             <entry>V4L2_MBUS_FMT_YCRCB_1X8</entry>
+             <entry>0x5001</entry>
+           </row>
+           <row id="V4L2_MBUS_FMT_YCRCB_1X16">
+             <entry>V4L2_MBUS_FMT_YCRCB_1X16</entry>
+             <entry>0x5002</entry>
+           </row>
+         </tbody>
+       </tgroup>
+       </table>