[GEM-dev] Fwd: another videoDV4L bug

IOhannes m zmoelnig zmoelnig at iem.at
Mon Mar 19 17:11:36 CET 2007


Mathieu Bouchard wrote:
> On Mon, 19 Mar 2007, IOhannes m zmoelnig wrote:
>> Ivica Ico Bukvic wrote:
>>> After
>>> m_image.image.fromYVYU(decodedbuf);
>>> I added
>>> m_image.image.swapRedBlue();
>> unfortunately it is mostly not that simple (e.g. my philips-toUcam
>> (driver) somehow presents data with red and blue swapped when accessed
>> via V4L; i cannot just add swapRedBlue() to the code, since then all
>> other devices will have red and blue swapped (and they would even need
>> cpu power for getting the wrong colors).
> 
> IMHO, if you get swapped red and blue, then it's possible that it's
> actually U and V that are swapped, so you should replace this by a
> fromYUYV() or prepend fromYUYV() using a swapUV() and check whether the
> output looks better than swapRedBlue().
> 
> This is because 0.75*U = B-Y whereas 0.40*V = R-Y, and those two
> constants differ, so confusing U and V and then swapping reds and blues
> will cause reds to appear brighter and blues to appear dimmer, than if
> just U and V were swapped.
> 

yes, you are basically right.
nevertheless, it is still unclear to me, how to detect correctly whether
to use YUYV or YVYU

fmga.sdr
IOhannes




More information about the GEM-dev mailing list