Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
compound_dictionary.h
Go to the documentation of this file.
1/* Copyright 2017 Google Inc. All Rights Reserved.
2
3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5*/
6
7#ifndef BROTLI_ENC_PREPARED_DICTIONARY_H_
8#define BROTLI_ENC_PREPARED_DICTIONARY_H_
9
10#include <brotli/shared_dictionary.h>
11#include <brotli/types.h>
12
13#include "../common/platform.h"
14#include "../common/constants.h"
15#include "memory.h"
16
17/* "Fat" prepared dictionary, could be cooked outside of C implementation,
18 * e.g. on Java side. LZ77 data is copied inside PreparedDictionary struct. */
19static const uint32_t kPreparedDictionaryMagic = 0xDEBCEDE0;
20
21static const uint32_t kSharedDictionaryMagic = 0xDEBCEDE1;
22
23static const uint32_t kManagedDictionaryMagic = 0xDEBCEDE2;
24
25/* "Lean" prepared dictionary. LZ77 data is referenced. It is the responsibility
26 * of caller of "prepare dictionary" to keep the LZ77 data while prepared
27 * dictionary is in use. */
28static const uint32_t kLeanPreparedDictionaryMagic = 0xDEBCEDE3;
29
30static const uint64_t kPreparedDictionaryHashMul64Long =
31 BROTLI_MAKE_UINT64_T(0x1FE35A7Bu, 0xD3579BD3u);
32
33typedef struct PreparedDictionary {
34 uint32_t magic;
35 uint32_t num_items;
36 uint32_t source_size;
37 uint32_t hash_bits;
38 uint32_t bucket_bits;
39 uint32_t slot_bits;
40
41 /* --- Dynamic size members --- */
42
43 /* uint32_t slot_offsets[1 << slot_bits]; */
44 /* uint16_t heads[1 << bucket_bits]; */
45 /* uint32_t items[variable]; */
46
47 /* [maybe] uint8_t* source_ref, depending on magic. */
48 /* [maybe] uint8_t source[source_size], depending on magic. */
50
52 const uint8_t* source, size_t source_size);
53
56
70
73
74#endif /* BROTLI_ENC_PREPARED_DICTIONARY */
BROTLI_INTERNAL PreparedDictionary * CreatePreparedDictionary(MemoryManager *m, const uint8_t *source, size_t source_size)
Definition compound_dictionary.c:153
struct CompoundDictionary CompoundDictionary
struct PreparedDictionary PreparedDictionary
BROTLI_INTERNAL void DestroyPreparedDictionary(MemoryManager *m, PreparedDictionary *dictionary)
Definition compound_dictionary.c:170
BROTLI_INTERNAL BROTLI_BOOL AttachPreparedDictionary(CompoundDictionary *compound, const PreparedDictionary *dictionary)
Definition compound_dictionary.c:176
#define SHARED_BROTLI_MAX_COMPOUND_DICTS
Definition shared_dictionary.h:22
const char * source
Definition lz4.h:808
Definition compound_dictionary.h:57
size_t num_chunks
Definition compound_dictionary.h:59
const uint8_t * chunk_source[SHARED_BROTLI_MAX_COMPOUND_DICTS+1]
Definition compound_dictionary.h:63
size_t chunk_offsets[SHARED_BROTLI_MAX_COMPOUND_DICTS+1]
Definition compound_dictionary.h:64
const PreparedDictionary * chunks[SHARED_BROTLI_MAX_COMPOUND_DICTS+1]
Definition compound_dictionary.h:62
size_t num_prepared_instances_
Definition compound_dictionary.h:66
PreparedDictionary * prepared_instances_[SHARED_BROTLI_MAX_COMPOUND_DICTS+1]
Definition compound_dictionary.h:68
size_t total_size
Definition compound_dictionary.h:60
Definition memory.h:26
Definition compound_dictionary.h:33
uint32_t num_items
Definition compound_dictionary.h:35
uint32_t bucket_bits
Definition compound_dictionary.h:38
uint32_t magic
Definition compound_dictionary.h:34
uint32_t slot_bits
Definition compound_dictionary.h:39
uint32_t source_size
Definition compound_dictionary.h:36
uint32_t hash_bits
Definition compound_dictionary.h:37
Definition zstd_decompress.c:306
#define BROTLI_INTERNAL
Definition platform.h:173
#define BROTLI_MAKE_UINT64_T(high, low)
Definition types.h:57
#define BROTLI_BOOL
Definition types.h:49