Edge-adaptive scaling algorithm, Edge-adaptive scaling algorithm -8 – Altera Video and Image Processing Suite User Manual

Page 229

Advertising
background image

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].
The bicubic method does not use the preceding steps, but instead obtains weights for each of the four taps

to sample a cubic function that runs between tap 1 and tap 2 at a position equal to the phase variable

described previously. Consequently, the bicubic coefficients are good for up scaling, but not for down

scaling.
If the coefficients are symmetric and provided at compile time, then only half the number of phases are

stored. For N taps and P phases, an array, C[P][N], of quantized coefficients is symmetric if for all

and

.

That is, phase 1 is phase P–1 with the taps in reverse order, phase 2 is phase P–2 reversed, and so on.
The predefined Lanczos and bicubic coefficient sets satisfy this property. If you select Symmetric for a

coefficients set in the Scaler II IP core parameter editor, the coefficients will be forced to be symmetric.

Edge-Adaptive Scaling Algorithm

The edge-adaptive scaling algorithm is almost identical to the polyphase algorithm. It has extensions to

detect edges in the input video and uses a different set of scaling coefficients to generate output pixels that

lie on detected edges.
In the edge-adaptive mode, each bank of scaling coefficients inside the IP core consists of the following

two full coefficient sets:
• A set for pixels that do not lie on the edge—allows you to select a coefficient set with a softer frequency

response for the non-edge pixels.

• A set for pixels that lie on the edges—allows you to select a coefficient set with a harsher frequency

response for the edge pixels.

These options potentially offer you a more favorable trade-off between blurring and ringing around edges.

The Scaler II requires you to select the option to load coefficients at runtime to use the edge-adaptive

mode; the core does not support fixed coefficients set at compile time.
Note: Altera recommends that you use Lanczos-2 coefficients for the non-edge coefficients and

Lanczos-3 or Lanczos-4 for the edge coefficients.

The Scaler II IP core offers the option to add a post-scaling edge-adaptive sharpening filter to the

datapath. You may select this option in any scaling mode, with the exception of the nearest neighbor

mode.

17-8

Edge-Adaptive Scaling Algorithm

UG-VIPSUITE

2015.05.04

Altera Corporation

Scaler II IP Core

Send Feedback

Advertising