
TM1100 Preliminary Data Book
Philips Semiconductors
13-6
PRELIMINARY INFORMATION
File: icp.fm5, modified 7/26/99
13.5
ALGORITHMS
13.5.1
Introduction
The ICP provides filtering, resizing (scaling) and YUV to
RGB conversion of the source image. Filtering provides
image enhancement. Scaling generates a new image
that is larger or smaller than the current image. YUV to
RGB conversion is used to generate an RGB version of
the image for output to an RGB format frame buffer
through the PCI interface or to SDRAM.
The filtering, scaling and YUV to RGB conversion algo-
rithms are discussed separately. The ICP uses these al-
gorithms in two ways.
1. It provides one pass horizontal scaling with horizontal
5-tap ltering of Y, U, or V.
2. It provides one pass vertical scaling with vertical 5-tap
ltering of Y, U, or V.
13.5.2
Filtering
The ICP provides high quality, 5-tap polyphase filtering,
both horizontal and vertical. Horizontal and vertical filter-
ing are done in separate passes as one dimensional fil-
ters. Two dimensional filtering of the image requires two
passes of the one dimensional filters.
Multi-tap FIR Filtering
In multi-tap FIR filtering of an image, the new filter output
(pixel) value is a weighted sum of adjacent pixels. The
weighting coefficients determine the type of filtering
used. A 5-tap filter generates the new pixel value as a
weighted sum of the current value and the two pixels on
either side (2 left and 2 right for horizontal filtering, 2
above and 2 below for vertical).
A multi-tap FIR filter can be used to generate values for
new pixels that are displaced from the original (“center”)
pixel in the same way as linear interpolation. Assuming
the new pixel location is shifted slightly to the right of the
center pixel of the input image. Then a horizontal filter
can be used to estimate the new pixel value by weighting
the right pixel filter coefficients more heavily than the left,
proportional to the relative position offset of the new pix-
el. (In this sense, interpolation is a 2-tap filter.) This is
shown in
Figure 13-7. The ICP horizontal and vertical fil-
ter operations use this method to combine scaling with
filtering.
Mirroring Pixels at the Start and End of a Line or Window
A line may start and/or end at the edge of the input im-
age. In this case, the two start and/or end pixels needed
for the first and last pixels of the line, respectively, are
missing. The ICP uses pixel mirroring to solve this prob-
lem. In pixel mirroring, the two available pixels are used
to substitute the two missing pixels. The first pixel, uses
copies of the two pixels to the right as though they were
the two pixels to the left. Specifically, P+2 substitutes for
P-2, and P+1 substitutes for P-1. The last pixel, uses
copies of the two pixels to the left as though they were
the two pixels to the right. Since the left and right pixels
are now the same, this is called pixel mirroring.
There are five states of pixel mirroring: first output pixel,
second output pixel, middle pixels, next to last output pix-
el and last output pixel. The first output pixel uses pixels
numbered (2,1,0,1,2). The second pixel uses (1,0,1,2,3).
The middle pixels use (P-2, P-1, P, P+1, P+2). The next
to last pixel uses (N-3, N-2, N-1,N, N-1), where N is the
number of the last input pixel. The last pixel uses (N-2,
N-1, N, N-1, N-2).
In some cases of upscaling, one more input pixel may be
needed at the end of the line. That cannot be generated
by the mirror logic. In this case, the ICP uses a copy of
the last output pixel as the best estimate of the required
output pixel. The mirroring logic which detects the last
pixels in the input line also detects this case, and it cre-
ates copies of the last pixel generated by preventing any
further scaling action (data shifting and scaling counter
incrementing) once the end of the input line has been
reached.
13.5.3
Scaling
Scaling Overview
Resizing, or scaling the image means generating a new
image that is larger or smaller than the original. The new
image will have a larger or smaller number of pixels in the
horizontal and/or vertical directions than the original im-
age. A larger image is scaling up (more new pixels); a
smaller image is scaling down (fewer newer pixels). A
simple case is a 2:1 increase or decrease in size. A 2:1
decrease could be done by throwing away every other
pixel (although this simple method results in poor image
quality). A 2:1 increase is more interesting. The new pix-
els can be generated in between the old ones by:
Input Pixels
Output Pixels
Filter (uses 5 input pixels)
Interpolation (uses 2 input pixels)
Figure 13-7. Pixel Generation by Interpolation and Filtering