User guide

Table Of Contents
Chapter 21: Scaler MegaCore Function 21–7
Functional Description
January 2013 Altera Corporation Video and Image Processing Suite
User Guide
1 The two lobes refer to the number of times the function changes direction on each side
of the central maxima, including the maxima itself.
The class of Lanczos N functions is defined as:
As can be seen in the figure, phase 0 centers the function over tap 1 on the x-axis. By
the equation above, this is the central tap of the filter. Further phases move the mid-
point of the function in 1/P
v
increments towards tap 2. The filtering coefficients
applied in a 4-tap scaler for a particular phase are samples of where the function with
that phase crosses 0, 1, 2, 3 on the x-axis. The preset filtering functions are always
spread over the number of taps given. For example, Lanczos 2 is defined over the
range –2 to +2, but with 8 taps the coefficients are shifted and spread to cover 0 to 7.
Compile-time custom coefficients are loaded from a CSV file. One CSV file is specified
for vertical coefficients and one for horizontal coefficients. For N taps and P phases,
the file must contain N × P values. The values must be listed as N taps in order for
phase 0, N taps for phase 1, up to the Nth tap of the Pth phase. You are not required to
present these values with each phase on a separate line.
The values must be pre-quantized in the range implied by the number of integer,
fraction and sign bits specified in the parameter editor, and have their fraction part
multiplied out. The sum of any two coefficients in the same phase must also be in the
declared range. For example, if there is 1 integer bit, 7 fraction bits, and a sign bit, each
value and the sum of any two values must be in the range [–256, 255] representing the
range [-2, 1.9921875].
Figure 21–2. Lanczos 2 Function at Various Phases
LanczosN x
1
0
xsin
x
--------------------
xNsin
xN
----------------------------
=
x 0=
x 0 xN
xN
0123
−0.2
0
0.2
0.4
0.6
0.8
1
1.2
phase(0)
phase(P
v
/2)
phase(P
v
−1)