Alpha Blending with No Division Operations

02/06/2022
by   Jerry R. Van Aken, et al.
0

Highly accurate alpha blending can be performed entirely with integer operations, and no divisions. To reduce the number of integer multiplications, multiple color components can be blended in parallel in the same 32-bit or 64-bit register. This tutorial explains how to avoid division operations when alpha blending with 32-bit RGBA pixels. An RGBA pixel contains four 8-bit components (red, green, blue, and alpha) whose values range from 0 to 255. Alpha blending requires multiplication of the color components by an alpha value, after which (for greatest accuracy) each of these products is divided by 255 and then rounded to the nearest integer. This tutorial presents an approximate alpha-blending formula that replaces the division operation with an integer shift and add – and also enables the number of multiplications to be reduced. When the same blending calculation is carried out to high precision using double-precision floating-point division operations, the results are found to exactly match those produced by this approximation. C++ code examples are included.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/18/2022

Formally verified 32- and 64-bit integer division using double-precision floating-point arithmetic

Some recent processors are not equipped with an integer division unit. C...
research
11/01/2018

Rethinking floating point for deep learning

Reducing hardware overhead of neural networks for faster or lower power ...
research
12/22/2020

Integer Division by Constants: Optimal Bounds

The integer division of a numerator n by a divisor d gives a quotient q ...
research
01/31/2019

Algorithmic counting of nonequivalent compact Huffman codes

It is known that the following five counting problems lead to the same i...
research
02/05/2019

Faster Remainder by Direct Computation: Applications to Compilers and Software Libraries

On common processors, integer multiplication is many times faster than i...
research
08/30/2020

Floating-Point Multiplication Using Neuromorphic Computing

Neuromorphic computing describes the use of VLSI systems to mimic neuro-...
research
09/23/2019

Implementation of Goldschmidt's Algorithm with hardware reduction

Division algorithms have been developed to reduce latency and to improve...

Please sign up or login with your details

Forgot password? Click here to reset