Graphics Reference
In-Depth Information
struct astc_header
{ uint8_t magic [4];
uint8_t blockdim_x ;
uint8_t blockdim_y ;
uint8_t blockdim_z ;
uint8_t xsize [3];
uint8_t ysize [3];
uint8_t zsize [3];
}
;
Listing 6.1. ASTC header structure.
texture formats and as such can be used to test ASTC-based programs on a
standard desktop GPU.
Loading a texture in ASTC format is no different from loading other com-
pressed texture formats, but the correct internal format must be used. Files
output by the compressor have a data header containing everything needed to
load the compressed texture.
Using the data structure in Listing 6.1, the application can detect the impor-
tant information needed to load an ASTC texture. Please see the Mali Developer
Center website for source code examples.
6.6 Quality Settings
This chapter has already mentioned some of the high-level quality settings, but
there are far more precisely targeted ways to tweak the quality of the compressor's
output. The command line compressor has two main categories of argument,
search parameters and quality metrics.
The algorithm for compressing a texture relies heavily on trial and error.
Many combinations of block partition and boundary colors are compared and the
best one is used for that block. Widening search parameters will compare more
combinations to find the right one, enabling the algorithm to find a better match
but also lengthening search time (and therefore compression time).
plimit is the maximum number of partitions tested for each block before it
takes the best one found so far.
dblimit is the perceptual signal-to-noise ratio (PSNR) cutoff for a block in
dB. If the PSNR of a block attempt exceeds this, the algorithm considers it
good enough and uses that combination. This PSNR may not be reached,
since the algorithm may hit the other limits first.
oplimit implements a cutoff based on comparing errors between single and
dual partitioning. That is, if the dual partition errors are much worse
Search WWH ::




Custom Search