Video and Image Processing Suite User Guide

ID 683416
Date 4/04/2022
Document Table of Contents

9.1. Alpha Blending

When you turn on Alpha Blending Enable in the Mixer II parameter editor, the IP core is able to mix layers with varying levels of translucency using an alpha value obtained from a run-time programmable register setting.
Each input (N) has an InputN alpha channel parameter that enables the extra per-pixel alpha value for input n. When you enable either of the Alpha blending modes, bit [3:2] in the Input control N registers control which one of these alpha values is used:
  • Fixed opaque alpha value
  • Static (run-time programmable) value (only when you select the Alpha Blending Enable parameter)
  • Per-pixel streaming value (only when you select the InputN alpha channel parameter for InputN)
Note: When you turn the InputN alpha channel parameter, the IP core adds an extra symbol per-pixel for that input. The least significant symbol is the alpha value. The control packet is composed of all symbols including alpha.

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

The Mixer II IP core determines the alpha value width based on your specification of the bits per pixel per color parameter. For n-bit alpha values, the 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.

The value of an output pixel O N , where N ranges from 1 to number of inputs minus 1, is derived from the following recursive formula:

O N = (1 – a N ) p N + a N O N – 1

O0 = (1 – a0) p0 + a0 pbackground ,

where p N is the input pixel for layer N, a N is the alpha value for layer N, and pbackground is the background pixel value.

The Mixer II IP core skips consumed and disabled layers.

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,2 n –1]. The Mixer II IP core also transmits all output data samples in the same unsigned format.