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

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

Issue 1956893002: Added brotli enc/ and tools/ directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split large file into 2, fixed Windows build issue 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
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 two-pass processing: in the first pass we save
9 // the found backward matches and literal bytes into a buffer, and in the
10 // second pass we emit them into the bit stream using prefix codes built based
11 // on the actual command and literal byte histograms.
12
13 #ifndef BROTLI_ENC_COMPRESS_FRAGMENT_TWO_PASS_H_
14 #define BROTLI_ENC_COMPRESS_FRAGMENT_TWO_PASS_H_
15
16 #include "./types.h"
17
18 namespace brotli {
19
20 static const size_t kCompressFragmentTwoPassBlockSize = 1 << 17;
21
22 // Compresses "input" string to the "*storage" buffer as one or more complete
23 // meta-blocks, and updates the "*storage_ix" bit position.
24 //
25 // If "is_last" is true, emits an additional empty last meta-block.
26 //
27 // REQUIRES: "input_size" is greater than zero, or "is_last" is true.
28 // REQUIRES: "command_buf" and "literal_buf" point to at least
29 // kCompressFragmentTwoPassBlockSize long arrays.
30 // REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
31 // REQUIRES: "table_size" is a power of two
32 void BrotliCompressFragmentTwoPass(const uint8_t* input, size_t input_size,
33 bool is_last,
34 uint32_t* command_buf, uint8_t* literal_buf,
35 int* table, size_t table_size,
36 size_t* storage_ix, uint8_t* storage);
37
38 } // namespace brotli
39
40 #endif // BROTLI_ENC_COMPRESS_FRAGMENT_TWO_PASS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698