Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Video and Image Processing Suite User Guide Avalon st video.pdf
Скачиваний:
81
Добавлен:
11.06.2015
Размер:
2.64 Mб
Скачать

17-8

Edge-Adaptive Scaling Algorithm

UG-VIPSUITE

2015.01.23

 

 

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.

Altera Corporation

Scaler II IP Core

 

 

Send Feedback

UG-VIPSUITE 2015.01.23

Scaler II Parameter Settings

17-9

The sharpening filter is primarily for downscale, but you may also use it with upscale. You may enable or disable this functionality at runtime.

The edge-adaptive sharpening filter attempts to detect blurred edge in the scaling video stream, and applies a sharpening filter where blurred edges are detected.

The areas that are not detected as blurred edges are left unaltered.

The blurred edge detection uses upper and lower blur thresholds, which you may alter at compile time or runtime.

The sharpening engine detects a blurred edge where the difference between neighboring pixels falls between the upper and lower blur thresholds.

As with the edge threshold for the edge-adaptive scaling, the upper and lower blur threshold values are specified per color plane.

Note: Altera does not recommend you to use this option with nearest-neighbor algorithm because it is of little or no benefit.

Scaler II Parameter Settings

Table 17-2: Scaler II Parameter Settings

 

Parameter

 

Value

 

Description

 

 

 

 

 

 

 

 

 

 

Bits per symbol

 

4–20, Default = 10

 

Select the number of bits per color plane.

 

 

 

 

 

 

 

 

Symbols in parallel

 

1–4, Default = 2

 

Select the number of color planes sent in

 

 

 

 

 

 

parallel.

 

 

Symbols in sequence

 

1–4, Default = 1

 

Select the number of color planes that are

 

 

 

 

 

 

sent in sequence.

 

 

 

 

 

 

 

 

Enable run-time control of

 

On or Off

 

Turn on to enable run-time control of the

 

 

input/output frame size

 

 

 

image size. If you do not turn on this option,

 

 

 

 

 

 

the Scaler II IP core does not respond to the

 

 

 

 

 

 

resolution changes in control packets; and the

 

 

 

 

 

 

input and output resolutions are set to the

 

 

 

 

 

 

maximum values you specify.

 

 

Maximum input frame width

 

32–2600, Default =

 

Select the maximum width for the input

 

 

 

 

1920

 

frames (in pixels).

 

 

 

 

 

 

 

 

Maximum input frame height

 

32–2600, Default =

 

Select the maximum height for the input

 

 

 

 

1080

 

frames (in pixels).

 

 

Maximum output frame width

 

32–2600, Default =

 

Select the maximum width for the output

 

 

 

 

1920

 

frames (in pixels).

 

 

 

 

 

 

 

 

Maximum output frame height

 

32–2600, Default =

 

Select the maximum height for the output

 

 

 

 

1080

 

frames (in pixels).

 

 

4:2:2 video data

 

On or Off

 

• Turn on to use the 4:2:2 data format.

 

 

 

 

 

 

• Turn off to use the 4:4:4 video format.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Scaler II IP Core

 

 

 

 

Altera Corporation

 

Send Feedback

 

 

 

 

 

 

17-10

Scaler II Parameter Settings

 

 

 

 

UG-VIPSUITE

 

 

 

2015.01.23

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Parameter

 

 

Value

 

Description

 

 

 

 

 

 

 

 

 

 

 

No blanking in video

 

On or Off

 

Turn on if the input video does not contain

 

 

 

 

 

 

 

 

vertical blanking at its point of conversion to

 

 

 

 

 

 

 

 

the Avalon-ST video protocol.

 

 

 

Scaling algorithm

 

Nearest Neighbor

 

Select the scaling algorithm.

 

 

 

 

 

Bilinear

 

 

 

 

 

 

 

Bicubic

 

 

 

 

 

 

 

Polyphase

 

 

 

 

 

 

 

Edge Adaptive

 

 

 

 

 

 

 

 

 

 

 

 

Enable post scaling sharpen

 

On or Off

 

Turn on to include a post-scaling edge-

 

 

 

 

 

 

 

 

adaptive sharpening filter.

 

 

 

Always downscale or pass-

 

On or Off

 

Turn on if you want the output frame height

 

 

 

through

 

 

 

 

to be less than or equal to the input frame

 

 

 

 

 

 

 

height, which reduces the size of the line

 

 

 

 

 

 

 

buffer by one line.

 

 

 

 

 

 

 

If the input height becomes less than the

 

 

 

 

 

 

 

specified output height for any reason, the

 

 

 

 

 

 

 

output video is undefined but it must still

 

 

 

 

 

 

 

have the correct dimensions and the core

 

 

 

 

 

 

 

must not crash.

 

 

 

 

 

 

 

 

 

Share horizontal and vertical

 

On or Off

 

Turn on to force the bicubic and polyphase

 

 

 

coefficients

 

 

 

 

algorithms to share the same horizontal and

 

 

 

 

 

 

 

 

vertical scaling coefficient data.

 

 

 

Vertical filter taps

 

4–64, Default = 8

 

Select the number of vertical filter taps for the

 

 

 

 

 

 

 

 

bicubic and polyphase algorithms.

 

 

 

 

 

 

 

 

 

Vertical filter phases

 

1–256, Default = 16

 

Select the number of vertical filter phases for

 

 

 

 

 

 

 

 

the bicubic and polyphase algorithms.

 

 

 

Horizontal filter taps

 

4–64, Default = 8

 

Select the number of horizontal filter taps for

 

 

 

 

 

 

 

 

the bicubic and polyphase algorithms.

 

 

 

 

 

 

 

 

 

Horizontal filter phases

 

1–256, Default = 16

 

Select the number of horizontal filter phases

 

 

 

 

 

 

 

 

for the bicubic and polyphase algorithms.

 

 

 

Default edge threshold

 

0 to 2bits per symbol–1,

 

Specify the default value for the edge-adaptive

 

 

 

 

 

Default = 7

 

scaling mode. This value will be the fixed

 

 

 

 

 

 

 

edge threshold value if you do not turn on

 

 

 

 

 

 

 

Enable run-time control of input/output

 

 

 

 

 

 

 

frame size and edge/blur thresholds.

 

 

 

 

 

 

 

 

 

Altera Corporation

Scaler II IP Core

 

 

Send Feedback

UG-VIPSUITE

 

 

 

 

Scaler II Parameter Settings

17-11

 

2015.01.23

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Parameter

 

 

Value

 

Description

 

 

 

 

 

 

 

 

 

 

 

Default upper blur limit (per

 

0 to 2bits per symbol–1,

 

Specify the default value for the blurred-edge

 

 

color plane)

 

Default = 15

 

upper threshold in edge-adaptive sharpening.

 

 

 

 

 

 

 

This value will be the fixed edge threshold

 

 

 

 

 

 

 

 

value if you do not turn on Enable run-time

 

 

 

 

 

 

 

control of input/output frame size and

 

 

 

 

 

 

 

 

edge/blur thresholds.

 

 

 

Default lower blur limit (per

 

0 to 2bits per symbol–1,

 

Specify the default value for the blurred-edge

 

 

color plane)

 

Default = 0

 

lower threshold in edge-adaptive sharpening.

 

 

 

 

 

 

This value will be the fixed edge threshold

 

 

 

 

 

 

 

 

value if you do not turn on Enable run-time

 

 

 

 

 

 

control of input/output frame size and

 

 

 

 

 

 

 

 

edge/blur thresholds.

 

 

 

 

 

 

 

 

 

 

Vertical coefficients signed

 

On or Off

 

Turn on to force the algorithm to use signed

 

 

 

 

 

 

 

vertical coefficient data.

 

 

 

Vertical coefficient integer bits

 

0–32, Default = 1

 

Select the number of integer bits for each

 

 

 

 

 

 

 

 

vertical coefficient.

 

 

 

 

 

 

 

 

 

 

 

 

Vertical coefficient fraction bits

 

1–32, Default = 7

 

Select the number of fraction bits for each

 

 

 

 

 

 

 

 

vertical coefficient.

 

 

 

Horizontal coefficients signed

 

On or Off

 

Turn on to force the algorithm to use signed

 

 

 

 

 

 

 

horizontal coefficient data.

 

 

 

 

 

 

 

 

 

 

 

 

Horizontal coefficient integer

 

0–32, Default = 1

 

Select the number of integer bits for each

 

 

 

bits

 

 

 

 

horizontal coefficient.

 

 

 

Horizontal coefficient fraction

 

1–32, Default = 7

 

Select the number of fraction bits for each

 

 

 

bits

 

 

 

 

horizontal coefficient.

 

 

 

 

 

 

 

 

 

 

Fractional bits preserved

 

0–32, Default = 0

 

Select the number of fractional bits you want

 

 

 

 

 

 

 

to preserve between the horizontal and

 

 

 

 

 

 

 

 

vertical filtering.

 

 

 

Load scaler coefficients at run

 

On or Off

 

Turn on to update the scaler coefficient data

 

 

time

 

 

 

 

at run time.

 

 

 

 

 

 

 

 

 

 

 

 

Vertical coefficient banks

 

1–32, Default = 1

 

Select the number of banks of vertical filter

 

 

 

 

 

 

 

 

coefficients for polyphase algorithms.

 

 

 

Vertical coefficient function

 

Lanczos_2

 

Select the function used to generate the

 

 

 

 

 

Lanczos_3

 

vertical scaling coefficients. Select either one

 

 

 

 

for the pre-defined Lanczos functions or

 

 

 

 

 

Custom

 

 

 

 

 

 

 

choose Custom to use the coefficients saved

 

 

 

 

 

 

 

 

 

 

 

 

in a custom coefficients file.

 

 

 

 

 

 

 

 

 

 

Vertical coefficients file

 

User-specified

 

When a custom function is selected, you can

 

 

 

 

 

 

 

browse for a comma-separated value file

 

 

 

 

 

 

 

 

containing custom coefficients. Key in the

 

 

 

 

 

 

 

 

path for the file that contains these custom

 

 

 

 

 

 

 

 

coefficients.

 

 

 

 

 

 

 

 

 

 

 

Scaler II IP Core

 

 

 

 

 

Altera Corporation

 

Send Feedback

 

 

 

 

 

 

 

 

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]