Gerd Knorr wrote: > I came across another video format issue these days due to > a bug report: > Which order have the color planes for planar yuv formats? Is > it Y-Cb-Cr or Y-Cr-Cb? > > Nearly everybody seems to use Y-Cb-Cr. Both bttv 0.7.x / 0.8.x > write Cb first. Libjpeg expects the planes in Y-Cb-Cr order, and > looks like the same is true for pretty much all software which > uses planar yuv. > > But http://www.thedirks.org/v4l2/v4l2fmt.htm lists the planes for > all planar yuv formats in Y-Cr-Cb order. [...] > > Is the Y-Cr-Cb order in v4l2fmt.htm just a mistake or was this > done intentionally? It is not a mistake. These formats are based on common Windows VfW formats, which put Cr (V) plane before Cb (U) plane (for what reason I don't know). V4L2_PIX_FMT_YVU420 is equivalent to YV12, and V4L2_PIX_FMT_YVU410 is equivalent to YVU9 (a.k.a. Indeo Raw). When I worked on Windows capture drivers, these were the only planar YUV formats that the driver ever needed to support. > To me it looks like a mistake, because it also contradicts the > code in v4l1-compat.c which simply maps the v4l1 names to the > v4l2 ones. And the v4l1 formats have Y-Cb-Cr order Then this is the mistake. We need Y-Cb-Cr order versions of the formats, e.g. V4L2_PIX_FMT_YUV420, _YUV410, etc. Bill.