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

Video Mixing IP Cores

6

2015.01.23

UG-VIPSUITE

Subscribe

Send Feedback

The Video Mixing IP cores mix together up to 12 image layers .

This run-time control is partly provided by an Avalon-MM slave port with registers for the location, and on or off status of each foreground layer. The dimensions of each layer are then specified by Avalon-ST Video control packets.

Note: It is expected that each foreground layer fits in the boundaries of the background layer.

IP Cores

 

Feature

 

 

 

Alpha Blending Mixer

 

• Supports picture-in-picture and image blending with per

 

 

pixel alpha support.

 

 

• Supports dynamic changing of location and size of each

 

 

layer during run time.

 

 

• Allows the individual layers to be switched on and off.

 

 

• Supports 1 pixel per transmission.

 

 

 

Mixer II

 

• Supports picture-in-picture mixing.

 

 

• Supports dynamic changing of location and size of each

 

 

layer during run time.

 

 

• Allows the individual layers to be switched on and off.

 

 

• Supports up to 4 pixels in parallel.

 

 

• Includes built in test pattern generator as background

 

 

layer

 

 

 

The Video Mixing IP cores read the control data in two steps at the start of each frame. The buffering happens inside the IP core so that the control data can be updated during the frame processing without unexpected side effects.

The first step occurs after the IP core processes and transmits all the non-image data packets of the background layer, and it has received the header of an image data packet of type 0 for the background. At this stage, the on/off status of each layer is read. A layer can be disabled (0), active and displayed (1) or consumed but not displayed (2). The maximum number of image layers mixed cannot be changed dynamically and must be set in the parameter editor.

The IP core processes the non-image data packets of each active foreground layer, displayed or consumed, in a sequential order, layer 1 first. The IP core integrally transmits the non-image data packets from the

© 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.

ISO 9001:2008 Registered

www.altera.com

101 Innovation Drive, San Jose, CA 95134

6-2

Alpha Blending

UG-VIPSUITE

2015.01.23

 

 

background layer. The IP core treats the non-image data packets from the foreground layers differently depending on their type.

Control packets (type 15)— processed to extract the width and height of each layer and are discarded on the fly.

Other/user packets (types 1–14)—propagated unchanged.

The second step corresponds to the usual behavior of other Video and Image Processing IP cores that have an Avalon-MM slave interface. After the IP core has processed and/or propagated the non-image data packets from the background layer and the foreground layers, it waits for the Go bit to be set to 1 before reading the top left position of each layer.

Consequently, the behavior of the Alpha Blending Mixer and Mixer II IP cores differ slightly from the other Video and Image Processing IP cores. The behavior of the Video Mixing IP cores is illustrated by the following pseudo-code:

go = 0; while (true)

{

status = 0;

read_non_image_data_packet_from background_layer(); read_control_first_pass(); // Check layer status

(disable/displayed/consumed)

for_each_layer layer_id

{

// process non-image data packets for displayed or consumed layers

if (layer_id is not disabled)

{

handle_non_image_packet_from_foreground_layer(layer_id);

}

}

while (go != 1) wait;

status = 1;

read_control_second_pass(); // Copies top-left coordinates to internal registers

send_image_data_header(); process_frame();

}

Alpha Blending

The alpha frames contain a single color plane and are transmitted in video data packets.

When you turn on Alpha blending in the Alpha Blending Mixer parameter editor, the Avalon-ST input ports for the alpha channels expect a video stream compliant with the Avalon-ST Video protocol. The first value in each packet, transmitted while the startofpacket signal is high, contains the packet type identifier 0. This condition holds true even when the width of the alpha channels data ports is less than 4 bits wide. The last alpha value for the bottom-right pixel is transmitted while the endofpacket signal is high.

It is not necessary to send control packets to the ports of the alpha channels. The width and height of each alpha layer are assumed to match with the dimensions of the corresponding foreground layer. The Alpha Blending Mixer IP core recovers cleanly if there is a mismatch, although there may be throughput issues

Altera Corporation

Video Mixing IP Cores

 

 

Send Feedback

UG-VIPSUITE 2015.01.23

Video Mixing Parameter Settings

6-3

at the system-level if erroneous pixels have to be discarded. The IP core ignores all non-image data packets (including control packets) and discards them just before the processing of a frame starts.

The valid range of alpha coefficients is 0 to 1, where 1 represents full translucence, and 0 represents fully opaque.

For n-bit alpha values (RGBAn) coefficients range from 0 to 2n–1. The model interprets (2n–1) as 1, and all other values as (Alpha value)/2n. For example, 8-bit alpha value 255 > 1, 254 > 254/256, 253 > 253/256, and so on.

The value of an output pixel ON, where N is the maximum number of layers, is deduced from the following recursive formula:

ON = (1 – aN)pN + aNON–1

O0 = p0

where pN is the input pixel for layer N and aN is the alpha pixel for layer N. The Alpha Blending Mixer IP core skips consumed and disabled layers. The IP core does not use alpha values for the background layer (a0); you must tie the alpha0 port off to 0 when you instantiate the IP core in the parameter editor.

Note: All input data samples must be in unsigned format. If the number of bits per pixel per color plane is N, then 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 produced by the Alpha Blending Mixer IP core are also in the same unsigned format.

Video Mixing Parameter Settings

Table 6-1: Alpha Blending Mixer Parameter Settings

Parameter

 

Value

 

Description

 

 

 

 

 

Maximum layer width

 

32-2600, Default =

 

Specify the maximum image width for the

 

 

1024

 

layer background in pixels. No layer width

 

 

 

 

can be greater than the background layer

 

 

 

 

width. The maximum image width is the

 

 

 

 

default width for all layers at start-up.

 

 

 

 

 

Maximum layer height

 

32-2600, Default = 768

 

Specify the maximum image height for the

 

 

 

 

layer background in pixels. No layer height

 

 

 

 

can be greater than the background layer

 

 

 

 

height. The maximum image height is the

 

 

 

 

default height for all layers at start-up.

Bits per pixel per color plane

 

4-20, Default = 8

 

Select the number of bits per pixel (per color

 

 

 

 

plane).

 

 

 

 

 

Number of color planes in

 

1, 2, 3

 

Select the number of color planes that are

sequence

 

 

 

sent in sequence over one data connection.

 

 

 

 

For example, a value of 3 for R'G'B' R'G'B'

 

 

 

 

R'G'B'.

 

 

 

 

 

Video Mixing IP Cores

Altera Corporation

 

 

Send Feedback

6-4

Video Mixing Parameter Settings

 

 

 

 

UG-VIPSUITE

 

 

 

2015.01.23

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Parameter

 

 

Value

 

Description

 

 

 

 

 

 

 

 

 

 

 

Number of color planes in

 

1, 2, 3

 

Select the number of color planes in parallel.

 

 

parallel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Number of layers being mixed

 

2–12

 

Select the number of image layers to overlay.

 

 

 

 

 

 

 

 

The higher number layers are mixed on top

 

 

 

 

 

 

 

 

of the lower number layers. The background

 

 

 

 

 

 

 

 

layer is always layer 0.

 

 

 

Alpha blending

 

On or Off

 

• When you turn on this parameter, the IP

 

 

 

 

 

 

 

 

core generates alpha data sink ports for

 

 

 

 

 

 

 

each layer (including an unused port

 

 

 

 

 

 

 

alpha_in_0 for the background layer).

 

 

 

 

 

 

 

This requires a stream of alpha values; one

 

 

 

 

 

 

 

value for each pixel.

 

 

 

 

 

 

 

• When you turn off this parameter, the IP

 

 

 

 

 

 

 

core does not generate any alpha data sink

 

 

 

 

 

 

 

ports, and the image layers are fully

 

 

 

 

 

 

 

opaque.

 

 

 

 

 

 

 

 

 

Alpha bits per pixel

 

2, 4, 8

 

Select the number of bits used to represent

 

 

 

 

 

 

 

 

the alpha coefficient.

 

 

Table 6-2: Mixer II Parameter Settings

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Parameter

 

 

Value

 

Description

 

 

 

 

 

 

 

 

 

 

 

Output format (used for

 

4:4:4, 4:2:2

 

Select the sampling rate format for the

 

 

background layer)

 

 

 

 

background layer.

 

 

 

 

 

 

 

 

 

 

Color space (used for

 

RGB

 

Select the color space you want to use for the

 

 

 

background layer)

 

YCbCr

 

background layer.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Maximum frame width

 

32-2600, Default =

 

Specify the maximum image width for the

 

 

 

 

1920

 

layer background in pixels.

 

 

 

 

 

 

 

 

 

Maximum frame height

 

32-2600, Default =

 

Specify the maximum image height for the

 

 

 

 

 

1080

 

layer background in pixels.

 

 

 

Bits per pixel per color plane

 

4-20, Default = 8

 

Select the number of bits per pixel (per color

 

 

 

 

 

 

 

 

plane).

 

 

 

 

 

 

 

 

 

Number of color planes

 

2, 3

 

Select the number of color planes to be

 

 

 

 

 

 

 

 

transmitted.

 

 

 

Number of pixels in parallel

 

1, 2, 4

 

Select the number of pixels transmitted or

 

 

 

 

 

 

 

 

received in parallel.

 

 

 

 

 

 

 

 

 

 

Color planes transmitted in

 

1

 

 

The Mixer II IP core supports only color

 

 

 

parallel

 

 

 

 

planes in parallel.

 

 

 

 

 

 

 

 

 

 

Altera Corporation

Video Mixing IP Cores

 

 

Send Feedback

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