Locally-Adaptive Texture Compression

Locally-Adaptive Texture Compression

CEIG’09, San Sebastián, Sept. 9-11 (2009) C. Andújar and J. LLuch (Editors) Locally-Adaptive Texture Compression C. Andujar1 and J. Martinez1 1MOVING research group, Universitat Politècnica de Catalunya Abstract Current schemes for texture compression fail to exploit spatial coherence in an adaptive manner due to the strict efficiency constraints imposed by GPU-based, fragment-level decompression. In this paper we present a texture compression framework for quasi-lossless, locally-adaptive compression of graphics data. Key elements include a Hilbert scan to maximize spatial coherence, efficient encoding of homogeneous image regions through arbitrarily- sized texel runs, a cumulative run-length encoding supporting fast random-access, and a compression algorithm suitable for fixed-rate and variable-rate encoding. Our scheme can be easily integrated into the rasterization pipeline of current programmable graphics hardware allowing real-time GPU decompression. We show that our scheme clearly outperforms competing approaches such as S3TC DXT1 on a large class of images with some degree of spatial coherence. Unlike other proprietary formats, our scheme is suitable for compression of any graphics data including color maps, shadow maps and relief maps. We have observed compression rates of up to 12:1, with minimal or no loss in visual quality and a small impact on rendering time. Categories and Subject Descriptors (according to ACM CCS): I.3.7 [Computer Graphics]: 3D Graphics and Realism—Texture 1. Introduction decoding, and also reduces bandwidth requirements as com- pressed texture data may reside permanently in texture mem- Storing and accessing large texture maps with fine detail is ory. still a challenging problem in computer graphics. In hard- ware systems supporting real–time texture mapping, textures There are many techniques for image compression, most are generally placed in dedicated memory that can be ac- of which are geared towards compression for storage or cessed quickly as fragments are generated. Because dedi- transmission. Texture compression systems for GPU on-the- cated texture memory is a limited resource, using less mem- fly decoding exhibit special requirements which distinguish ory for textures may yield caching benefits, especially in them from general image compression systems. In choos- cases where the textures do not fit in main memory and cause ing a texture compression scheme there are several issues to the system to swap. Texture compression lowers both mem- consider: ory and bandwidth requirements and thus can help to achieve higher graphics quality with a given memory budget, or re- Decoding Speed. In order to render directly from the com- duce memory and bandwidth consumption without substan- pressed representation, the scheme must support fast de- tially degrading quality. compression so that the time necessary to access a sin- The availability of programmable shaders in low-cost gle texel is not severely impacted. A transform coding graphics hardware provides new, attractive solutions for tex- scheme such as JPEG is too expensive because extract- ture compression. Today’s programmable graphics hardware ing the value of a single texel would require an expensive allows the integration of texture decoders into the raster- inverse Discrete Cosine Transform computation. ization pipeline. Thus, only compressed data needs to be Random Access. Texture compression formats must pro- stored in dedicated texture memory provided that each tex- vide fast random access to texels. Compression schemes ture lookup includes a decoding step. Texture decoding in based on entropy encoding (e.g. JPEG 2000) and deflate programmable hardware is considerably faster than software encoding (e.g. PNG) produce variable rate codes requir- c The Eurographics Association 2009. C. Andujar & J. Martinez / Locally-Adaptive Texture Compression ing decompressing a large portion of the texture to extract Our scheme can be easily integrated into current pro- a single texel. grammable graphics hardware allowing real-time GPU de- Cache-friendly. Texture caches are used in graphics hard- compression. ware to speed up texture accesses. A texture compression system should work well with existing caches, thus it is important to preserve the locality of references. 2. Previous work General image compression A number of fixed-rate, block-based compressed texture formats such as S3TC DXT1, 3Dfx FXT1 and ATI 3Dc are The reasons why conventional image compression schemes natively supported by low-cost hardware. However, block- such as PNG, JPEG and JPEG2000 are not suitable as com- based approaches present two major limitations. A first lim- pressed texture formats has been extensively reported in itation is the lack of flexibility of proprietary formats, which the literature, see e.g. [BAC96, LH07]. Most compression difficults the compression of non-color data such as light strategies, including entropy coding, deflate, and run-length fields, parallax occlusion maps and relief maps. A second encoding, lead to variable-rate encodings which lack effi- limitation is that most block-based approaches use a uniform cient fine-grain random access. Entropy encoders, for exam- bitrate across the image, and thus lose information in high- ple, use a few bits to encode the most commonly occurring detail regions, while over-allocating space in low-detail re- symbols. Entropy coding does not allow random access as gions. This lack of adaptivity often results in visible artifacts the compressed data preceding any given symbol must be all over the texture, which are particularly noticeable around fetched and decompressed to decode the symbol. Thus the sharp image features and areas with high color variance. most common approach for texture compression is fixed-rate encoding of small image blocks, as fixed-rate compression Spatial data in computer graphics is often very coher- eases address computations and facilitates random access. ent. There is a large body of work on compressing coherent data, particularly in the context of images. However, most compression schemes such as JPEG2000 involve sequential Vector quantization and block-based methods traversal of the data for entropy coding, and therefore lack Vector quantization (VQ) has been largely adopted for tex- efficient fine-grain random access. Compression techniques ture compression [NH92, BAC96]. When using VQ, texture that retain random access are more rare. Adaptive hierar- is regarded as a set of texel blocks. VQ attempts to character- chies such as wavelets and quadtrees offer spatial adaptivity, ize this set of blocks by a smaller set of representative blocks but compressed tree schemes generally require a sequential called a codebook. A lossy compressed version of the orig- traversal and do not support random access [LH07]. inal image is represented as a set of indices into this code- book, with one index per block of texels [BAC96]. Indexed Contributions color can be seen as vector quantization using 1x1 blocks. Color quantization algorithms such as the Median Cut Al- In this paper we present a locally-adaptive texture compres- gorithm use this same indexed-lookup technique for repre- sion scheme suitable for both fixed-rate and variable-rate en- senting 24 bit images with 8 bpp. The most critical part of coding. Novel elements include: VQ encoding is the construction of the codebook. The Gen- eralized Lloyd Algorithm yields a locally optimal codebook • Use of space-coherent scans such as the Hilbert scan to for a given set of pixel blocks. VQ can also be applied hier- exploit texel correlation. archically. Vaisey and Gersho [VG88] adaptively subdivide • Efficient encoding of homogeneous image regions image blocks and use different VQ codebooks for different- through arbitrarily-sized texel runs which provide a more sized blocks. flexible approach to segment coherent data from fine de- tail. Tree-based methods can only segment coherent data Block-based data compression has been a very active area in square regions whose size and boundaries are given by of research [MB98, SAM05]. S3TC formats [MB98] are a the tree subdivision. Our approach is able to detect cor- de facto standard in today’s programmable graphics hard- related areas in several orders of magnitude more regions ware. S3TC DXT1 [BA] stores a 4x4 texel block using 64 than quadtree-based approaches. bits, consisting of two 16-bit RGB 5:6:5 color values and • A cumulative run-length encoding of coherent texel runs a 4x4 two-bit lookup table. The two bits of the look-up ta- supporting fast random-access. Cumulative RLE allows ble are used to select one color out of four possible com- for texel recovery using binary search. We present an O(1) binations computed by linear interpolation of the two 16- decoding algorithm requiring less than 3.5 texture lookups bit color values. A variant called VTC has been proposed on average. by Nvidia to extend S3TC to allow textures of width and • A compression algorithm suitable for fixed-rate and height other than multiples of 4. Unfortunately, the accuracy variable-rate encoding. The compression algorithm is of the DXT1 texture compression is often insufficient and driven by an error-sorted priority-queue which decides the the scheme is hardly customizable. The low number of col- order in which texel runs are collapsed. ors (4) used to encode each 16-texel block, and the RGB c The Eurographics Association 2009. C. Andujar & J. Martinez / Locally-Adaptive Texture Compression f Scan order to map 2D data into 1D data L = (c0;:::cwh−1)

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us