
Philips Semiconductors
Image Co-Processor
File: icp.fm5, modified 7/26/99
PRELIMINARY INFORMATION
13-9
pass mode uses input pixels that are nearest the output
pixel and those nearest each of the four output pixels ad-
jacent to the output pixel. The shift bypass mode also
forces the coefficient RAM inputs to zero, since you are
no longer interpolating between adjacent input pixels.
Using Scaling to Convert From YUV 4:2:0 to YUV 4:2:2
YUV information in the 4:2:0 format has the UV pixels off-
set from the input grid in both X and Y. Also, the U and V
pixels are at 1/2 of the horizontal and 1/2 of the vertical
frequencies of the Y pixels. This means the UV pixels
must be filtered and additionally scaled in both X and Y
in order to line up with the output Y pixels even if no initial
scaling is done. To generate 4:2:2 interspersed data, you
vertically up scale U and V by a factor of 2 with a start off-
set of -1/4 pixel. Upscaling by 2 generates the additional
lines required, and starting with a -1/4 pixel offset (rela-
tive to U, V space) moves the output up to the same line
as the Y pixels. To generate 4:2:2 co-sited, you then filter
horizontally with no scaling factor but with a start offset of
-1/4 pixel, moving the output left 1/4 pixel.
13.5.4
YUV to RGB Conversion
In the ICP, YUV to RGB conversion is done by sequen-
tially processing triplets of Y, U, and V pixel data to con-
vert the pixels to an internal YUV 4:4:4 format and apply-
ing the YUV to RGB conversion algorithm on the YUV
4:4:4 pixels. The results of this conversion normally go to
the PCI bus but can also go back to SDRAM.
YUV to RGB conversion has two steps. First you get the
Y, U and a V pixel data to generate an RGB pixel at the
output. Second, YUV to RGB conversion is done once
the Y, U and V pixels are ready. YUV to RGB conversion
uses the following algorithms:
R
= Y + 1.375(V)= Y + (1 + 3/8)(V)
G
= Y - 0.34375(U) - 0.703125(V)
= Y - (11/32)(U) - (45/64)(V)
B
= Y + 1.734375(U)
= Y + (1 + 47/64)(U)
In CCIR601, the U and V values are offset by +128 by in-
verting the most significant bit of the 8-bit byte. This is the
way the U and V values are stored in SDRAM. The above
algorithms assume that the U and V values are convert-
ed back to normal signed two’s complement values by in-
verting the MSB before being used.
13.5.5
Overlay and Alpha Blending
The ICP has the ability to add an overlay image to the
main image when in the horizontal filter to RGB/YUV
mode with PCI output. The overlay image is a user de-
fined rectangle within the main image. When the overlay
is active, each overlay pixel is combined with each main
image pixel to generate the resulting pixel to be dis-
played. Each pixel combination is controlled by an alpha
value which determines the proportions of overlay and
main image that contribute to the output pixel. The rela-
tion is given by:
Pout = (alpha) * Poverlay + (1-alpha) * Pmain =
(alpha) * (Poverlay-Pmain) + Pmain
where: alpha ranges from 0 to 1
In the ICP, the alpha value range is limited by the hard-
ware to five values: {0.0, 0.25, 0.50, 0.75, 1.0}.
An alpha value is supplied for each overlay pixel. In the
RGB 24+
α overlay data format: the 8-bit alpha value is
contained within the overlay data. In all other overlay
data formats (RGB 15+
α, etc.), an alpha bit in the overlay
data determines the alpha value. The alpha bit selects
between two 8-bit values, alpha 1 and alpha 0, supplied
by a pair of internal ICP registers. These registers are
loaded from the parameter block when the ICP is started.
When the alpha bit is one, alpha 1 value is used as the
alpha value; when the alpha bit is zero, alpha 0 is used
as the alpha value. The two alpha registers allow trans-
lucent images and backgrounds while being restricted to
one bit per pixel for alpha selection.
Alpha blending has several uses.
1. Alpha can be used to disable portions of the overlay,
called keying. When the alpha for a pixel is zero, there
is no overlay. When the alpha is 1, the overlay is
100%, replacing the image. This allows the user to put
an irregular shaped object in an image without show-
ing the bounding rectangle of the overlay.
2. Alpha blending allows translucent (“smoky”) back-
grounds and/or translucent (“ghostly”) overlay images
3. Using alpha at the edges of small images such as font
characters increases their effective visual resolution.
Chroma Keying
The ICP also provides optional chroma keying. It is a re-
stricted form of chroma keying, sometimes called color
keying. When the overlay Y value is zero (an illegal value
in the YUV 4:2:2+
α format) or the RGB values are all
zero (RGB15+
α format), the alpha value is forced to zero
and no overlay or blending occurs. This provides three
levels of overlay: no overlay, alpha zero and alpha one.
This combination can be used to generate an irregularly
shaped menu (an oval shape, for example) which is
translucent (with an alpha value of 50%, for example)
and containing opaque (alpha = 100%) letters. In a
game, this could be a message written on a foggy back-
ground in an oval window. The chroma keying provides
the definition of the oval shape, the alpha zero value de-
fines the translucent foggy background and the alpha
one value defines the opaque characters on the foggy
background.
Chroma keying in the ICP is intended for computer gen-
erated or modified overlays. Chroma keying turns off the
overlay process for selected pixels by forcing an alpha
value of zero for those pixels. Chroma keyed pixels use
special codes to identify them. These codes must be
computer generated in most cases. For example, the
DSPCPU or other CPU would process an overlay image
and convert the overlay pixels to be turned off into chro-
ma keyed pixels by changing the data for those pixels to
the chroma key code.