
In image processing, lookup tables are often called LUTs (or 3DLUT), and give an output value for each of a range of index values. Depending on the values being precomputed, precomputation with interpolation can also be used to shrink the lookup table size while maintaining accuracy. This technique requires slightly more time to be performed but can greatly enhance accuracy in applications that require the higher accuracy. Pre-calculation combined with interpolation can produce higher accuracy for values that fall between two precomputed values. Functions that have more than one result may be implemented with lookup tables that are arrays of structures.Īs mentioned, there are intermediate solutions that use tables in combination with a small amount of computation, often using interpolation. The latter case may thus employ a two-dimensional array of power to replace a function to calculate x y for a limited range of x and y values. Functions involving two or more variables require multidimensional array indexing techniques. An error in a lookup table was responsible for Intel's infamous floating-point divide bug.įunctions of a single variable (such as sine and cosine) may be implemented by a simple array. Lookup tables are thus used by mathematics coprocessors in computer systems. When the program requires the sine of a value, it can use the lookup table to retrieve the closest sine value from a memory address, and may also interpolate to the sine of the desired value, instead of calculating by mathematical formula. The same application can finish much sooner when it first precalculates the sine of a number of values, for example for each whole number of degrees (The table can be defined as static variables at compile time, reducing repeated run time costs). Calculating trigonometric functions can substantially slow a computing application.

For example, a grayscale picture of the planet Saturn will be transformed into a color image to emphasize the differences in its rings.Ī classic example of reducing run-time computations using lookup tables is to obtain the result of a trigonometry calculation, such as the sine of a value. In data analysis applications, such as image processing, a lookup table (LUT) is used to transform the input data into a more desirable output format.

Red (A), Green (B), Blue (C) 16-bit lookup table file sample. The process is termed as "direct addressing" and LUTs differ from hash tables in a way that, to retrieve a value v Lookup tables in image processing In computer science, a lookup table (LUT) is an array that replaces runtime computation with a simpler array indexing operation.

Array that replaces runtime computation with a simpler array indexing operation
