1 pub const VERSION_VP60: u8 = 6;
2 //pub const VERSION_VP61: u8 = 7;
3 pub const VERSION_VP62: u8 = 8;
5 pub const VP6_SIMPLE_PROFILE: u8 = 0;
6 pub const VP6_ADVANCED_PROFILE: u8 = 3;
8 pub const LONG_VECTOR_ORDER: [usize; 7] = [ 0, 1, 2, 7, 6, 5, 4 ];
10 pub const NZ_PROBS: [u8; 2] = [ 162, 164 ];
11 pub const RAW_PROBS: [[u8; 8]; 2] = [
12 [ 247, 210, 135, 68, 138, 220, 239, 246 ],
13 [ 244, 184, 201, 44, 173, 221, 239, 253 ]
15 pub const TREE_PROBS: [[u8; 7]; 2] = [
16 [ 225, 146, 172, 147, 214, 39, 156 ],
17 [ 204, 170, 119, 235, 140, 230, 228 ]
19 pub const ZERO_RUN_PROBS: [[u8; 14]; 2] = [
20 [ 198, 197, 196, 146, 198, 204, 169, 142, 130, 136, 149, 149, 191, 249 ],
21 [ 135, 201, 181, 154, 98, 117, 132, 126, 146, 169, 184, 240, 246, 254 ]
24 pub const HAS_NZ_PROB: [u8; 2] = [ 237, 231 ];
25 pub const HAS_SIGN_PROB: [u8; 2] = [ 246, 243 ];
26 pub const HAS_TREE_PROB: [[u8; 7]; 2] = [
27 [ 253, 253, 254, 254, 254, 254, 254 ],
28 [ 245, 253, 254, 254, 254, 254, 254 ]
30 pub const HAS_RAW_PROB: [[u8; 8]; 2] = [
31 [ 254, 254, 254, 254, 254, 250, 250, 252 ],
32 [ 254, 254, 254, 254, 254, 251, 251, 254 ]
35 pub const HAS_COEF_PROBS: [[u8; 11]; 2] = [
36 [ 146, 255, 181, 207, 232, 243, 238, 251, 244, 250, 249 ],
37 [ 179, 255, 214, 240, 250, 255, 244, 255, 255, 255, 255 ]
39 pub const HAS_SCAN_UPD_PROBS: [u8; 64] = [
40 0, 132, 132, 159, 153, 151, 161, 170,
41 164, 162, 136, 110, 103, 114, 129, 118,
42 124, 125, 132, 136, 114, 110, 142, 135,
43 134, 123, 143, 126, 153, 183, 166, 161,
44 171, 180, 179, 164, 203, 218, 225, 217,
45 215, 206, 203, 217, 229, 241, 248, 243,
46 253, 255, 253, 255, 255, 255, 255, 255,
47 255, 255, 255, 255, 255, 255, 255, 255
49 pub const HAS_ZERO_RUN_PROBS: [[u8; 14]; 2] = [
50 [ 219, 246, 238, 249, 232, 239, 249, 255, 248, 253, 239, 244, 241, 248 ],
51 [ 198, 232, 251, 253, 219, 241, 253, 255, 248, 249, 244, 238, 251, 255 ]
54 pub const VP6_AC_PROBS: [[[[u8; 11]; 6]; 2]; 3] = [
57 [ 227, 246, 230, 247, 244, 255, 255, 255, 255, 255, 255 ],
58 [ 255, 255, 209, 231, 231, 249, 249, 253, 255, 255, 255 ],
59 [ 255, 255, 225, 242, 241, 251, 253, 255, 255, 255, 255 ],
60 [ 255, 255, 241, 253, 252, 255, 255, 255, 255, 255, 255 ],
61 [ 255, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 ],
62 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ]
64 [ 240, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 ],
65 [ 255, 255, 240, 253, 255, 255, 255, 255, 255, 255, 255 ],
66 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
67 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
68 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
69 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ]
73 [ 206, 203, 227, 239, 247, 255, 253, 255, 255, 255, 255 ],
74 [ 207, 199, 220, 236, 243, 252, 252, 255, 255, 255, 255 ],
75 [ 212, 219, 230, 243, 244, 253, 252, 255, 255, 255, 255 ],
76 [ 236, 237, 247, 252, 253, 255, 255, 255, 255, 255, 255 ],
77 [ 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255 ],
78 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ]
80 [ 230, 233, 249, 255, 255, 255, 255, 255, 255, 255, 255 ],
81 [ 238, 238, 250, 255, 255, 255, 255, 255, 255, 255, 255 ],
82 [ 248, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
83 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
84 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
85 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ]
89 [ 225, 239, 227, 231, 244, 253, 243, 255, 255, 253, 255 ],
90 [ 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 255 ],
91 [ 235, 249, 238, 240, 251, 255, 249, 255, 253, 253, 255 ],
92 [ 249, 253, 251, 250, 255, 255, 255, 255, 255, 255, 255 ],
93 [ 251, 250, 249, 255, 255, 255, 255, 255, 255, 255, 255 ],
94 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ]
96 [ 243, 244, 250, 250, 255, 255, 255, 255, 255, 255, 255 ],
97 [ 249, 248, 250, 253, 255, 255, 255, 255, 255, 255, 255 ],
98 [ 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
99 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
100 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ],
101 [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ]
106 pub const VP6_DC_WEIGHTS: [[[i16; 2]; 3]; 5] = [
107 [ [ 122, 133 ], [ 133, 51 ], [ 142, -16 ] ],
108 [ [ 0, 1 ], [ 0, 1 ], [ 0, 1 ] ],
109 [ [ 78, 171 ], [ 169, 71 ], [ 221, -30 ] ],
110 [ [ 139, 117 ], [ 214, 44 ], [ 246, -3 ] ],
111 [ [ 168, 79 ], [ 210, 38 ], [ 203, 17 ] ]
114 pub const VP6_IDX_TO_AC_BAND: [usize; 64] = [
115 0, 0, 1, 1, 1, 2, 2, 2,
116 2, 2, 2, 3, 3, 3, 3, 3,
117 3, 3, 3, 3, 3, 3, 4, 4,
118 4, 4, 4, 4, 4, 4, 4, 4,
119 4, 4, 4, 4, 4, 5, 5, 5,
120 5, 5, 5, 5, 5, 5, 5, 5,
121 5, 5, 5, 5, 5, 5, 5, 5,
122 5, 5, 5, 5, 5, 5, 5, 5
125 pub const VP6_BICUBIC_COEFFS: [[[i16; 4]; 8]; 17] = [
183 [ -10, 111, 30, -3 ],
187 [ -3, 30, 111, -10 ],
192 [ -11, 112, 31, -4 ],
194 [ -10, 74, 74, -10 ],
196 [ -4, 31, 112, -11 ],
201 [ -12, 112, 32, -4 ],
203 [ -10, 74, 74, -10 ],
205 [ -4, 32, 112, -12 ],
210 [ -13, 112, 33, -4 ],
212 [ -11, 75, 75, -11 ],
214 [ -4, 33, 112, -13 ],
219 [ -14, 113, 34, -5 ],
221 [ -12, 76, 76, -12 ],
223 [ -5, 34, 112, -13 ],
227 [ -10, 124, 15, -1 ],
228 [ -14, 113, 34, -5 ],
230 [ -13, 77, 77, -13 ],
232 [ -5, 34, 113, -14 ],
236 [ -10, 123, 16, -1 ],
237 [ -15, 113, 35, -5 ],
238 [ -16, 98, 56, -10 ],
239 [ -14, 78, 78, -14 ],
240 [ -10, 56, 98, -16 ],
241 [ -5, 35, 113, -15 ],
245 [ -11, 124, 17, -2 ],
246 [ -16, 113, 36, -5 ],
247 [ -17, 98, 57, -10 ],
248 [ -14, 78, 78, -14 ],
249 [ -10, 57, 98, -17 ],
250 [ -5, 36, 113, -16 ],
254 [ -12, 125, 17, -2 ],
255 [ -17, 114, 37, -6 ],
256 [ -18, 99, 58, -11 ],
257 [ -15, 79, 79, -15 ],
258 [ -11, 58, 99, -18 ],
259 [ -6, 37, 114, -17 ],
263 [ -12, 124, 18, -2 ],
264 [ -18, 114, 38, -6 ],
265 [ -19, 99, 59, -11 ],
266 [ -16, 80, 80, -16 ],
267 [ -11, 59, 99, -19 ],
268 [ -6, 38, 114, -18 ],
282 pub const VP6_DEFAULT_SCAN_ORDER: [usize; 64] = [
283 0, 0, 1, 1, 1, 2, 2, 2,
284 2, 2, 2, 3, 3, 4, 4, 4,
285 5, 5, 5, 5, 6, 6, 7, 7,
286 7, 7, 7, 8, 8, 9, 9, 9,
287 9, 9, 9, 10, 10, 11, 11, 11,
288 11, 11, 11, 12, 12, 12, 12, 12,
289 12, 13, 13, 13, 13, 13, 14, 14,
290 14, 14, 15, 15, 15, 15, 15, 15
292 pub const VP6_INTERLACED_SCAN_ORDER: [usize; 64] = [
293 0, 1, 0, 1, 1, 2, 5, 3,
294 2, 2, 2, 2, 4, 7, 8, 10,
295 9, 7, 5, 4, 2, 3, 5, 6,
296 8, 9, 11, 12, 13, 12, 11, 10,
297 9, 7, 5, 4, 6, 7, 9, 11,
298 12, 12, 13, 13, 14, 12, 11, 9,
299 7, 9, 11, 12, 14, 14, 14, 15,
300 13, 11, 13, 15, 15, 15, 15, 15
303 pub const VP6_COEF_ADD_BITS: [u8; 6] = [ 1, 2, 3, 4, 5, 11 ];