OSDN Git Service

Update README.txt
[android-x86/external-s2tc.git] / README.txt
1 S2TC Environment Variables
2 ==========================
3
4 Color Distance Function
5 -----------------------
6 The following color distance functions can be selected by setting the
7 environment variable `S2TC_COLORDIST_MODE`:
8
9 *   `RGB`: weighted YCbCr difference assuming linear input
10 *   `YUV`: weighted Y'Cb'Cr' difference assuming sRGB input
11 *   `SRGB`: weighted YCbCr difference assuming sRGB input
12 *   `SRGB_MIXED`: weighted "Y'(Y)Cb'Cr'" difference assuming sRGB input
13 *   `AVG`: standard average of component difference (generic)
14 *   `WAVG`: weighted RGB average of component difference
15 *   `W0AVG`: superfast weighted RGB average of component difference
16 *   `NORMALMAP`: vector distance after normalization
17
18 The default is `WAVG`, which is a good compromise between speed and quality for
19 RGB and sRGB data. For optimum quality on sRGB input, try `SRGB_MIXED`.
20
21 The color distance function defines how "closeness" of pixel values is judged
22 when the pixel color values are evaluated, colors are selected, or during
23 refinement.
24
25 Color Selection
26 ---------------
27 The environment variable `S2TC_RANDOM_COLORS` can be set the following way:
28
29 *   `-1`: quick selection (darkest and brightest color are chosen, which is
30     similar to the method in the Color Cell Compression paper)
31 *   `0`: all 16 input colors of a block are considered
32 *   greater than `0`: additionally, that many random color values in the range
33     of the input color values are considered
34
35 The default is `-1`, which is fast but poor quality, however ideally suited for
36 online compression. For optimum quality, try `64`.
37
38 A bad color selection can later be compensated for by color refinement.
39
40 Color Refinement
41 ----------------
42 The environment variable `S2TC_REFINE_COLORS` can be set to the following values:
43
44 *   `NEVER`: never run color refinement
45 *   `ALWAYS`: unconditionally perform color refinement
46 *   `LOOP`: perform color refinement, evaluate its output and discard it if it
47     didn't improve quality, re-evaluate the pixel color values, and repeat
48     until no improvement could be made
49
50 The default is `ALWAYS`, which is fast and decent quality, and usually doesn't
51 make things worse. For optimum quality, try `LOOP`.
52
53 Color refinement recalculates the color palette of a block after the pixel
54 value decision by averaging the color values of those encoded as c0 or c1, and
55 is a technique that helps a lot of the initial color selection was poor (e.g.
56 if `S2TC_RANDOM_COLORS` was not set, or set to `-1`).