Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
brotli_bit_stream.h
Go to the documentation of this file.
1/* Copyright 2014 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/* Functions to convert brotli-related data structures into the
8 brotli bit stream. The functions here operate under
9 assumption that there is enough space in the storage, i.e., there are
10 no out-of-range checks anywhere.
11
12 These functions do bit addressing into a byte array. The byte array
13 is called "storage" and the index to the bit is called storage_ix
14 in function arguments. */
15
16#ifndef BROTLI_ENC_BROTLI_BIT_STREAM_H_
17#define BROTLI_ENC_BROTLI_BIT_STREAM_H_
18
19#include "../common/context.h"
20#include "../common/platform.h"
21#include <brotli/types.h>
22#include "./command.h"
23#include "./entropy_encode.h"
24#include "./memory.h"
25#include "./metablock.h"
26
27#if defined(__cplusplus) || defined(c_plusplus)
28extern "C" {
29#endif
30
31/* All Store functions here will use a storage_ix, which is always the bit
32 position for the current storage. */
33
34BROTLI_INTERNAL void BrotliStoreHuffmanTree(const uint8_t* depths, size_t num,
35 HuffmanTree* tree, size_t* storage_ix, uint8_t* storage);
36
38 MemoryManager* m, const uint32_t* histogram, const size_t histogram_total,
39 const size_t max_bits, uint8_t* depth, uint16_t* bits, size_t* storage_ix,
40 uint8_t* storage);
41
42/* REQUIRES: length > 0 */
43/* REQUIRES: length <= (1 << 24) */
45 const uint8_t* input, size_t start_pos, size_t length, size_t mask,
46 uint8_t prev_byte, uint8_t prev_byte2, BROTLI_BOOL is_last,
47 const BrotliEncoderParams* params, ContextType literal_context_mode,
48 const Command* commands, size_t n_commands, const MetaBlockSplit* mb,
49 size_t* storage_ix, uint8_t* storage);
50
51/* Stores the meta-block without doing any block splitting, just collects
52 one histogram per block category and uses that for entropy coding.
53 REQUIRES: length > 0
54 REQUIRES: length <= (1 << 24) */
56 const uint8_t* input, size_t start_pos, size_t length, size_t mask,
57 BROTLI_BOOL is_last, const BrotliEncoderParams* params,
58 const Command* commands, size_t n_commands,
59 size_t* storage_ix, uint8_t* storage);
60
61/* Same as above, but uses static prefix codes for histograms with a only a few
62 symbols, and uses static code length prefix codes for all other histograms.
63 REQUIRES: length > 0
64 REQUIRES: length <= (1 << 24) */
66 const uint8_t* input, size_t start_pos, size_t length, size_t mask,
67 BROTLI_BOOL is_last, const BrotliEncoderParams* params,
68 const Command* commands, size_t n_commands,
69 size_t* storage_ix, uint8_t* storage);
70
71/* This is for storing uncompressed blocks (simple raw storage of
72 bytes-as-bytes).
73 REQUIRES: length > 0
74 REQUIRES: length <= (1 << 24) */
76 BROTLI_BOOL is_final_block, const uint8_t* BROTLI_RESTRICT input,
77 size_t position, size_t mask, size_t len,
78 size_t* BROTLI_RESTRICT storage_ix, uint8_t* BROTLI_RESTRICT storage);
79
80#if defined(__cplusplus) || defined(c_plusplus)
81} /* extern "C" */
82#endif
83
84#endif /* BROTLI_ENC_BROTLI_BIT_STREAM_H_ */
ContextType
Definition context.h:94
BROTLI_INTERNAL void BrotliStoreMetaBlockTrivial(MemoryManager *m, const uint8_t *input, size_t start_pos, size_t length, size_t mask, BROTLI_BOOL is_last, const BrotliEncoderParams *params, const Command *commands, size_t n_commands, size_t *storage_ix, uint8_t *storage)
Definition brotli_bit_stream.c:1134
BROTLI_INTERNAL void BrotliStoreMetaBlock(MemoryManager *m, const uint8_t *input, size_t start_pos, size_t length, size_t mask, uint8_t prev_byte, uint8_t prev_byte2, BROTLI_BOOL is_last, const BrotliEncoderParams *params, ContextType literal_context_mode, const Command *commands, size_t n_commands, const MetaBlockSplit *mb, size_t *storage_ix, uint8_t *storage)
Definition brotli_bit_stream.c:935
BROTLI_INTERNAL void BrotliStoreMetaBlockFast(MemoryManager *m, const uint8_t *input, size_t start_pos, size_t length, size_t mask, BROTLI_BOOL is_last, const BrotliEncoderParams *params, const Command *commands, size_t n_commands, size_t *storage_ix, uint8_t *storage)
Definition brotli_bit_stream.c:1187
BROTLI_INTERNAL void BrotliBuildAndStoreHuffmanTreeFast(MemoryManager *m, const uint32_t *histogram, const size_t histogram_total, const size_t max_bits, uint8_t *depth, uint16_t *bits, size_t *storage_ix, uint8_t *storage)
Definition brotli_bit_stream.c:403
BROTLI_INTERNAL void BrotliStoreUncompressedMetaBlock(BROTLI_BOOL is_final_block, const uint8_t *BROTLI_RESTRICT input, size_t position, size_t mask, size_t len, size_t *BROTLI_RESTRICT storage_ix, uint8_t *BROTLI_RESTRICT storage)
Definition brotli_bit_stream.c:1279
BROTLI_INTERNAL void BrotliStoreHuffmanTree(const uint8_t *depths, size_t num, HuffmanTree *tree, size_t *storage_ix, uint8_t *storage)
Definition brotli_bit_stream.c:283
#define input(b, o, c, n, m)
Definition compress42.c:610
Definition params.h:32
Definition command.h:107
Definition entropy_encode.h:20
Definition memory.h:26
Definition metablock.h:26
#define BROTLI_RESTRICT
Definition platform.h:105
#define BROTLI_INTERNAL
Definition platform.h:173
#define BROTLI_BOOL
Definition types.h:49
static uint32_t const uint8_t uint32_t len
Definition memcmplen.h:44