2019-03-07 01:55:38 +03:00
|
|
|
package brotli
|
|
|
|
|
|
|
|
/* Dictionary data (words and transforms) for 1 possible context */
|
2019-03-16 03:24:40 +03:00
|
|
|
type encoderDictionary struct {
|
|
|
|
words *dictionary
|
2019-03-07 01:55:38 +03:00
|
|
|
cutoffTransformsCount uint32
|
|
|
|
cutoffTransforms uint64
|
|
|
|
hash_table []uint16
|
|
|
|
buckets []uint16
|
2019-03-16 04:00:20 +03:00
|
|
|
dict_words []dictWord
|
2019-03-07 01:55:38 +03:00
|
|
|
}
|
|
|
|
|
2019-03-16 03:24:40 +03:00
|
|
|
func initEncoderDictionary(dict *encoderDictionary) {
|
|
|
|
dict.words = getDictionary()
|
2019-03-07 01:55:38 +03:00
|
|
|
|
|
|
|
dict.hash_table = kStaticDictionaryHash[:]
|
|
|
|
dict.buckets = kStaticDictionaryBuckets[:]
|
|
|
|
dict.dict_words = kStaticDictionaryWords[:]
|
|
|
|
|
|
|
|
dict.cutoffTransformsCount = kCutoffTransformsCount
|
|
|
|
dict.cutoffTransforms = kCutoffTransforms
|
|
|
|
}
|