Index: third_party/brotli/enc/block_splitter.h |
diff --git a/third_party/brotli/enc/block_splitter.h b/third_party/brotli/enc/block_splitter.h |
index 4f69296808e4918949eb950ade0ece1a987c6fe2..6abac08d295c58836c73329649b7c4b053d7829a 100644 |
--- a/third_party/brotli/enc/block_splitter.h |
+++ b/third_party/brotli/enc/block_splitter.h |
@@ -4,58 +4,48 @@ |
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
*/ |
-// Block split point selection utilities. |
+/* Block split point selection utilities. */ |
#ifndef BROTLI_ENC_BLOCK_SPLITTER_H_ |
#define BROTLI_ENC_BLOCK_SPLITTER_H_ |
-#include <vector> |
- |
+#include <brotli/types.h> |
#include "./command.h" |
-#include "./metablock.h" |
-#include "./types.h" |
- |
-namespace brotli { |
- |
-struct BlockSplitIterator { |
- explicit BlockSplitIterator(const BlockSplit& split) |
- : split_(split), idx_(0), type_(0), length_(0) { |
- if (!split.lengths.empty()) { |
- length_ = split.lengths[0]; |
- } |
- } |
- |
- void Next(void) { |
- if (length_ == 0) { |
- ++idx_; |
- type_ = split_.types[idx_]; |
- length_ = split_.lengths[idx_]; |
- } |
- --length_; |
- } |
- |
- const BlockSplit& split_; |
- size_t idx_; |
- size_t type_; |
- size_t length_; |
-}; |
- |
-void CopyLiteralsToByteArray(const Command* cmds, |
- const size_t num_commands, |
- const uint8_t* data, |
- const size_t offset, |
- const size_t mask, |
- std::vector<uint8_t>* literals); |
- |
-void SplitBlock(const Command* cmds, |
- const size_t num_commands, |
- const uint8_t* data, |
- const size_t offset, |
- const size_t mask, |
- BlockSplit* literal_split, |
- BlockSplit* insert_and_copy_split, |
- BlockSplit* dist_split); |
- |
-} // namespace brotli |
- |
-#endif // BROTLI_ENC_BLOCK_SPLITTER_H_ |
+#include "./memory.h" |
+#include "./port.h" |
+#include "./quality.h" |
+ |
+#if defined(__cplusplus) || defined(c_plusplus) |
+extern "C" { |
+#endif |
+ |
+typedef struct BlockSplit { |
+ size_t num_types; /* Amount of distinct types */ |
+ size_t num_blocks; /* Amount of values in types and length */ |
+ uint8_t* types; |
+ uint32_t* lengths; |
+ |
+ size_t types_alloc_size; |
+ size_t lengths_alloc_size; |
+} BlockSplit; |
+ |
+BROTLI_INTERNAL void BrotliInitBlockSplit(BlockSplit* self); |
+BROTLI_INTERNAL void BrotliDestroyBlockSplit(MemoryManager* m, |
+ BlockSplit* self); |
+ |
+BROTLI_INTERNAL void BrotliSplitBlock(MemoryManager* m, |
+ const Command* cmds, |
+ const size_t num_commands, |
+ const uint8_t* data, |
+ const size_t offset, |
+ const size_t mask, |
+ const BrotliEncoderParams* params, |
+ BlockSplit* literal_split, |
+ BlockSplit* insert_and_copy_split, |
+ BlockSplit* dist_split); |
+ |
+#if defined(__cplusplus) || defined(c_plusplus) |
+} /* extern "C" */ |
+#endif |
+ |
+#endif /* BROTLI_ENC_BLOCK_SPLITTER_H_ */ |