11.07.2015 Views

Xilinx pg013 LogiCORE IP RGB to YCrCb Color-Space Converter v5 ...

Xilinx pg013 LogiCORE IP RGB to YCrCb Color-Space Converter v5 ...

Xilinx pg013 LogiCORE IP RGB to YCrCb Color-Space Converter v5 ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Color</strong>-<strong>Space</strong> Conversion BackgroundYR – YB – Y=CA 1 – CA – CB CB1 – CA CA + CB – 1 – CB– CA CA + CB – 1 1 – CB<strong>RGB</strong>Equation 4-2Coefficients CA and CB are chosen between 0 and 1, which guarantees that the range of Yis constrained between the maximum and minimum <strong>RGB</strong> values permitted, <strong>RGB</strong> max and<strong>RGB</strong> min respectively.The minimum and maximum values of R-Y are:min R-Y = <strong>RGB</strong> min – (CA*<strong>RGB</strong> min + (1- CA- CB)*<strong>RGB</strong> max + CB*<strong>RGB</strong> max ) = (CA-1) * (<strong>RGB</strong> max -<strong>RGB</strong> min )max R-Y = <strong>RGB</strong> max – (CA*<strong>RGB</strong> max + (1- CA- CB)*<strong>RGB</strong> min + CB*<strong>RGB</strong> min ) = (1-CA) * (<strong>RGB</strong> max -<strong>RGB</strong> min )Thus, the range of R-Y is:2( CA – 1) ( <strong>RGB</strong> max – <strong>RGB</strong> min )Equation 4-3Similarly, the minimum and maximum values of B-Y are:min B-Y =<strong>RGB</strong> min -(CA*<strong>RGB</strong> max +(1-CA-CB)<strong>RGB</strong> max +CB*<strong>RGB</strong> min )=(CB-1)(<strong>RGB</strong> max -<strong>RGB</strong> min )maxB-Y=<strong>RGB</strong> max -(CA*<strong>RGB</strong> min +(1-CA-CB)<strong>RGB</strong> min +CB*<strong>RGB</strong> max )=(1-CB)(<strong>RGB</strong> max -<strong>RGB</strong> min )Thus, the range of B-Y is:2( CB – 1) ( <strong>RGB</strong> max – <strong>RGB</strong> min )Equation 4-4In most practical implementations, the range of the luminance and chrominancecomponents should be equal. There are two ways <strong>to</strong> accomplish this: chrominancecomponents (B-Y and R-Y) can be normalized (compressed and offset compensated), orvalues above and below the luminance range can be clipped.Both clipping and dynamic range compression result in loss of information; however, theintroduced artifacts are different. To leverage differences in the input (<strong>RGB</strong>) range, differentstandards choose different trade-offs between clipping and normalization.The <strong>RGB</strong> <strong>to</strong> <strong>YCrCb</strong> color space conversion core facilitates both range compression andoptional clipping and clamping. Range, offset, clipping and clamping levels areparameterizable. The core supports conversions that fit the following general form:Y CA 1 – CA – CB CBC R = CC( 1 – CA) CC( CA + CB – 1) CC( – CB)C B CD( – CA) CD( CA + CB – 1) CD( 1 – CB)<strong>RGB</strong>+O YO CrO CbEquation 4-5<strong>RGB</strong> <strong>to</strong> <strong>YCrCb</strong> <strong>Color</strong>-<strong>Space</strong> <strong>Converter</strong> www.xilinx.com 34PG013 April 24, 2012

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!