
Philips Semiconductors
Image Co-Processor
File: icp.fm5, modified 7/26/99
PRELIMINARY INFORMATION
13-7
1. Duplicating the original pixels
2. Linear interpolation, where the new in-between pixels
are the weighted average of the adjacent input pixels
3. Multi-tap ltering, where the new in-between pixels
are multi-pixel ltered version of the adjacent input
pixels. This approach results in the best image.
The more general case is where the output image is not
an integral multiple of sub-multiple of the input image,
such as converting from 640 x 480 to 1024 x 768. In this
case, the output pixels have differing positions relative to
the input pixels as you move in the horizontal or vertical
dimensions. In converting from 640 to 1024, the first out-
put pixel on a line corresponds to the first input pixel. The
second output pixel is at 640/1024 of the distance be-
tween the first and second input pixels. The third output
pixel is at (2*640)/1024 of the distance = 1280/1024 = 1+
256/1024 = 256/1024 of the distance between the sec-
ond and third input pixels, etc. The output pixels shift with
respect to the input pixel grid as you move along the line
in the horizontal or vertical dimensions. This is shown in
New pixels are generated by interpolation or filtering of
the original pixels. Interpolation is the weighted average
of the input pixels adjacent to the output pixel. Filtering
extends interpolation to include input pixels beyond the
input pair adjacent to the output pixel. The number of pix-
els used to generate the output defines the filter type. In-
terpolation is a 2-tap filter. A 4-tap filter would use the two
pixels to the left and the two pixels to the right of the out-
put pixel. A 5-tap filter identifies the single pixel nearest
the output as the center pixel, and uses this pixel plus
two to the left and two to the right to generate the output.
If the ratio of the output pixel count per line (in H or V) to
input pixel count per line is the ratio of small integers, you
have a repeating pattern in these relative positions of in-
put to output pixel locations. For 640 to 1024, the ratio is
8/5. The pattern repeats for every 8 output and every 5
input pixels. If the ratio is not a ratio of small integers, the
pattern will take a long time to repeat. The worst case
would be 640 to 641, for example. There would be no ex-
act repetition for the whole line.
The interpolator or filter coefficients must be weighted
according to the relative position of the new pixel relative
to the old pixels. The weighting factor is between 0.0 and
1.0, corresponding to the relative position of the new pix-
el with respect to the old pixel grid. With a repeating pat-
tern, fewer weighting factors are needed, and therefore
fewer coefficients in the linear interpolator or filter gener-
ating the new pixels, since you can reuse them each time
the pattern repeats. A filter with a repeating pattern is
called polyphase, indicating a repeating pattern in the
phase (offset position) of the output pixels relative to the
input pixels.
Generating the Output Pixels: Relating the Output Grid to
the Input Grid
Scaling is a pixel transformation. You generate an array
output pixels from an array of input pixels. The value of
each pixel on the output pixel grid is calculated from the
values of its adjacent pixels on the input grid. To find
these adjacent pixels, you overlay the output grid on the
input grid and align the starting pixels, X0Y0, of the two
grids. To identify the adjacent input pixels for a given out-
put pixel, you divide the output pixel X (pixel number
along the output line) and Y (pixel line number within win-
dow) by their corresponding scaling factors:
Xin = Xout / (Horizontal Scaling Factor)
where: Horizontal Scaling Factor =
Output Length / Input Length
Yin = Yout / (Vertical Scaling Factor)
where: Vertical Scaling Factor =
Output Height / Input Height
Note that the resulting Xin and Yin values will be real
numbers, integers plus fractions. This is because the
output pixels will usually fall between the input pixels.
The fractional value indicates the fractional distance to
the next pixel. To calculate the output pixel value, you
use the value for the nearest pixel to the left and above
and combine it with the value of the other adjacent pix-
el(s). For example, horizontal interpolation uses the
starting pixel to the left interpolated with the next pixel to
the right, with the fractional value used to determine the
weighting for the interpolation.
ICP Scaling Output Resolution
In the ICP, scaling is forced to have a repeating pattern
by limiting the resolution of the new pixel position to 1/32;
the new position is forced to be at a location n/32 in H
and V relative to the position of the original pixel grid.
This results in a worst case error of approximately 1.5%
in amplitude relative to calculations using exact output
pixel positions. This is comparable to the errors caused
by quantizing the amplitude of the pixels. The additional
quantization noise can be avoided by choosing an appro-
priate scale factor which, when inverted, results in frac-
tional values which are expressed in 32nd’s, such as the
8/5 scaling factor in the 640 to 1024 example above. A
1
2
3451
1
8
7
6
5
4
3
2
1
Input Pixels
Output Pixels
Figure 13-8. 640 to 1024 Upscaling Example