Digital Signal Processing Reference
In-Depth Information
overlay, but a translucent logo? Or what if in some video clips you
didn't want a logo? All of these options and more can be
accommodated in real-time by a silicon architecture that can do
fast alpha-blending.
7.2 Concept and Math Behind Alpha Blending
First the concept: to mix two frames of video we define
a third frame of video called the alpha frame. This frame also has
pixels that I will call alpha values. When pixels from frame one
are flying through, and the frame that constitutes the logo
appears, the hardware creates a composite pixel whose value is
defined as:
Composite pixel
pixel from frame 1
alpha
pixel from
¼
þ
frame 2
alpha)
Think about this simple equation. The alpha frame can be
defined as one in all the positions where there is no logo in frame
two. And the alpha values are defined as zero in those places
where the logo appears.
Composite pixel
(1
pixel from frame one (when the alpha value
is one, i.e. where there is no logo)
Composite pixel
¼
pixel from frame two (when the alpha value
is zero, i.e. where there is logo)
And that is the math behind alpha blending.
There are many advantages to defining the blending of video
in this manner. For example, if you want the logo to be trans-
lucent, you define the alpha value as 0.5 wherever the logo
appears. Therefore the value of the composite pixel in places
where the logo appears becomes:
Composite pixel
¼
pixel from frame 1
0.5
pixel from frame
¼
þ
2
0.5
This could be described as half-and-half or, in other words, the
logo is translucent.
To take another example, you may want to blend three frames
of video. You define two alpha frames: the first alpha frame is
used to blend frame one and frame two: the second alpha frame
blends the newly created composite frame with frame three. And
now you have a blended frame.
If you wish to remove the logo from the frames for the next
five minutes, you would leave the hardware in place and just
update the alpha frame for the next five minutes. That would
wipe out the logo, and after five minutes the logo would come
back.
Many effects can be achieved with this simple concept.
Search WWH ::




Custom Search