This section describes the functions that perform compression of the textures. Textures are images that are applied to the surface of shapes to add visual detail or color. In the modern computer graphics textures are used extremely wide and can consume large amounts of system and video memory. The compression of textures reduces the size of the required memory.
Intel IPP implements the Microsoft DirectX* texture compression algorithms (DXTC or DXTn) also known as S3 Texture Compression [S3TC]. It is a lossy compression with a fixed compression ratio of 4:1 or 8:1. This compression is a form of block truncating coding (BTC), where an image is divided into non-overlapping blocks and pixels in each block are quantized to a limited number of values.
The color values of pixels in a 4x4 pixel block are approximated with equidistant points on a line through color space. This line is defined by two end points and for each pixel in the 4x4 block an index is stored to one of the equidistant points on the line. The end points of the line through color space are quantized to 16-bit 5:6:5 RGB format and either one or two intermediate points are generated through interpolation. The DXT1 format allows an 1-bit alpha channel to be encoded by using only one intermediate point and specifying one color which is black and fully transparent. The DXT2 and DXT3 formats encode a separate explicit 4-bit alpha value for each pixel in a 4x4 block. The DXT4 and DXT5 formats store a separate alpha channel which is compressed similarly to the color channels where the alpha values in a 4x4 block are approximated with equidistant points on a line through alpha space. In the DXT2 and DXT4 formats it is assumed that the color values have been premultiplied by the alpha values. In the DXT3 and DXT5 formats it is assumed that the color values are not premultiplied by the alpha values (see also more details at http://msdn.microsoft.com/en-us/library/bb204843(VS.85).aspx).
Intel IPP supports three variations of the S3TC algorithm: DXT1, DXT3, and DXT5.
Table “Texture Compression Function” lists functions for texture compression described in more detail later in this section.
Function Base Name | Description |
---|---|
TextureEncodeBlockFromRGBA | Encodes RGBA texture images. |
TextureEncodeBlockFromRG | Encodes two-channel texture images. |
TextureEncodeBlock | Encodes one-channel texture images. |
TextureEncodeBlock4x4FromRGBA | |
TextureDecodeBlockToRGBA | Decodes compressed RGBA texture images. |
TextureDecodeBlockToRGB | Decodes BC6 blocks to the texture image. |
TextureDecodeBlockToRG | Decodes BC5 blocks to the texture image. |
TextureDecodeBlock | Decodes BC4 blocks to the texture image. |
TextureEncodeBlockFromYCoCg | Encodes YCoCg texture images. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.