Browse Prior Art Database

Integrated YUV to Red Green Blue Conversion

IP.com Disclosure Number: IPCOM000112449D
Original Publication Date: 1994-May-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 4 page(s) / 131K

Publishing Venue

IBM

Related People

Narayanaswami, C: AUTHOR [+3]

Abstract

One of the important components of Joint Photographic Experts Group (JPEG) decompression is the conversion of colors in the YUV (luminance and chrominance) format to the Red Green Blue (RGB) format. The YUV format is the output of the Inverse Discrete Cosine Transform (IDCT) phase of JPEG decompression.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 36% of the total text.

Integrated YUV to Red Green Blue Conversion

      One of the important components of Joint Photographic Experts
Group (JPEG) decompression is the conversion of colors in the YUV
(luminance and chrominance) format to the Red Green Blue (RGB)
format.  The YUV format is the output of the Inverse Discrete Cosine
Transform (IDCT) phase of JPEG decompression.

      The YUV format is used because better compression ratios are
achievable with that color space.  However, the final input for the
graphics device displaying the image is integer RGB.  Therefore,
there is a need to be able to convert quickly from the YUV color
space to the RGB color space.

2.  CONVERSION EQUATIONS

The following are the steps in the conversion:

      Note: In this document, the subscript "f" will be used for
floating point entities and the subscript "i" will be used to refer
to integer entities.

 2.1 Floating YUV to Floating RGB Conversion

      In the worst case, this phase of the YUV to RGB conversion is
as simple as a 3 X 3 matrix multiplication.  However, a complete
matrix multiplication is often not necessary and the following is
sufficient.

                  R sub f = Y sub f + aV sub f
                  G sub f = Y sub f - b sub f U sub f - c sub f V sub
f
                  B sub f = Y sub f + d sub f U sub f

      The coefficients in the above equation are all positive.  The
above computations are very simple and run very fast on the RISC
System/6000* architecture.

 2.2 Floating RGB to Integer RGB Conversion
                  R sub i = (int) R sub f
                  G sub i = (int) G sub f
                  B sub i = (int) B sub f

      The above conversion is very costly on the RISC System/6000
architecture and takes about 12 cycles with optimized code.

 2.3 Clamping Integer RGB

      The integer RGB data computed in the above step has to be
clamped to the range representable on the display.  One would expect
that if the input is valid there would be no need to perform this
clamping.  However this is not true in this case, i.e., the YUV data
could be perfectly valid and still cause the RGB values to go out of
bounds.  So in order to obtain the correct image the following
clamping has to be performed.  We will assume that we are using a 24
bit device and so the maximum for each color component is 255.
           R sub <display> = left lbrace 0 rabove 255 rabove R sub i
if above if rabove      R sub i above R sub i above
  lt above gt above      0 above 255 above
               otherwise
            G sub <display> = left lbrace 0 rabove 255 rabove G sub i
if above if rabove     G sub i above G sub i above
  lt above gt above      0 above 255 above
               otherwise

            B sub <display> = left lbrace 0 rabove 255 rabove B sub...