/src/duckdb/third_party/brotli/enc/command.h
Line | Count | Source (jump to first uncovered line) |
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 | | /* This class models a sequence of literals and a backward reference copy. */ |
8 | | |
9 | | #ifndef BROTLI_ENC_COMMAND_H_ |
10 | | #define BROTLI_ENC_COMMAND_H_ |
11 | | |
12 | | #include <brotli/types.h> |
13 | | |
14 | | #include "../common/brotli_constants.h" |
15 | | #include "../common/brotli_platform.h" |
16 | | #include "fast_log.h" |
17 | | #include "brotli_params.h" |
18 | | #include "prefix.h" |
19 | | |
20 | | namespace duckdb_brotli { |
21 | | |
22 | | BROTLI_INTERNAL extern const uint32_t |
23 | | kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES]; |
24 | | BROTLI_INTERNAL extern const uint32_t |
25 | | kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES]; |
26 | | BROTLI_INTERNAL extern const uint32_t |
27 | | kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES]; |
28 | | BROTLI_INTERNAL extern const uint32_t |
29 | | kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES]; |
30 | | |
31 | 0 | static BROTLI_INLINE uint16_t GetInsertLengthCode(size_t insertlen) { |
32 | 0 | if (insertlen < 6) { |
33 | 0 | return (uint16_t)insertlen; |
34 | 0 | } else if (insertlen < 130) { |
35 | 0 | uint32_t nbits = Log2FloorNonZero(insertlen - 2) - 1u; |
36 | 0 | return (uint16_t)((nbits << 1) + ((insertlen - 2) >> nbits) + 2); |
37 | 0 | } else if (insertlen < 2114) { |
38 | 0 | return (uint16_t)(Log2FloorNonZero(insertlen - 66) + 10); |
39 | 0 | } else if (insertlen < 6210) { |
40 | 0 | return 21u; |
41 | 0 | } else if (insertlen < 22594) { |
42 | 0 | return 22u; |
43 | 0 | } else { |
44 | 0 | return 23u; |
45 | 0 | } |
46 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: command.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetInsertLengthCode(unsigned long) |
47 | | |
48 | 0 | static BROTLI_INLINE uint16_t GetCopyLengthCode(size_t copylen) { |
49 | 0 | if (copylen < 10) { |
50 | 0 | return (uint16_t)(copylen - 2); |
51 | 0 | } else if (copylen < 134) { |
52 | 0 | uint32_t nbits = Log2FloorNonZero(copylen - 6) - 1u; |
53 | 0 | return (uint16_t)((nbits << 1) + ((copylen - 6) >> nbits) + 4); |
54 | 0 | } else if (copylen < 2118) { |
55 | 0 | return (uint16_t)(Log2FloorNonZero(copylen - 70) + 12); |
56 | 0 | } else { |
57 | 0 | return 23u; |
58 | 0 | } |
59 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: command.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetCopyLengthCode(unsigned long) |
60 | | |
61 | | static BROTLI_INLINE uint16_t CombineLengthCodes( |
62 | 0 | uint16_t inscode, uint16_t copycode, BROTLI_BOOL use_last_distance) { |
63 | 0 | uint16_t bits64 = |
64 | 0 | (uint16_t)((copycode & 0x7u) | ((inscode & 0x7u) << 3u)); |
65 | 0 | if (use_last_distance && inscode < 8u && copycode < 16u) { |
66 | 0 | return (copycode < 8u) ? bits64 : (bits64 | 64u); |
67 | 0 | } else { |
68 | | /* Specification: 5 Encoding of ... (last table) */ |
69 | | /* offset = 2 * index, where index is in range [0..8] */ |
70 | 0 | uint32_t offset = 2u * ((copycode >> 3u) + 3u * (inscode >> 3u)); |
71 | | /* All values in specification are K * 64, |
72 | | where K = [2, 3, 6, 4, 5, 8, 7, 9, 10], |
73 | | i + 1 = [1, 2, 3, 4, 5, 6, 7, 8, 9], |
74 | | K - i - 1 = [1, 1, 3, 0, 0, 2, 0, 1, 2] = D. |
75 | | All values in D require only 2 bits to encode. |
76 | | Magic constant is shifted 6 bits left, to avoid final multiplication. */ |
77 | 0 | offset = (offset << 5u) + 0x40u + ((0x520D40u >> offset) & 0xC0u); |
78 | 0 | return (uint16_t)(offset | bits64); |
79 | 0 | } |
80 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: metablock.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: histogram.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: command.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: cluster.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::CombineLengthCodes(unsigned short, unsigned short, int) |
81 | | |
82 | | static BROTLI_INLINE void GetLengthCode(size_t insertlen, size_t copylen, |
83 | | BROTLI_BOOL use_last_distance, |
84 | 0 | uint16_t* code) { |
85 | 0 | uint16_t inscode = GetInsertLengthCode(insertlen); |
86 | 0 | uint16_t copycode = GetCopyLengthCode(copylen); |
87 | 0 | *code = CombineLengthCodes(inscode, copycode, use_last_distance); |
88 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: command.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetLengthCode(unsigned long, unsigned long, int, unsigned short*) |
89 | | |
90 | 0 | static BROTLI_INLINE uint32_t GetInsertBase(uint16_t inscode) { |
91 | 0 | return kBrotliInsBase[inscode]; |
92 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: command.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetInsertBase(unsigned short) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetInsertBase(unsigned short) |
93 | | |
94 | 0 | static BROTLI_INLINE uint32_t GetInsertExtra(uint16_t inscode) { |
95 | 0 | return kBrotliInsExtra[inscode]; |
96 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: command.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetInsertExtra(unsigned short) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetInsertExtra(unsigned short) |
97 | | |
98 | 0 | static BROTLI_INLINE uint32_t GetCopyBase(uint16_t copycode) { |
99 | 0 | return kBrotliCopyBase[copycode]; |
100 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: command.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetCopyBase(unsigned short) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetCopyBase(unsigned short) |
101 | | |
102 | 0 | static BROTLI_INLINE uint32_t GetCopyExtra(uint16_t copycode) { |
103 | 0 | return kBrotliCopyExtra[copycode]; |
104 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: metablock.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: histogram.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: command.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: cluster.cpp:duckdb_brotli::GetCopyExtra(unsigned short) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::GetCopyExtra(unsigned short) |
105 | | |
106 | | typedef struct Command { |
107 | | uint32_t insert_len_; |
108 | | /* Stores copy_len in low 25 bits and copy_code - copy_len in high 7 bit. */ |
109 | | uint32_t copy_len_; |
110 | | /* Stores distance extra bits. */ |
111 | | uint32_t dist_extra_; |
112 | | uint16_t cmd_prefix_; |
113 | | /* Stores distance code in low 10 bits |
114 | | and number of extra bits in high 6 bits. */ |
115 | | uint16_t dist_prefix_; |
116 | | } Command; |
117 | | |
118 | | /* distance_code is e.g. 0 for same-as-last short code, or 16 for offset 1. */ |
119 | | static BROTLI_INLINE void InitCommand(Command* self, |
120 | | const BrotliDistanceParams* dist, size_t insertlen, |
121 | 0 | size_t copylen, int copylen_code_delta, size_t distance_code) { |
122 | | /* Don't rely on signed int representation, use honest casts. */ |
123 | 0 | uint32_t delta = (uint8_t)((int8_t)copylen_code_delta); |
124 | 0 | self->insert_len_ = (uint32_t)insertlen; |
125 | 0 | self->copy_len_ = (uint32_t)(copylen | (delta << 25)); |
126 | | /* The distance prefix and extra bits are stored in this Command as if |
127 | | npostfix and ndirect were 0, they are only recomputed later after the |
128 | | clustering if needed. */ |
129 | 0 | PrefixEncodeCopyDistance( |
130 | 0 | distance_code, dist->num_direct_distance_codes, |
131 | 0 | dist->distance_postfix_bits, &self->dist_prefix_, &self->dist_extra_); |
132 | 0 | GetLengthCode( |
133 | 0 | insertlen, (size_t)((int)copylen + copylen_code_delta), |
134 | 0 | TO_BROTLI_BOOL((self->dist_prefix_ & 0x3FF) == 0), &self->cmd_prefix_); |
135 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: command.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::InitCommand(duckdb_brotli::Command*, BrotliDistanceParams const*, unsigned long, unsigned long, int, unsigned long) |
136 | | |
137 | 0 | static BROTLI_INLINE void InitInsertCommand(Command* self, size_t insertlen) { |
138 | 0 | self->insert_len_ = (uint32_t)insertlen; |
139 | 0 | self->copy_len_ = 4 << 25; |
140 | 0 | self->dist_extra_ = 0; |
141 | 0 | self->dist_prefix_ = BROTLI_NUM_DISTANCE_SHORT_CODES; |
142 | 0 | GetLengthCode(insertlen, 4, BROTLI_FALSE, &self->cmd_prefix_); |
143 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: command.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::InitInsertCommand(duckdb_brotli::Command*, unsigned long) |
144 | | |
145 | | static BROTLI_INLINE uint32_t CommandRestoreDistanceCode( |
146 | 0 | const Command* self, const BrotliDistanceParams* dist) { |
147 | 0 | if ((self->dist_prefix_ & 0x3FFu) < |
148 | 0 | BROTLI_NUM_DISTANCE_SHORT_CODES + dist->num_direct_distance_codes) { |
149 | 0 | return self->dist_prefix_ & 0x3FFu; |
150 | 0 | } else { |
151 | 0 | uint32_t dcode = self->dist_prefix_ & 0x3FFu; |
152 | 0 | uint32_t nbits = self->dist_prefix_ >> 10; |
153 | 0 | uint32_t extra = self->dist_extra_; |
154 | 0 | uint32_t postfix_mask = (1U << dist->distance_postfix_bits) - 1U; |
155 | 0 | uint32_t hcode = (dcode - dist->num_direct_distance_codes - |
156 | 0 | BROTLI_NUM_DISTANCE_SHORT_CODES) >> |
157 | 0 | dist->distance_postfix_bits; |
158 | 0 | uint32_t lcode = (dcode - dist->num_direct_distance_codes - |
159 | 0 | BROTLI_NUM_DISTANCE_SHORT_CODES) & postfix_mask; |
160 | 0 | uint32_t offset = ((2U + (hcode & 1U)) << nbits) - 4U; |
161 | 0 | return ((offset + extra) << dist->distance_postfix_bits) + lcode + |
162 | 0 | dist->num_direct_distance_codes + BROTLI_NUM_DISTANCE_SHORT_CODES; |
163 | 0 | } |
164 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: command.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::CommandRestoreDistanceCode(duckdb_brotli::Command const*, BrotliDistanceParams const*) |
165 | | |
166 | 0 | static BROTLI_INLINE uint32_t CommandDistanceContext(const Command* self) { |
167 | 0 | uint32_t r = self->cmd_prefix_ >> 6; |
168 | 0 | uint32_t c = self->cmd_prefix_ & 7; |
169 | 0 | if ((r == 0 || r == 2 || r == 4 || r == 7) && (c <= 2)) { |
170 | 0 | return c; |
171 | 0 | } |
172 | 0 | return 3; |
173 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: command.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::CommandDistanceContext(duckdb_brotli::Command const*) |
174 | | |
175 | 0 | static BROTLI_INLINE uint32_t CommandCopyLen(const Command* self) { |
176 | 0 | return self->copy_len_ & 0x1FFFFFF; |
177 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: command.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::CommandCopyLen(duckdb_brotli::Command const*) |
178 | | |
179 | 0 | static BROTLI_INLINE uint32_t CommandCopyLenCode(const Command* self) { |
180 | 0 | uint32_t modifier = self->copy_len_ >> 25; |
181 | 0 | int32_t delta = (int8_t)((uint8_t)(modifier | ((modifier & 0x40) << 1))); |
182 | 0 | return (uint32_t)((int32_t)(self->copy_len_ & 0x1FFFFFF) + delta); |
183 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: backward_references.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: backward_references_hq.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: command.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::CommandCopyLenCode(duckdb_brotli::Command const*) |
184 | | |
185 | | } |
186 | | |
187 | | #endif /* BROTLI_ENC_COMMAND_H_ */ |