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

Chroma Resampler IP Core

7

2015.01.23

UG-VIPSUITE

Subscribe

Send Feedback

The Chroma Resampler IP core resamples video data to and from common sampling formats.

The human eye is more sensitive to brightness than tone. Taking advantage of this characteristic, video transmitted in the Y’CbCr color space often subsamples the color components (Cb and Cr) to save on data bandwidth.

The Chroma Resampler IP core allows you to change between 4:4:4, 4:2:2 and 4:2:0 sampling rates where:

4:4:4 specifies full resolution in planes 1, 2, and 3.

4:2:2 specifies full resolution in plane 1; half width resolution in planes 2 and 3.

4:2:0 specifies full resolution in plane 1; half width and height resolution in planes 2 and 3.

All modes of the Chroma Resampler IP core assume the chrominance (chroma) and luminance (luma) samples are co-sited (their values are sampled at the same time).

Horizontal resampling process supports nearest-neighbor and filtered algorithms.

Vertical resampling process supports only the nearest-neighbor algorithm.

You can configure the Chroma Resampler IP core to change image size at run time using control packets.

Horizontal Resampling (4:2:2)

Horizontal resampling process supports nearest-neighbor and filtered algorithms.

Conversion from sampling rate 4:4:4 to 4:2:2 and back are scaling operations on the chroma channels. This means that these operations are affected by some of the same issues as the Scaler II IP core. However, because the scaling ratio is fixed as 2× up or 2× down, the Chroma Resampler IP core is highly optimized for these cases.

© 2015 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.

www.altera.com

ISO 9001:2008 Registered

101 Innovation Drive, San Jose, CA 95134

7-2

4:4:4 to 4:2:2

UG-VIPSUITE

2015.01.23

 

 

Figure 7-1: Resampling 4.4.4 to a 4.2.2 Image

The figure below shows the location of samples in a co-sited 4:2:2 image.

= Y’

+ = Cb

+ = Cr

++ = CbCr

++ = Y’CbCr

Sample No

1

2

3

4

1

2

3

4

5

6

7

8

++

 

++

 

++

 

++

 

++

 

++

 

++

 

++

 

The Chroma Resampler IP core supports only the cosited form of horizontal resampling—the form for 4:2:2 data in ITU Recommendation BT.601, MPEG-2, and other standards.

Note: For more information about the ITU standard, refer to Recommendation ITU-R BT.601, Encoding Parameters of Digital Television for Studios, 1992, International Telecommunications Union, Geneva.

You can configure the Chroma Resampler IP core to change image size at run time using control packets.

4:4:4 to 4:2:2

The nearest-neighbor algorithm is the simplest way to down-scale the chroma channels. The nearestneighbor algorithm discards the Cb and Cr samples that occur on even columns (assuming the first column is numbered 1). This algorithm is very fast and cheap but, due to aliasing effects, it does not produce the best image quality.

To get the best results when down-scaling, apply a filter to remove high-frequency data and thus avoid possible aliasing. The filtered algorithm for horizontal subsampling uses a 9-tap filter with a fixed set of coefficients. The coefficients are based on a Lanczos-2 function that the Scaler II IP core uses. Their quantized form is known as the Turkowski Decimator.

4:2:2 to 4:4:4

The nearest-neighbor algorithm is the simplest way to up-scale the chroma channels. The nearestneighbor algorithm duplicates each incoming Cb and Cr sample to fill in the missing data. This algorithm is very fast and cheap, but it tends to produce sharp jagged edges in the chroma channels.

The filtered algorithm uses the same upscaling method as the Scaler II IP core—that is a four-tap filter with Lanczos-2 coefficients. Use this filter with a phase offset of 0 for the odd output columns (those with existing data) and an offset of one-half for the even columns (those without direct input data). A filter with phase offset 0 has no effect, so the function implements it as a pass-through filter. A filter with phase offset of one-half interpolates the missing values and has fixed coefficients that bit-shifts and additions implement. This algorithm performs suitable upsampling and does not use memory or multipliers. It uses more logic elements than the nearest-neighbor algorithm and is not the highest quality available.

The best image quality for upsampling is obtained by using the filtered algorithm with luma-adaptive mode enabled. This mode looks at the luma channel during interpolation and uses this to detect edges. Edges in the luma channel make appropriate phase-shifts in the interpolation coefficients for the chroma channels.

Altera Corporation

Chroma Resampler IP Core

 

 

Send Feedback

UG-VIPSUITE

Vertical Resampling (4:2:0)

7-3

2015.01.23

 

 

Figure 7-2: 4:2:2 Data at an Edge Transition

The figure below shows 4:2:2 data at an edge transition. Without taking any account of the luma, the interpolation to produce chroma values for sample 4 would weight samples 3 and 5 equally. From the luma, you can see that sample 4 falls on an the low side of an edge, so sample 5 is more significant than sample 3.

 

CbCr Color

 

Value

= Y’

 

+ = Cb

 

+ = Cr

Y’ Intensity

++ = CbCr

++ = Y’CbCr

 

++

++

++

++

1

2

3

4 5

6

7

Sample No

++

 

++

++

 

++

The luma-adaptive mode looks for such situations and chooses how to adjust the interpolation filter. From phase 0, it can shift to -1/4, 0, or 1/4; from phase 1/2, it can shift to 1/4, 1/2, or 3/4. This makes the interpolated chroma samples line up better with edges in the luma channel and is particularly noticeable for bold synthetic edges such as text. The luma-adaptive mode does not use memory or multipliers, but requires more logic elements than the straightforward filtered algorithm.

Vertical Resampling (4:2:0)

The Chroma Resampler IP core does not distinguish interlaced data with its vertical resampling mode. It only supports the co-sited form of vertical resampling.

Figure 7-3: Resampling 4.4.4 to a 4.2.0 Image

The figure below shows the co-sited form of vertical resampling.

= Y’

+ = Cb

+ = Cr

++ = CbCr

++ = Y’CbCr

Sample No

1

2

3

4

1

2

3

4

5

6

7

8

++

 

++

 

++

 

++

 

++

 

++

 

++

 

++

 

For both upsampling and downsampling, the vertical resampling algorithm is fixed at nearest-neighbor. The algorithm does not use any multipliers.

Upsampling—uses four line buffers, each buffer being half the width of the image.

Downsampling—uses one line buffer, which is half the width of the image.

Chroma Resampler IP Core

Altera Corporation

 

 

Send Feedback

7-4

Chroma Resampler Parameter Settings

UG-VIPSUITE

2015.01.23

 

 

Note: All input data samples must be in unsigned format. If the number of bits per pixel per color plane is N, this means that each sample consists of N bits of data which are interpreted as an unsigned binary number in the range [0, 2N–1]. All output data samples are also in the same unsigned format.

Chroma Resampler Parameter Settings

Table 7-1: Chroma Resampler Parameter Settings

Parameter

 

 

Value

 

Description

 

 

 

 

 

Maximum width

 

32–2600, Default = 256

 

Specify the maximum image width in pixels.

 

 

 

 

 

Maximum height

 

32–2600, Default = 256

 

Specify the maximum image height in pixels.

 

 

 

 

 

Bits per pixel per color plane

 

4–20, Default = 8

 

Select the number of bits per pixel (per color

 

 

 

 

 

plane).

 

 

 

 

 

 

Color plane configuration

 

Sequence

 

There must always be three color planes for

 

 

Parallel

 

this function but you can select whether the

 

 

 

three color planes are transmitted in sequence

 

 

 

 

 

 

 

 

 

 

or in parallel.

 

 

 

 

 

 

Input format

 

4:4:4

 

Select the format or sampling rate format for

 

 

4:2:2

 

the input frames.

 

 

 

Note: The input and output formats

 

 

4:2:0

 

 

 

 

 

 

must be different. A warning is

 

 

 

 

 

issued when the same values are

 

 

 

 

 

selected for both.

 

 

 

 

 

 

Output format

 

4:4:4

 

Select the format or sampling rate format for

 

 

4:2:2

 

the output frames.

 

 

 

Note: The input and output formats

 

 

4:2:0

 

 

 

 

 

 

must be different. A warning is

 

 

 

 

 

issued when the same values are

 

 

 

 

 

selected for both.

 

 

 

 

 

 

Horizontal filtering algorithm

 

Nearest Neighbor

 

Select the algorithm to use in the horizontal

 

 

Filtered

 

direction when you resample data to or from

 

 

 

4:4:4.

 

 

 

 

 

 

 

 

 

 

Luma adaptive

 

On or Off

 

Turn on to enable luma-adaptive mode. This

 

 

 

 

 

mode looks at the luma channel during

 

 

 

 

 

interpolation and detects edges.

 

 

 

 

 

 

Altera Corporation

Chroma Resampler IP Core

 

 

Send Feedback

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