Philips Semiconductors
Image Co-Processor
File: icp.fm5, modified 7/26/99
PRELIMINARY INFORMATION
13-11
LSBs of the R input value before truncation, and the RGB
formatter truncates the result after adding.
13.5.7
Implementation Overview: Horizontal
Scaling and Filtering
horizontal scaling algorithm implementation. Blocks of
pixels are provided by the input block buffer. Each block
of pixels is transferred sequentially to the 5-tap filter. The
filter does scaling and filtering of the data and puts the re-
sulting pixels in the output buffer. Completed pixels in the
output buffer are written back to SDRAM or to the PCI
output. A bypass multiplexer allows to bypass the filter
for SDRAM to SDRAM block moves.
Input pixel access is controlled by the Y Counter. The Y
Counter selects the word and byte for the current pixel in
the Y FIFO buffer. The Y Increment register, Y LSB Reg-
ister and the Y MSB Counter control the increment of the
Y Counter. If the Y MSB Counter contents are not zero,
the Y Counter is incremented and the Y MSB register is
decremented until the Y MSB Counter is zero.
The Y MSB Counter is loaded with the integer portion of
the results of the Y Counter Increment operation. Y
Counter Increment means adding the Y Increment frac-
tion and integer values to the Y LSB register and Y MSB
Counter, respectively. If there is no scaling (scaling fac-
tor = 1.0), the Y Increment integer value will be 1, and the
Y Increment fractional value will be 0. Each Y Counter
Increment operation will increment the Y Counter by one
in this case.
The Y Counter sequentially reads out horizontally in-
dexed pixels to the filter. The Y Counter is incremented
once (1.0 for no scaling) for each pixel. For a line of pix-
els beginning with Xa and ending with Xb, the Y Counter
reads pixels from the block buffer beginning with Xa-2
and ending with Xb+2. The extra pixels are required by
the 5-tap filter, which uses a total of 5 pixels to generate
each output pixel, two pixels before and two pixels after
each pixel. The horizontal filter uses the current output
from the block buffer and four delayed versions of it to
generate the filter output as the weighted sum of the cen-
ter pixel plus the two on either side. (For the case where
the scaling factor = 1.0, the LSBs are always zero.)
For up or down scaling, the Y Increment value is not 1.0,
factor of 2.0, the effective Y increment value is 0.5, for
example. This means you generate two output pixels for
each input pixel. The Y Counter effectively increments as
0.0, 0.5, 1.0, 1.5, 2.0, etc. The LSBs of the counter (i.e.
the fractional part less than 1) in the Y LSB register are
used by to the filter to generate the intermediate values.
An LSB value of 0.5 means that the output pixel is half
way between Xn and Xn+1. The filter contains a set of 5
filter parameter RAMs, one for each coefficient. The 5
most significant LSBs from the counter select the filter
coefficients which will generate the correct value for the
SDRAM
T
o
SDRAM
Y MSB Cntr
Pixel Clock
5 Stage Multipli-
er-Accumulator
Y LSBs
Reg
Pix
el
Data
a
+2
RAM
a
+1
RAM
a
+0
RAM
a
-1
RAM
a
-2
RAM
Z Counter
Mux
Bypass
SDRAM
Address
Block
Y Counter
Y Incr Fraction
Y LSB Reg
Carry Out
Filter Source Select
5-tap Filter
YUV Code Delay
Y Incr Integer
N Byte Incr
Figure 13-11. ICP Horizontal Scaling Data Flow Block Diagram
Output
Buffers 6,7
Block FIFO
Buffers 0,1
Block FIFO
via
highway
via
highw
a
y