User guide
Table Of Contents
- Contents
- 1. About This MegaCore Function Suite
- Release Information
- Device Family Support
- Features
- Design Example
- Performance and Resource Utilization
- 2D FIR Filter
- 2D Median Filter
- Alpha Blending Mixer
- Avalon-ST Video Monitor
- Chroma Resampler
- Clipper
- Clocked Video Input
- Clocked Video Output
- Color Plane Sequencer
- Color Space Converter
- Control Synchronizer
- Deinterlacer
- Deinterlacer II
- Frame Buffer
- Gamma Corrector
- Interlacer
- Scaler
- Scaler II
- Switch
- Test Pattern Generator
- Trace System
- 2. Getting Started with Altera IP Cores
- 3. Interfaces
- Interface Types
- Avalon-ST Video Protocol
- Avalon-MM Slave Interfaces
- Avalon-MM Master Interfaces
- Buffering of Non-Image Data Packets in Memory
- 4. 2D FIR Filter MegaCore Function
- 5. 2D Median Filter MegaCore Function
- 6. Alpha Blending MegaCore Function
- 7. Avalon-ST Video Monitor MegaCore Function
- 8. Chroma Resampler MegaCore Function
- 9. Clipper MegaCore Function
- 10. Clocked Video Input MegaCore Function
- 11. Clocked Video Output MegaCore Function
- 12. Color Plane Sequencer MegaCore Function
- 13. Color Space Converter MegaCore Function
- 14. Control Synchronizer MegaCore Function
- 15. Deinterlacer MegaCore Function
- Core Overview
- Functional Description
- Parameter Settings
- Signals
- Control Register Maps
- 16. Deinterlacer II MegaCore Function
- 17. Frame Reader MegaCore Function
- 18. Frame Buffer MegaCore Function
- 19. Gamma Corrector MegaCore Function
- 20. Interlacer MegaCore Function
- 21. Scaler MegaCore Function
- 22. Scaler II MegaCore Function
- 23. Switch MegaCore Function
- 24. Test Pattern Generator MegaCore Function
- 25. Trace System MegaCore Function
- A. Avalon-ST Video Verification IP Suite
- B. Choosing the Correct Deinterlacer
- Additional Information

6–2 Chapter 6: Alpha Blending MegaCore Function
Functional Description
Video and Image Processing Suite January 2013 Altera Corporation
User Guide
This behavior 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();
}
For information about using Avalon-MM Slave interfaces for run-time control, refer to
“Avalon-MM Slave Interfaces” on page 3–17. For details of the control register maps,
refer to Table 6–5 on page 6–7. For information about the Avalon-MM interface
signals, refer to Table 6–4 on page 6–6.
Alpha Blending
When you turn on Alpha blending, the Avalon-ST input ports for the alpha channels
expect a video stream compliant with the Avalon-ST Video protocol. Alpha frames
contain a single color plane and are transmitted in video data packets. 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 MegaCore function must
recover cleanly if there is a mismatch although there may be throughput issues at the
system-level if erroneous pixels have to be discarded. All non-image data packets
(including control packets) are ignored and discarded 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 2
n
–1. The model interprets
(2
n
–1) as 1, and all other values as (Alpha value)/2
n
. For example, 8-bit alpha value
255 => 1, 254 => 254/256, 253 => 253/256 and so on.