- •Contents
- •1. Video and Image Processing Suite Overview
- •Release Information
- •Device Family Support
- •Latency
- •In-System Performance and Resource Guidance
- •Stall Behavior and Error Recovery
- •2. Interfaces
- •Video Formats
- •Avalon-ST Video Protocol
- •Video Data Packets
- •Static Parameters of Video Data Packets
- •Control Data Packets
- •Ancillary Data Packets
- •User-Defined and Altera-Reserved Packets
- •Packet Propagation
- •Transmission of Avalon-ST Video Over Avalon-ST Interfaces
- •Packet Transfer Examples
- •Avalon-MM Slave Interfaces
- •Specification of the Type of Avalon-MM Slave Interfaces
- •Avalon-MM Master Interfaces
- •Specification of the Type of Avalon-MM Master Interfaces
- •Buffering of Non-Image Data Packets in Memory
- •3. Getting Started
- •IP Catalog and Parameter Editor
- •Specifying IP Core Parameters and Options
- •Installing and Licensing IP Cores
- •OpenCore Plus IP Evaluation
- •4. Clocked Video Interface IP Cores
- •Control Port
- •Clocked Video Input Format Detection
- •Interrupts
- •Clocked Video Output Video Modes
- •Interrupts
- •Generator Lock
- •Underflow and Overflow
- •Timing Constraints
- •Handling Ancillary Packets
- •Modules for Clocked Video Input II IP Core
- •Clocked Video Interface Parameter Settings
- •Clocked Video Interface Signals
- •Clocked Video Interface Control Registers
- •5. 2D FIR Filter IP Core
- •Calculation Precision
- •Coefficient Precision
- •Result to Output Data Type Conversion
- •2D FIR IP Core Parameter Settings
- •2D FIR Filter Signals
- •2D FIR Filter Control Registers
- •6. Video Mixing IP Cores
- •Alpha Blending
- •Video Mixing Parameter Settings
- •Video Mixing Signals
- •Video Mixing Control Registers
- •7. Chroma Resampler IP Core
- •Horizontal Resampling (4:2:2)
- •Vertical Resampling (4:2:0)
- •Chroma Resampler Parameter Settings
- •Chroma Resampler Signals
- •8. Video Clipping IP Cores
- •Video Clipping Parameter Settings
- •Video Clipping Signals
- •Video Clipping Control Registers
- •9. Color Plane Sequencer IP Core
- •Combining Color Patterns
- •Rearranging Color Patterns
- •Splitting and Duplicating
- •Subsampled Data
- •Color Plane Sequencer Parameter Settings
- •Color Plane Sequencer Signals
- •10. Color Space Conversion IP Cores
- •Input and Output Data Types
- •Color Space Conversion
- •Result of Output Data Type Conversion
- •Color Space Conversion Parameter Settings
- •Color Space Conversion Signals
- •Color Space Conversion Control Registers
- •11. Control Synchronizer IP Core
- •Using the Control Synchronizer IP Core
- •Control Synchronizer Parameter Settings
- •Control Synchronizer Signals
- •Control Synchronizer Control Registers
- •12. Deinterlacing IP Cores
- •Deinterlacing Methods
- •Bob with Scanline Duplication
- •Bob with Scanline Interpolation
- •Weave
- •Motion-Adaptive
- •Sobel-Based HQ Mode
- •Pass-Through Mode for Progressive Frames
- •Frame Buffering
- •Frame Rate Conversion
- •Bandwidth Requirement Calculations for 10-bit YCbCr Video
- •Behavior When Unexpected Fields are Received
- •Handling of Avalon-ST Video Control Packets
- •Deinterlacing Parameter Settings
- •Deinterlacing Signals
- •Deinterlacing Control Registers
- •Design Guidelines for Broadcast Deinterlacer IP Core
- •13. Frame Reader IP Core
- •Single-Cycle Color Patterns
- •Frame Reader Output Pattern and Memory Organization
- •Frame Reader Parameter Settings
- •Frame Reader Signals
- •Frame Reader Control Registers
- •14. Frame Buffer IP Cores
- •Double Buffering
- •Triple Buffering
- •Locked Frame Rate Conversion
- •Handling of Avalon-ST Video Control Packets
- •Color Format
- •Frame Buffer Parameter Settings
- •Frame Buffer Signals
- •Frame Buffer Control Registers
- •15. Gamma Corrector IP Core
- •Gamma Corrector Parameter Settings
- •Gamma Corrector Signals
- •Gamma Corrector Control Registers
- •16. Interlacer IP Core
- •Interlacer Parameter Settings
- •Interlacer Signals
- •Interlacer Control Registers
- •17. Scaler II IP Core
- •Nearest Neighbor Algorithm
- •Bilinear Algorithm
- •Bilinear Algorithmic Description
- •Polyphase and Bicubic Algorithm
- •Double-Buffering
- •Polyphase Algorithmic Description
- •Choosing and Loading Coefficients
- •Edge-Adaptive Scaling Algorithm
- •Scaler II Parameter Settings
- •Scaler II Signals
- •Scaler II Control Registers
- •18. Video Switching IP Cores
- •Mixer Layer Switching
- •Video Switching Parameter Settings
- •Video Switching Signals
- •Video Switching Control Registers
- •19. Test Pattern Generator IP Cores
- •Test Pattern
- •Generation of Avalon-ST Video Control Packets and Run-Time Control
- •Test Pattern Generator Parameter Settings
- •Test Pattern Generator Signals
- •Test Pattern Generator Control Registers
- •20. Trace System IP Core
- •Trace System Parameter Settings
- •Trace System Signals
- •Operating the Trace System from System Console
- •Loading the Project and Connecting to the Hardware
- •Trace Within System Console
- •TCL Shell Commands
- •21. Avalon-ST Video Monitor IP Core
- •Packet Visualization
- •Monitor Settings
- •Avalon-ST Video Monitor Parameter Settings
- •Avalon-ST Video Monitor Signals
- •Avalon-ST Video Monitor Control Registers
- •Avalon-ST Video Class Library
- •Running the Tests
- •Video File Reader Test
- •Example Test Environment
- •Video Field Life Cycle
- •Constrained Random Test
- •Complete Class Reference
- •c_av_st_video_control
- •c_av_st_video_data
- •c_av_st_video_file_io
- •c_av_st_video_item
- •c_av_st_video_source_sink_base
- •c_av_st_video_sink_bfm_’SINK
- •c_av_st_video_source_bfm_’SOURCE
- •c_av_st_video_user_packet
- •c_pixel
- •Raw Video Data Format
- •Cadence Detection and Reverse Pulldown in the Deinterlacer II IP Core
- •Document Revision History
- •How to Contact Altera
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