summaryrefslogtreecommitdiffstats
path: root/plug-ins/file-dds/dxt_tables.h
blob: e30bb6aa6bdaffa74e8a28adc2f20cd1b0d580c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#ifndef __DXT_TABLES_H__
#define __DXT_TABLES_H__

static const unsigned char quantRB[256 + 16] =
{
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08,
   0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10,
   0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18,
   0x18, 0x18, 0x18, 0x18, 0x18, 0x21, 0x21, 0x21,
   0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x29, 0x29,
   0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x31, 0x31,
   0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x39, 0x39,
   0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x42, 0x42,
   0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x4a, 0x4a,
   0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x52,
   0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x5a,
   0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x63,
   0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x6b,
   0x6b, 0x6b, 0x6b, 0x6b, 0x6b, 0x6b, 0x6b, 0x6b,
   0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73,
   0x7b, 0x7b, 0x7b, 0x7b, 0x7b, 0x7b, 0x7b, 0x7b,
   0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
   0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c,
   0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94,
   0x94, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c,
   0x9c, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
   0xa5, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad,
   0xad, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5,
   0xb5, 0xb5, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd,
   0xbd, 0xbd, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
   0xc6, 0xc6, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce,
   0xce, 0xce, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6,
   0xd6, 0xd6, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde,
   0xde, 0xde, 0xde, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
   0xe7, 0xe7, 0xe7, 0xef, 0xef, 0xef, 0xef, 0xef,
   0xef, 0xef, 0xef, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7,
   0xf7, 0xf7, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};

static const unsigned char quantG[256 + 16] =
{
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x08,
   0x08, 0x08, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x10,
   0x10, 0x10, 0x10, 0x14, 0x14, 0x14, 0x14, 0x18,
   0x18, 0x18, 0x18, 0x1c, 0x1c, 0x1c, 0x1c, 0x20,
   0x20, 0x20, 0x20, 0x24, 0x24, 0x24, 0x24, 0x28,
   0x28, 0x28, 0x28, 0x2c, 0x2c, 0x2c, 0x2c, 0x30,
   0x30, 0x30, 0x30, 0x34, 0x34, 0x34, 0x34, 0x38,
   0x38, 0x38, 0x38, 0x3c, 0x3c, 0x3c, 0x3c, 0x41,
   0x41, 0x41, 0x41, 0x45, 0x45, 0x45, 0x45, 0x49,
   0x49, 0x49, 0x49, 0x4d, 0x4d, 0x4d, 0x4d, 0x51,
   0x51, 0x51, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55,
   0x59, 0x59, 0x59, 0x59, 0x5d, 0x5d, 0x5d, 0x5d,
   0x61, 0x61, 0x61, 0x61, 0x65, 0x65, 0x65, 0x65,
   0x69, 0x69, 0x69, 0x69, 0x6d, 0x6d, 0x6d, 0x6d,
   0x71, 0x71, 0x71, 0x71, 0x75, 0x75, 0x75, 0x75,
   0x79, 0x79, 0x79, 0x79, 0x7d, 0x7d, 0x7d, 0x7d,
   0x82, 0x82, 0x82, 0x82, 0x86, 0x86, 0x86, 0x86,
   0x8a, 0x8a, 0x8a, 0x8a, 0x8e, 0x8e, 0x8e, 0x8e,
   0x92, 0x92, 0x92, 0x92, 0x96, 0x96, 0x96, 0x96,
   0x9a, 0x9a, 0x9a, 0x9a, 0x9e, 0x9e, 0x9e, 0x9e,
   0xa2, 0xa2, 0xa2, 0xa2, 0xa6, 0xa6, 0xa6, 0xa6,
   0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xae, 0xae, 0xae,
   0xae, 0xb2, 0xb2, 0xb2, 0xb2, 0xb6, 0xb6, 0xb6,
   0xb6, 0xba, 0xba, 0xba, 0xba, 0xbe, 0xbe, 0xbe,
   0xbe, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xc7, 0xc7,
   0xc7, 0xcb, 0xcb, 0xcb, 0xcb, 0xcf, 0xcf, 0xcf,
   0xcf, 0xd3, 0xd3, 0xd3, 0xd3, 0xd7, 0xd7, 0xd7,
   0xd7, 0xdb, 0xdb, 0xdb, 0xdb, 0xdf, 0xdf, 0xdf,
   0xdf, 0xe3, 0xe3, 0xe3, 0xe3, 0xe7, 0xe7, 0xe7,
   0xe7, 0xeb, 0xeb, 0xeb, 0xeb, 0xef, 0xef, 0xef,
   0xef, 0xf3, 0xf3, 0xf3, 0xf3, 0xf7, 0xf7, 0xf7,
   0xf7, 0xfb, 0xfb, 0xfb, 0xfb, 0xff, 0xff, 0xff,
   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};

static const unsigned char omatch5[256][2] =
{
   {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x01}, {0x00, 0x01},
   {0x01, 0x00}, {0x01, 0x00}, {0x01, 0x00}, {0x01, 0x01},
   {0x01, 0x01}, {0x01, 0x01}, {0x01, 0x02}, {0x00, 0x04},
   {0x02, 0x01}, {0x02, 0x01}, {0x02, 0x01}, {0x02, 0x02},
   {0x02, 0x02}, {0x02, 0x02}, {0x02, 0x03}, {0x01, 0x05},
   {0x03, 0x02}, {0x03, 0x02}, {0x04, 0x00}, {0x03, 0x03},
   {0x03, 0x03}, {0x03, 0x03}, {0x03, 0x04}, {0x03, 0x04},
   {0x03, 0x04}, {0x03, 0x05}, {0x04, 0x03}, {0x04, 0x03},
   {0x05, 0x02}, {0x04, 0x04}, {0x04, 0x04}, {0x04, 0x05},
   {0x04, 0x05}, {0x05, 0x04}, {0x05, 0x04}, {0x05, 0x04},
   {0x06, 0x03}, {0x05, 0x05}, {0x05, 0x05}, {0x05, 0x06},
   {0x04, 0x08}, {0x06, 0x05}, {0x06, 0x05}, {0x06, 0x05},
   {0x06, 0x06}, {0x06, 0x06}, {0x06, 0x06}, {0x06, 0x07},
   {0x05, 0x09}, {0x07, 0x06}, {0x07, 0x06}, {0x08, 0x04},
   {0x07, 0x07}, {0x07, 0x07}, {0x07, 0x07}, {0x07, 0x08},
   {0x07, 0x08}, {0x07, 0x08}, {0x07, 0x09}, {0x08, 0x07},
   {0x08, 0x07}, {0x09, 0x06}, {0x08, 0x08}, {0x08, 0x08},
   {0x08, 0x09}, {0x08, 0x09}, {0x09, 0x08}, {0x09, 0x08},
   {0x09, 0x08}, {0x0a, 0x07}, {0x09, 0x09}, {0x09, 0x09},
   {0x09, 0x0a}, {0x08, 0x0c}, {0x0a, 0x09}, {0x0a, 0x09},
   {0x0a, 0x09}, {0x0a, 0x0a}, {0x0a, 0x0a}, {0x0a, 0x0a},
   {0x0a, 0x0b}, {0x09, 0x0d}, {0x0b, 0x0a}, {0x0b, 0x0a},
   {0x0c, 0x08}, {0x0b, 0x0b}, {0x0b, 0x0b}, {0x0b, 0x0b},
   {0x0b, 0x0c}, {0x0b, 0x0c}, {0x0b, 0x0c}, {0x0b, 0x0d},
   {0x0c, 0x0b}, {0x0c, 0x0b}, {0x0d, 0x0a}, {0x0c, 0x0c},
   {0x0c, 0x0c}, {0x0c, 0x0d}, {0x0c, 0x0d}, {0x0d, 0x0c},
   {0x0d, 0x0c}, {0x0d, 0x0c}, {0x0e, 0x0b}, {0x0d, 0x0d},
   {0x0d, 0x0d}, {0x0d, 0x0e}, {0x0c, 0x10}, {0x0e, 0x0d},
   {0x0e, 0x0d}, {0x0e, 0x0d}, {0x0e, 0x0e}, {0x0e, 0x0e},
   {0x0e, 0x0e}, {0x0e, 0x0f}, {0x0d, 0x11}, {0x0f, 0x0e},
   {0x0f, 0x0e}, {0x10, 0x0c}, {0x0f, 0x0f}, {0x0f, 0x0f},
   {0x0f, 0x0f}, {0x0f, 0x10}, {0x0f, 0x10}, {0x0f, 0x10},
   {0x0f, 0x11}, {0x10, 0x0f}, {0x10, 0x0f}, {0x11, 0x0e},
   {0x10, 0x10}, {0x10, 0x10}, {0x10, 0x11}, {0x10, 0x11},
   {0x11, 0x10}, {0x11, 0x10}, {0x11, 0x10}, {0x12, 0x0f},
   {0x11, 0x11}, {0x11, 0x11}, {0x11, 0x12}, {0x10, 0x14},
   {0x12, 0x11}, {0x12, 0x11}, {0x12, 0x11}, {0x12, 0x12},
   {0x12, 0x12}, {0x12, 0x12}, {0x12, 0x13}, {0x11, 0x15},
   {0x13, 0x12}, {0x13, 0x12}, {0x14, 0x10}, {0x13, 0x13},
   {0x13, 0x13}, {0x13, 0x13}, {0x13, 0x14}, {0x13, 0x14},
   {0x13, 0x14}, {0x13, 0x15}, {0x14, 0x13}, {0x14, 0x13},
   {0x15, 0x12}, {0x14, 0x14}, {0x14, 0x14}, {0x14, 0x15},
   {0x14, 0x15}, {0x15, 0x14}, {0x15, 0x14}, {0x15, 0x14},
   {0x16, 0x13}, {0x15, 0x15}, {0x15, 0x15}, {0x15, 0x16},
   {0x14, 0x18}, {0x16, 0x15}, {0x16, 0x15}, {0x16, 0x15},
   {0x16, 0x16}, {0x16, 0x16}, {0x16, 0x16}, {0x16, 0x17},
   {0x15, 0x19}, {0x17, 0x16}, {0x17, 0x16}, {0x18, 0x14},
   {0x17, 0x17}, {0x17, 0x17}, {0x17, 0x17}, {0x17, 0x18},
   {0x17, 0x18}, {0x17, 0x18}, {0x17, 0x19}, {0x18, 0x17},
   {0x18, 0x17}, {0x19, 0x16}, {0x18, 0x18}, {0x18, 0x18},
   {0x18, 0x19}, {0x18, 0x19}, {0x19, 0x18}, {0x19, 0x18},
   {0x19, 0x18}, {0x1a, 0x17}, {0x19, 0x19}, {0x19, 0x19},
   {0x19, 0x1a}, {0x18, 0x1c}, {0x1a, 0x19}, {0x1a, 0x19},
   {0x1a, 0x19}, {0x1a, 0x1a}, {0x1a, 0x1a}, {0x1a, 0x1a},
   {0x1a, 0x1b}, {0x19, 0x1d}, {0x1b, 0x1a}, {0x1b, 0x1a},
   {0x1c, 0x18}, {0x1b, 0x1b}, {0x1b, 0x1b}, {0x1b, 0x1b},
   {0x1b, 0x1c}, {0x1b, 0x1c}, {0x1b, 0x1c}, {0x1b, 0x1d},
   {0x1c, 0x1b}, {0x1c, 0x1b}, {0x1d, 0x1a}, {0x1c, 0x1c},
   {0x1c, 0x1c}, {0x1c, 0x1d}, {0x1c, 0x1d}, {0x1d, 0x1c},
   {0x1d, 0x1c}, {0x1d, 0x1c}, {0x1e, 0x1b}, {0x1d, 0x1d},
   {0x1d, 0x1d}, {0x1d, 0x1e}, {0x1d, 0x1e}, {0x1e, 0x1d},
   {0x1e, 0x1d}, {0x1e, 0x1d}, {0x1e, 0x1e}, {0x1e, 0x1e},
   {0x1e, 0x1e}, {0x1e, 0x1f}, {0x1e, 0x1f}, {0x1f, 0x1e},
   {0x1f, 0x1e}, {0x1f, 0x1e}, {0x1f, 0x1f}, {0x1f, 0x1f},
};

static const unsigned char omatch6[256][2] =
{
   {0x00, 0x00}, {0x00, 0x01}, {0x01, 0x00}, {0x01, 0x01},
   {0x01, 0x01}, {0x01, 0x02}, {0x02, 0x01}, {0x02, 0x02},
   {0x02, 0x02}, {0x02, 0x03}, {0x03, 0x02}, {0x03, 0x03},
   {0x03, 0x03}, {0x03, 0x04}, {0x04, 0x03}, {0x04, 0x04},
   {0x04, 0x04}, {0x04, 0x05}, {0x05, 0x04}, {0x05, 0x05},
   {0x05, 0x05}, {0x05, 0x06}, {0x06, 0x05}, {0x00, 0x11},
   {0x06, 0x06}, {0x06, 0x07}, {0x07, 0x06}, {0x02, 0x10},
   {0x07, 0x07}, {0x07, 0x08}, {0x08, 0x07}, {0x03, 0x11},
   {0x08, 0x08}, {0x08, 0x09}, {0x09, 0x08}, {0x05, 0x10},
   {0x09, 0x09}, {0x09, 0x0a}, {0x0a, 0x09}, {0x06, 0x11},
   {0x0a, 0x0a}, {0x0a, 0x0b}, {0x0b, 0x0a}, {0x08, 0x10},
   {0x0b, 0x0b}, {0x0b, 0x0c}, {0x0c, 0x0b}, {0x09, 0x11},
   {0x0c, 0x0c}, {0x0c, 0x0d}, {0x0d, 0x0c}, {0x0b, 0x10},
   {0x0d, 0x0d}, {0x0d, 0x0e}, {0x0e, 0x0d}, {0x0c, 0x11},
   {0x0e, 0x0e}, {0x0e, 0x0f}, {0x0f, 0x0e}, {0x0e, 0x10},
   {0x0f, 0x0f}, {0x0f, 0x10}, {0x10, 0x0e}, {0x10, 0x0f},
   {0x11, 0x0e}, {0x10, 0x10}, {0x10, 0x11}, {0x11, 0x10},
   {0x12, 0x0f}, {0x11, 0x11}, {0x11, 0x12}, {0x12, 0x11},
   {0x14, 0x0e}, {0x12, 0x12}, {0x12, 0x13}, {0x13, 0x12},
   {0x15, 0x0f}, {0x13, 0x13}, {0x13, 0x14}, {0x14, 0x13},
   {0x17, 0x0e}, {0x14, 0x14}, {0x14, 0x15}, {0x15, 0x14},
   {0x18, 0x0f}, {0x15, 0x15}, {0x15, 0x16}, {0x16, 0x15},
   {0x1a, 0x0e}, {0x16, 0x16}, {0x16, 0x17}, {0x17, 0x16},
   {0x1b, 0x0f}, {0x17, 0x17}, {0x17, 0x18}, {0x18, 0x17},
   {0x13, 0x21}, {0x18, 0x18}, {0x18, 0x19}, {0x19, 0x18},
   {0x15, 0x20}, {0x19, 0x19}, {0x19, 0x1a}, {0x1a, 0x19},
   {0x16, 0x21}, {0x1a, 0x1a}, {0x1a, 0x1b}, {0x1b, 0x1a},
   {0x18, 0x20}, {0x1b, 0x1b}, {0x1b, 0x1c}, {0x1c, 0x1b},
   {0x19, 0x21}, {0x1c, 0x1c}, {0x1c, 0x1d}, {0x1d, 0x1c},
   {0x1b, 0x20}, {0x1d, 0x1d}, {0x1d, 0x1e}, {0x1e, 0x1d},
   {0x1c, 0x21}, {0x1e, 0x1e}, {0x1e, 0x1f}, {0x1f, 0x1e},
   {0x1e, 0x20}, {0x1f, 0x1f}, {0x1f, 0x20}, {0x20, 0x1e},
   {0x20, 0x1f}, {0x21, 0x1e}, {0x20, 0x20}, {0x20, 0x21},
   {0x21, 0x20}, {0x22, 0x1f}, {0x21, 0x21}, {0x21, 0x22},
   {0x22, 0x21}, {0x24, 0x1e}, {0x22, 0x22}, {0x22, 0x23},
   {0x23, 0x22}, {0x25, 0x1f}, {0x23, 0x23}, {0x23, 0x24},
   {0x24, 0x23}, {0x27, 0x1e}, {0x24, 0x24}, {0x24, 0x25},
   {0x25, 0x24}, {0x28, 0x1f}, {0x25, 0x25}, {0x25, 0x26},
   {0x26, 0x25}, {0x2a, 0x1e}, {0x26, 0x26}, {0x26, 0x27},
   {0x27, 0x26}, {0x2b, 0x1f}, {0x27, 0x27}, {0x27, 0x28},
   {0x28, 0x27}, {0x23, 0x31}, {0x28, 0x28}, {0x28, 0x29},
   {0x29, 0x28}, {0x25, 0x30}, {0x29, 0x29}, {0x29, 0x2a},
   {0x2a, 0x29}, {0x26, 0x31}, {0x2a, 0x2a}, {0x2a, 0x2b},
   {0x2b, 0x2a}, {0x28, 0x30}, {0x2b, 0x2b}, {0x2b, 0x2c},
   {0x2c, 0x2b}, {0x29, 0x31}, {0x2c, 0x2c}, {0x2c, 0x2d},
   {0x2d, 0x2c}, {0x2b, 0x30}, {0x2d, 0x2d}, {0x2d, 0x2e},
   {0x2e, 0x2d}, {0x2c, 0x31}, {0x2e, 0x2e}, {0x2e, 0x2f},
   {0x2f, 0x2e}, {0x2e, 0x30}, {0x2f, 0x2f}, {0x2f, 0x30},
   {0x30, 0x2e}, {0x30, 0x2f}, {0x31, 0x2e}, {0x30, 0x30},
   {0x30, 0x31}, {0x31, 0x30}, {0x32, 0x2f}, {0x31, 0x31},
   {0x31, 0x32}, {0x32, 0x31}, {0x34, 0x2e}, {0x32, 0x32},
   {0x32, 0x33}, {0x33, 0x32}, {0x35, 0x2f}, {0x33, 0x33},
   {0x33, 0x34}, {0x34, 0x33}, {0x37, 0x2e}, {0x34, 0x34},
   {0x34, 0x35}, {0x35, 0x34}, {0x38, 0x2f}, {0x35, 0x35},
   {0x35, 0x36}, {0x36, 0x35}, {0x3a, 0x2e}, {0x36, 0x36},
   {0x36, 0x37}, {0x37, 0x36}, {0x3b, 0x2f}, {0x37, 0x37},
   {0x37, 0x38}, {0x38, 0x37}, {0x3d, 0x2e}, {0x38, 0x38},
   {0x38, 0x39}, {0x39, 0x38}, {0x3e, 0x2f}, {0x39, 0x39},
   {0x39, 0x3a}, {0x3a, 0x39}, {0x3a, 0x3a}, {0x3a, 0x3a},
   {0x3a, 0x3b}, {0x3b, 0x3a}, {0x3b, 0x3b}, {0x3b, 0x3b},
   {0x3b, 0x3c}, {0x3c, 0x3b}, {0x3c, 0x3c}, {0x3c, 0x3c},
   {0x3c, 0x3d}, {0x3d, 0x3c}, {0x3d, 0x3d}, {0x3d, 0x3d},
   {0x3d, 0x3e}, {0x3e, 0x3d}, {0x3e, 0x3e}, {0x3e, 0x3e},
   {0x3e, 0x3f}, {0x3f, 0x3e}, {0x3f, 0x3f}, {0x3f, 0x3f},
};

#endif /* __DXT_TABLES_H__ */