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

Side by Side Diff: third_party/brotli/enc/block_splitter.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/bit_cost.h ('k') | third_party/brotli/enc/block_splitter.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 2013 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 // Block split point selection utilities.
8
9 #ifndef BROTLI_ENC_BLOCK_SPLITTER_H_
10 #define BROTLI_ENC_BLOCK_SPLITTER_H_
11
12 #include <vector>
13
14 #include "./command.h"
15 #include "./metablock.h"
16 #include "./types.h"
17
18 namespace brotli {
19
20 struct BlockSplitIterator {
21 explicit BlockSplitIterator(const BlockSplit& split)
22 : split_(split), idx_(0), type_(0), length_(0) {
23 if (!split.lengths.empty()) {
24 length_ = split.lengths[0];
25 }
26 }
27
28 void Next(void) {
29 if (length_ == 0) {
30 ++idx_;
31 type_ = split_.types[idx_];
32 length_ = split_.lengths[idx_];
33 }
34 --length_;
35 }
36
37 const BlockSplit& split_;
38 size_t idx_;
39 size_t type_;
40 size_t length_;
41 };
42
43 void CopyLiteralsToByteArray(const Command* cmds,
44 const size_t num_commands,
45 const uint8_t* data,
46 const size_t offset,
47 const size_t mask,
48 std::vector<uint8_t>* literals);
49
50 void SplitBlock(const Command* cmds,
51 const size_t num_commands,
52 const uint8_t* data,
53 const size_t offset,
54 const size_t mask,
55 BlockSplit* literal_split,
56 BlockSplit* insert_and_copy_split,
57 BlockSplit* dist_split);
58
59 } // namespace brotli
60
61 #endif // BROTLI_ENC_BLOCK_SPLITTER_H_
OLDNEW
« no previous file with comments | « third_party/brotli/enc/bit_cost.h ('k') | third_party/brotli/enc/block_splitter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698