block_splitter.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/types.h"
  9. #include "./command.h"
  10. #include "./memory.h"
  11. #include "./port.h"
  12. #if defined(__cplusplus) || defined(c_plusplus)
  13. extern "C" {
  14. #endif
  15. typedef struct BlockSplit {
  16. size_t num_types; /* Amount of distinct types */
  17. size_t num_blocks; /* Amount of values in types and length */
  18. uint8_t* types;
  19. uint32_t* lengths;
  20. size_t types_alloc_size;
  21. size_t lengths_alloc_size;
  22. } BlockSplit;
  23. BROTLI_INTERNAL void BrotliInitBlockSplit(BlockSplit* self);
  24. BROTLI_INTERNAL void BrotliDestroyBlockSplit(MemoryManager* m,
  25. BlockSplit* self);
  26. BROTLI_INTERNAL void BrotliSplitBlock(MemoryManager* m,
  27. const Command* cmds,
  28. const size_t num_commands,
  29. const uint8_t* data,
  30. const size_t offset,
  31. const size_t mask,
  32. const int quality,
  33. BlockSplit* literal_split,
  34. BlockSplit* insert_and_copy_split,
  35. BlockSplit* dist_split);
  36. #if defined(__cplusplus) || defined(c_plusplus)
  37. } /* extern "C" */
  38. #endif
  39. #endif /* BROTLI_ENC_BLOCK_SPLITTER_H_ */