block_splitter.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright 2013 Google Inc. All Rights Reserved.
  2. Distributed under MIT license.
  3. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
  4. */
  5. /* Block split point selection utilities. */
  6. #ifndef BROTLI_ENC_BLOCK_SPLITTER_H_
  7. #define BROTLI_ENC_BLOCK_SPLITTER_H_
  8. #include "../common/platform.h"
  9. #include <brotli/types.h>
  10. #include "./command.h"
  11. #include "./memory.h"
  12. #include "./quality.h"
  13. #if defined(__cplusplus) || defined(c_plusplus)
  14. extern "C" {
  15. #endif
  16. typedef struct BlockSplit {
  17. size_t num_types; /* Amount of distinct types */
  18. size_t num_blocks; /* Amount of values in types and length */
  19. uint8_t* types;
  20. uint32_t* lengths;
  21. size_t types_alloc_size;
  22. size_t lengths_alloc_size;
  23. } BlockSplit;
  24. BROTLI_INTERNAL void BrotliInitBlockSplit(BlockSplit* self);
  25. BROTLI_INTERNAL void BrotliDestroyBlockSplit(MemoryManager* m,
  26. BlockSplit* self);
  27. BROTLI_INTERNAL void BrotliSplitBlock(MemoryManager* m,
  28. const Command* cmds,
  29. const size_t num_commands,
  30. const uint8_t* data,
  31. const size_t offset,
  32. const size_t mask,
  33. const BrotliEncoderParams* params,
  34. BlockSplit* literal_split,
  35. BlockSplit* insert_and_copy_split,
  36. BlockSplit* dist_split);
  37. #if defined(__cplusplus) || defined(c_plusplus)
  38. } /* extern "C" */
  39. #endif
  40. #endif /* BROTLI_ENC_BLOCK_SPLITTER_H_ */