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