Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: third_party/brotli/enc/compress_fragment.h

Issue 1956893002: Added brotli enc/ and tools/ directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to most recent build tools Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/brotli/enc/command.h ('k') | third_party/brotli/enc/compress_fragment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright 2015 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 // Function for fast encoding of an input fragment, independently from the input
8 // history. This function uses one-pass processing: when we find a backward
9 // match, we immediately emit the corresponding command and literal codes to
10 // the bit stream.
11
12 #ifndef BROTLI_ENC_COMPRESS_FRAGMENT_H_
13 #define BROTLI_ENC_COMPRESS_FRAGMENT_H_
14
15 #include "./types.h"
16
17 namespace brotli {
18
19 // Compresses "input" string to the "*storage" buffer as one or more complete
20 // meta-blocks, and updates the "*storage_ix" bit position.
21 //
22 // If "is_last" is true, emits an additional empty last meta-block.
23 //
24 // "cmd_depth" and "cmd_bits" contain the command and distance prefix codes
25 // (see comment in encode.h) used for the encoding of this input fragment.
26 // If "is_last" is false, they are updated to reflect the statistics
27 // of this input fragment, to be used for the encoding of the next fragment.
28 //
29 // "*cmd_code_numbits" is the number of bits of the compressed representation
30 // of the command and distance prefix codes, and "cmd_code" is an array of
31 // at least "(*cmd_code_numbits + 7) >> 3" size that contains the compressed
32 // command and distance prefix codes. If "is_last" is false, these are also
33 // updated to represent the updated "cmd_depth" and "cmd_bits".
34 //
35 // REQUIRES: "input_size" is greater than zero, or "is_last" is true.
36 // REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
37 // REQUIRES: "table_size" is a power of two
38 void BrotliCompressFragmentFast(const uint8_t* input, size_t input_size,
39 bool is_last,
40 int* table, size_t table_size,
41 uint8_t cmd_depth[128], uint16_t cmd_bits[128],
42 size_t* cmd_code_numbits, uint8_t* cmd_code,
43 size_t* storage_ix, uint8_t* storage);
44
45 } // namespace brotli
46
47 #endif // BROTLI_ENC_COMPRESS_FRAGMENT_H_
OLDNEW
« no previous file with comments | « third_party/brotli/enc/command.h ('k') | third_party/brotli/enc/compress_fragment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698