• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "../common/platform.h"
13 #include <brotli/types.h>
14 #include "./command.h"
15 #include "./memory.h"
16 #include "./quality.h"
17 
18 #if defined(__cplusplus) || defined(c_plusplus)
19 extern "C" {
20 #endif
21 
22 typedef struct BlockSplit {
23   size_t num_types;  /* Amount of distinct types */
24   size_t num_blocks;  /* Amount of values in types and length */
25   uint8_t* types;
26   uint32_t* lengths;
27 
28   size_t types_alloc_size;
29   size_t lengths_alloc_size;
30 } BlockSplit;
31 
32 BROTLI_INTERNAL void BrotliInitBlockSplit(BlockSplit* self);
33 BROTLI_INTERNAL void BrotliDestroyBlockSplit(MemoryManager* m,
34                                              BlockSplit* self);
35 
36 BROTLI_INTERNAL void BrotliSplitBlock(MemoryManager* m,
37                                       const Command* cmds,
38                                       const size_t num_commands,
39                                       const uint8_t* data,
40                                       const size_t offset,
41                                       const size_t mask,
42                                       const BrotliEncoderParams* params,
43                                       BlockSplit* literal_split,
44                                       BlockSplit* insert_and_copy_split,
45                                       BlockSplit* dist_split);
46 
47 #if defined(__cplusplus) || defined(c_plusplus)
48 }  /* extern "C" */
49 #endif
50 
51 #endif  /* BROTLI_ENC_BLOCK_SPLITTER_H_ */
52