
Philips Semiconductors
Image Co-Processor
File: icp.fm5, modified 7/26/99
PRELIMINARY INFORMATION
13-23
they must be 16-bit, two’s complement integer values.
(Note that this allows negative offsets. You can use this
to flip an image vertically.)
The input and output image height and width values are
the height in lines and width in pixels per line for their re-
spective images. The height and width are 16-bit positive
binary numbers between 0 and 64K-1.
The Integer increment and Fraction increment values are
the scaling parameters. The Integer value is a 16-bit in-
teger, and the Fraction value is a positive binary fraction
between 0 and 0.99999+. For up scaling (output image
bigger), the increment value is the inverse of the scaling
value. If you are upscaling by a factor of 2.5, the incre-
ment value will be the inverse of 2.50 = 0.40. The Integer
increment value will be 0 and the Fraction increment val-
ue will be 0.40. For down scaling, the increment value is
equal to the scaling value. If you are down scaling by 2.5
(output image smaller), the Integer increment value will
be 2, and the Fraction increment value will be 0.500.
To perform scaling, the Integer and Fractional increment
values must be generated and placed in the parameter
table. The simplest way to generate these values in com-
mon computer languages such as C is as follows:
1. Generate the Increment Value as a oating point
number = Input Width / Output Width
2. Multiply the Increment Value by 65536
3. Convert the result to a Long Integer (32 bits). The up-
per 16 bits of the Long integer will be the Integer in-
crement value, and the lower 16 bits will be the Frac-
tional value.
4. Store the 32-bit Long integer in the parameter table as
the combined Integer and Fractional increment val-
ues.
The Start Fraction defines the starting value in the scal-
ing counter for each line. It is a 16-bit, two’s complement
fractional value between -0.500 and 0.49999+. The Start
Fraction allows the input data to be offset by up to half a
pixel, referred to the input pixel grid. It is zero for Y and
for UV co-sited data, and is set to minus 0.25 (C000h) for
interspersed to co-sited conversion of U and V data. The
minus 0.25 value effectively shifts the U and V data to-
ward the start of the line by 1/4 pixel, the amount required
for conversion.
13.6.8.3
Control Word Format
The Control word provides bit fields which affect the hor-
izontal filtering operation. The format of the Control word
is as follows.
Bit
Name
Function
15
Bypass
Bypass lter. Picks nearest input pixel
and passes it to output unltered.
When Bypass is set & scale factor is
1.0, this results in an image block
move
9
GETB
Large down scaling bit. Picks nearest
input pixels and then passes them to
lter.
Equivalent to bypass + 5-tap lter of
output pixels. LSB value = 0 for lter-
ing.
The Bypass bit causes the data to bypass the 5-tap filter.
The scaling operation selects the center pixel, and this
pixel is passed to the filter output. No filtering or interpo-
lation is provided. If the scaling factor is 1.0, the result is
an image block move where the image is moved from
one part of SDRAM to another without modification. If the
scaling factor is other than 1.0, the effective algorithm is
pixel picking, where the input pixel nearest the output
pixel location is used as the output pixel.
The GETB bit is an optional bit for large (> 4) down scal-
ing. When GETB is zero (normal operation), the 5-tap fil-
ter receives the pixel nearest the output pixel as its cen-
ter pixel plus the two adjacent input pixels on either side
of this pixel to form the five filter inputs. When GETB is
set, the filter receives the pixel nearest the output pixel
as its center pixel plus the two pixels nearest the adja-
cent output pixels on either side of this pixel to form the
five filter inputs. The effective algorithm is pixel picking
plus 5-tap filtering of the result. GETB also forces the
scaling LSB value to zero, since output pixels are being
Table 13-13. Horizontal Filter Parameter Table
Parameter Word
Description
Upper 2 bytes
Lower 2 bytes
Input Image Start Address
Start address of X0Y0 (byte address)
Y Counter
Start Fraction
Input Image
Line Offset
Starting value: may be 0.5, etc. for interspersed convert;
Line offset from X0Y0 to X0Y1
Fraction increment
Integer increment
Increment value for Y = 1/scale factor
Input Image Height
Input Image Width
Height and width in input lines and pixels
Output Image Start Address
Start address of X0Y0 (byte address)
Control
Output Image
Line Offset
Control bits; Line offset from X0Y0 to X0Y1
Output Image Height
Output Image Width
Height and width in output lines and pixels