OLD | NEW |
1 /* Copyright 2013 Google Inc. All Rights Reserved. | 1 /* Copyright 2013 Google Inc. All Rights Reserved. |
2 | 2 |
3 Distributed under MIT license. | 3 Distributed under MIT license. |
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT | 4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
5 */ | 5 */ |
6 | 6 |
7 /* Lookup table to map the previous two bytes to a context id. | 7 /* Lookup table to map the previous two bytes to a context id. |
8 | 8 |
9 There are four different context modeling modes defined here: | 9 There are four different context modeling modes defined here: |
10 CONTEXT_LSB6: context id is the least significant 6 bits of the last byte, | 10 CONTEXT_LSB6: context id is the least significant 6 bits of the last byte, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 together two lookups from one table using context model dependent offsets: | 92 together two lookups from one table using context model dependent offsets: |
93 | 93 |
94 context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2]. | 94 context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2]. |
95 | 95 |
96 where offset1 and offset2 are dependent on the context mode. | 96 where offset1 and offset2 are dependent on the context mode. |
97 */ | 97 */ |
98 | 98 |
99 #ifndef BROTLI_DEC_CONTEXT_H_ | 99 #ifndef BROTLI_DEC_CONTEXT_H_ |
100 #define BROTLI_DEC_CONTEXT_H_ | 100 #define BROTLI_DEC_CONTEXT_H_ |
101 | 101 |
102 #include "./types.h" | 102 #include <brotli/types.h> |
103 | 103 |
104 enum ContextType { | 104 enum ContextType { |
105 CONTEXT_LSB6 = 0, | 105 CONTEXT_LSB6 = 0, |
106 CONTEXT_MSB6 = 1, | 106 CONTEXT_MSB6 = 1, |
107 CONTEXT_UTF8 = 2, | 107 CONTEXT_UTF8 = 2, |
108 CONTEXT_SIGNED = 3 | 108 CONTEXT_SIGNED = 3 |
109 }; | 109 }; |
110 | 110 |
111 /* Common context lookup table for all context modes. */ | 111 /* Common context lookup table for all context modes. */ |
112 static const uint8_t kContextLookup[1792] = { | 112 static const uint8_t kContextLookup[1792] = { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 1024, 1536, | 242 1024, 1536, |
243 /* CONTEXT_MSB6 */ | 243 /* CONTEXT_MSB6 */ |
244 1280, 1536, | 244 1280, 1536, |
245 /* CONTEXT_UTF8 */ | 245 /* CONTEXT_UTF8 */ |
246 0, 256, | 246 0, 256, |
247 /* CONTEXT_SIGNED */ | 247 /* CONTEXT_SIGNED */ |
248 768, 512, | 248 768, 512, |
249 }; | 249 }; |
250 | 250 |
251 #endif /* BROTLI_DEC_CONTEXT_H_ */ | 251 #endif /* BROTLI_DEC_CONTEXT_H_ */ |
OLD | NEW |