Polyphase algorithmic description, Choosing and loading coefficients, Polyphase algorithmic description -6 – Altera Video and Image Processing Suite User Manual

Page 227: Choosing and loading coefficients -6

Advertising
background image

Polyphase Algorithmic Description

The algorithmic operations of the polyphase scaler can be modeled using a frame-based method.
The filtering part of the polyphase scaler works by passing a windowed sinc function over the input data.
• For up scaling, this function performs interpolation.

• For down scaling, it acts as a low-pass filter to remove high-frequency data that would cause aliasing in

the smaller output image.

During the filtering process, the mid-point of the sinc function must be at the mid-point of the pixel to

output. This is achieved by applying a phase shift to the filtering function.
If a polyphase filter has N

v

vertical taps and N

h

horizontal taps, the filter is a N

v

×N

h

square filter.

Counting the coordinate space of the filter from the top-left corner, (0, 0), the mid-point of the filter lies

at ((N

v

–1)/2, (N

h

–1)/2). As in the bilinear case, to produce an output pixel at (i, j), the mid-point of the

kernel is placed at

where in

i

and in

j

are calculated using the algorithmic description equations.

The difference between the real and integer solutions to these equations determines the position of the

filter function during scaling.
The filter function is positioned over the real solution by adjusting the function’s phase:

The results of the vertical filtering are then found by taking the set of coefficients from phase

j

and

applying them to each column in the square filter. Each of these N

h

results is then divided down to fit in

the number of bits chosen for the horizontal kernel. The horizontal kernel is applied to the coefficients

from phase

i

, to produce a single value. This value is then divided down to the output bit width before

being written out as a result.

Choosing and Loading Coefficients

The filter coefficients, which the polyphase mode of the scaler uses, may be specified at compile time or at

run time.
At compile time, you can select the coefficients from a set of Lanczos-windowed sinc functions, or loaded

from a comma-separated variable (CSV) file.
At run time, you specify the coefficients by writing to the Avalon-MM slave control port.
When the coefficients are read at run time, they are checked once per frame and double-buffered so that

they can be updated as the IP core processes active data without causing corruption.

17-6

Polyphase Algorithmic Description

UG-VIPSUITE

2015.05.04

Altera Corporation

Scaler II IP Core

Send Feedback

Advertising