Re: API.html bug? (VIDEO_PALETTE YUV names again)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Ben Bridgwater wrote:
> 
> FUKUCHI Kentarou wrote:
> >
> > Hi all,
> >
> > V4L Kernel API reference (/usr/src/linux/Documentation/video4linux/API.html)
> > claims that VIDEO_PALETTE_YUV422 is a format that packs YUV values into 8 bits.
> > But bttv-driver maps YUV422 to BT848_COLOR_FMT_YUY2, and thats format is
> > different from the description of API reference.
> >
> > Why? In which way should I implement v4l driver?
> 
> IMO you should follow bttv to avoid breaking applications, but we should
> deprecate the bad V4L_PALETTE names (the two below) and replace them
> with correct ones.
> 
> There are two packed YUV formats whose V4L names are wrong:
> 
> VIDEO_PALETTE_YUV422 --> bttv YUY2
> VIDEO_PALETTE_YUYV   --> bttv Y41P
> 
> VIDEO_PALETTE_YUV422 as a name is ambiguous as there are many possible
> 4:2:2 planar Y,U.V component orderings (and of course they're all 16
> bpp, as 4:2:2 implies). YUY2 is only one of the possible 4:2:2 formats
> (which, adding to the confusion, has component order Y,U,Y,V!),
> 
> VIDEO_PALETTE_YUYV as a mapping to Y41P is obviously wrong, but that's
> the way bttv has always been, and AFAIK this is a Bt848 only mode anyway
> (although other drivers could create it in software, I guess).
> 
> So... I'd recomment you follow bttv, but that we should also introduce
> synonyms VIDEO_PALETTE_YUY2 and VIDEO_PALETTE_Y41P and deprecate the old
> names. I believe V4L2 already uses these names (or at least
> non-ambiguous ones that make sense).
> 
> Ben

Alan, would you accept this as a patch for videodev.h ?

--- videodev.h  Sat May 12 21:57:26 2001
+++ videodev-new.h      Sat May 26 10:49:06 2001
@@ -126,6 +126,8 @@
 #define VIDEO_PALETTE_RGB32    5       /* 32bit RGB */ 
 #define VIDEO_PALETTE_RGB555   6       /* 555 15bit RGB */
-#define VIDEO_PALETTE_YUV422   7       /* YUV422 capture */
-#define VIDEO_PALETTE_YUYV     8
+#define VIDEO_PALETTE_YUY2     7       /* 4:2:2 YUYV */
+#define VIDEO_PALETTE_YUV422   VIDEO_PALETTE_YUY2 /* deprecated */
+#define VIDEO_PALETTE_Y41P     8       /* 4:1:1 UYVYUYVYYYYY */
+#define VIDEO_PALETTE_YUYV     VIDEO_PALETTE_Y41P /* deprecated */
 #define VIDEO_PALETTE_UYVY     9       /* The great thing about
standards is ... */
 #define VIDEO_PALETTE_YUV420   10

Ben





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux