37 #ifndef BOOST_BEAST_ZLIB_DETAIL_DEFLATE_STREAM_HPP 38 #define BOOST_BEAST_ZLIB_DETAIL_DEFLATE_STREAM_HPP 43 #include <boost/assert.hpp> 44 #include <boost/config.hpp> 45 #include <boost/make_unique.hpp> 46 #include <boost/optional.hpp> 47 #include <boost/throw_exception.hpp> 53 #include <type_traits> 126 static std::uint16_t constexpr
dCodes = 30;
172 static std::uint16_t constexpr
HEAP_SIZE = 2 * lCodes + 1;
199 return fc == rhs.
fc && dl == rhs.
dl;
216 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0
220 std::uint8_t
const extra_dbits[
dCodes] = {
221 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13
226 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7
233 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15
245 std::uint8_t length_code[maxMatch-minMatch+1];
252 ltree, extra_lbits, literals+1,
lCodes, maxBits
256 dtree, extra_dbits, 0,
dCodes, maxBits
261 nullptr, extra_blbits, 0,
blCodes, maxBlBits
305 std::unique_ptr<std::uint8_t[]>
buf_;
313 boost::optional<Flush>
494 pending_buf_[pending_++] = c;
510 if(bi_valid_ > (
int)Buf_size - length)
512 bi_buf_ |= (std::uint16_t)value << bi_valid_;
514 bi_buf_ = (std::uint16_t)value >> (Buf_size - bi_valid_);
519 bi_buf_ |= (std::uint16_t)(value) <<
bi_valid_;
561 head_[hash_size_-1] = 0;
562 std::memset((
Byte *)head_, 0,
563 (
unsigned)(hash_size_-1)*
sizeof(*head_));
573 return tree[n].
fc < tree[m].
fc ||
574 (tree[n].
fc == tree[m].
fc &&
575 depth_[n] <= depth_[m]);
591 update_hash(ins_h_, window_[strstart_ + (minMatch-1)]);
593 head_[
ins_h_] = (std::uint16_t)strstart_;
612 std::uint16_t good_length_,
613 std::uint16_t max_lazy_,
614 std::uint16_t nice_length_,
615 std::uint16_t max_chain_,
617 : good_length(good_length_)
618 , max_lazy(max_lazy_)
619 , nice_length(nice_length_)
620 , max_chain(max_chain_)
654 template<
class Un
signed>
659 template<
class =
void>
664 template<
class =
void>
669 template<
class =
void>
void doReset (
int level,
int windowBits,
int memLevel,
Strategy strategy);
670 template<
class =
void>
void doReset ();
671 template<
class =
void>
void doClear ();
672 template<
class =
void> std::size_t
doUpperBound (std::size_t sourceLen)
const;
673 template<
class =
void>
void doTune (
int good_length,
int max_lazy,
int nice_length,
int max_chain);
678 template<
class =
void>
void doPending (
unsigned* value,
int* bits);
680 template<
class =
void>
void init ();
681 template<
class =
void>
void lm_init ();
690 template<
class =
void>
void send_all_trees (
int lcodes,
int dcodes,
int blcodes);
693 template<
class =
void>
void bi_windup ();
694 template<
class =
void>
void bi_flush ();
695 template<
class =
void>
void copy_block (
char *buf,
unsigned len,
int header);
697 template<
class =
void>
void tr_init ();
698 template<
class =
void>
void tr_align ();
700 template<
class =
void>
void tr_stored_block (
char *bu, std::uint32_t stored_len,
int last);
701 template<
class =
void>
void tr_tally_dist (std::uint16_t dist, std::uint8_t len,
bool& flush);
702 template<
class =
void>
void tr_tally_lit (std::uint8_t c,
bool& flush);
738 return f_rle(zs, flush);
751 template<
class Un
signed>
758 BOOST_ASSERT(len <= 8 *
sizeof(
unsigned));
781 std::uint16_t next_code[
maxBits+1];
782 std::uint16_t code = 0;
788 for(bits = 1; bits <=
maxBits; bits++)
790 code = (code + bl_count[bits-1]) << 1;
791 next_code[bits] = code;
796 for(n = 0; n <= max_code; n++)
798 int len = tree[n].
dl;
820 std::uint8_t length = 0;
821 for(std::uint8_t code = 0; code <
lengthCodes-1; ++code)
825 for(
unsigned n = 0; n < run; ++n)
828 BOOST_ASSERT(length == 0);
837 std::uint16_t dist = 0;
838 for(code = 0; code < 16; code++)
842 for(
unsigned n = 0; n < run; ++n)
845 BOOST_ASSERT(dist == 256);
848 for(; code <
dCodes; ++code)
851 auto const run = 1U << (tables.
extra_dbits[code]-7);
852 for(std::size_t n = 0; n < run; ++n)
855 BOOST_ASSERT(dist == 256);
859 std::uint16_t bl_count[
maxBits+1];
860 std::memset(bl_count, 0,
sizeof(bl_count));
878 for(n = 0; n <
dCodes; ++n)
886 static init const data;
907 if(level < 0 || level > 9)
908 BOOST_THROW_EXCEPTION(std::invalid_argument{
911 if(windowBits < 8 || windowBits > 15)
912 BOOST_THROW_EXCEPTION(std::invalid_argument{
913 "invalid windowBits"});
916 BOOST_THROW_EXCEPTION(std::invalid_argument{
917 "invalid memLevel"});
957 complen = sourceLen +
958 ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
965 return complen + wraplen;
968 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
969 (sourceLen >> 25) + 13 - 6 + wraplen;
996 if(level < 0 || level > 9)
1009 ec.assign(0, ec.category());
1046 auto old_flush = boost::make_optional<Flush>(
1069 old_flush && flush <= *old_flush
1285 auto const nprev =
w_size_ *
sizeof(std::uint16_t);
1286 auto const nhead =
hash_size_ *
sizeof(std::uint16_t);
1287 auto const noverlay =
lit_bufsize_ * (
sizeof(std::uint16_t)+2);
1288 auto const needed = nwindow + nprev + nhead + noverlay;
1292 buf_ = boost::make_unique_noinit<
1293 std::uint8_t[]>(needed);
1298 prev_ =
reinterpret_cast<std::uint16_t*
>(
buf_.get() + nwindow);
1299 head_ =
reinterpret_cast<std::uint16_t*
>(
buf_.get() + nwindow + nprev);
1305 auto overlay =
reinterpret_cast<std::uint16_t*
>(
1306 buf_.get() + nwindow + nprev + nhead);
1312 reinterpret_cast<std::uint8_t*
>(overlay);
1315 (
sizeof(std::uint16_t) + 2L);
1367 for(
int n = 0; n <
lCodes; n++)
1369 for(
int n = 0; n <
dCodes; n++)
1371 for(
int n = 0; n <
blCodes; n++)
1465 bits = tree[tree[n].
dl].
dl + 1;
1466 if(bits > max_length) bits = max_length, overflow++;
1468 tree[n].
dl = (std::uint16_t)bits;
1476 xbits = extra[n-base];
1478 opt_len_ += (std::uint32_t)f * (bits + xbits);
1488 bits = max_length-1;
1499 while(overflow > 0);
1506 for(bits = max_length; bits != 0; bits--)
1514 if((
unsigned) tree[m].
dl != (unsigned) bits)
1516 opt_len_ += ((long)bits - (
long)tree[m].
dl) *(
long)tree[m].
fc;
1517 tree[m].
dl = (std::uint16_t)bits;
1550 for(n = 0; n < elems; n++)
1599 tree[node].
fc = tree[n].
fc + tree[m].
fc;
1602 tree[n].
dl = tree[m].
dl = (std::uint16_t)node;
1634 int nextlen = tree[0].
dl;
1635 std::uint16_t count = 0;
1644 tree[max_code+1].
dl = (std::uint16_t)0xffff;
1646 for(n = 0; n <= max_code; n++)
1648 curlen = nextlen; nextlen = tree[n+1].
dl;
1649 if(++count < max_count && curlen == nextlen)
1653 else if(count < min_count)
1657 else if(curlen != 0)
1662 else if(count <= 10)
1677 else if(curlen == nextlen)
1703 int nextlen = tree[0].
dl;
1715 for(n = 0; n <= max_code; n++)
1718 nextlen = tree[n+1].
dl;
1719 if(++count < max_count && curlen == nextlen)
1723 else if(count < min_count)
1729 while (--count != 0);
1731 else if(curlen != 0)
1733 if(curlen != prevlen)
1738 BOOST_ASSERT(count >= 3 && count <= 6);
1742 else if(count <= 10)
1759 else if(curlen == nextlen)
1796 for(max_blindex =
blCodes-1; max_blindex >= 3; max_blindex--)
1802 opt_len_ += 3*(max_blindex+1) + 5+5+4;
1821 BOOST_ASSERT(lcodes >= 257 && dcodes >= 1 && blcodes >= 4);
1826 for(rank = 0; rank < blcodes; rank++)
1870 BOOST_ASSERT(code <
dCodes);
1911 unsigned long black_mask = 0xf3ffc07fUL;
1915 for(n = 0; n <= 31; n++, black_mask >>= 1)
2047 std::uint32_t stored_len,
2091 std::uint32_t stored_len,
2094 std::uint32_t opt_lenb;
2095 std::uint32_t static_lenb;
2096 int max_blindex = 0;
2122 if(static_lenb <= opt_lenb)
2123 opt_lenb = static_lenb;
2134 opt_lenb = static_lenb = stored_len + 5;
2138 if(buf != (
char*)0) {
2140 if(stored_len+4 <= opt_lenb && buf != (
char*)0) {
2153 else if(static_lenb >= 0)
2199 if(
sizeof(
int) <= 2)
2201 if(more == 0 && strstart_ == 0 &&
lookahead_ == 0)
2205 else if(more == (
unsigned)(-1))
2236 *p = (std::uint16_t)(m >= wsize ? m-wsize : 0);
2245 *p = (std::uint16_t)(m >= wsize ? m-wsize : 0);
2303 std::uint32_t winit;
2313 std::memset(
window_ + curr, 0, (
unsigned)winit);
2325 std::memset(
window_ + high_water_, 0, (
unsigned)winit);
2326 high_water_ += winit;
2348 static_cast<std::uint8_t*
>(zs.
next_out) + len;
2393 std::memcpy(buf, zs.
next_in, len);
2395 std::uint8_t const*
>(zs.
next_in) + len;
2427 std::uint16_t *prev =
prev_;
2431 Byte scan_end1 = scan[best_len-1];
2432 Byte scan_end = scan[best_len];
2437 BOOST_ASSERT(
hash_bits_ >= 8 && maxMatch == 258);
2452 BOOST_ASSERT(cur_match < strstart_);
2463 if( match[best_len] != scan_end ||
2464 match[best_len-1] != scan_end1 ||
2466 *++match != scan[1])
2476 BOOST_ASSERT(*scan == *match);
2484 while( *++scan == *++match && *++scan == *++match &&
2485 *++scan == *++match && *++scan == *++match &&
2486 *++scan == *++match && *++scan == *++match &&
2487 *++scan == *++match && *++scan == *++match &&
2492 len = maxMatch - (int)(strend - scan);
2495 if(len > best_len) {
2498 if(len >= nice_match)
break;
2499 scan_end1 = scan[best_len-1];
2500 scan_end = scan[best_len];
2503 while((cur_match = prev[cur_match & wmask]) > limit
2504 && --chain_length != 0);
2507 return (
uInt)best_len;
2531 std::uint32_t max_block_size = 0xffff;
2532 std::uint32_t max_start;
2783 static_cast<std::uint16_t>(
strstart_ -1 - prev_match_),
2784 static_cast<std::uint8_t>(
prev_length_ - minMatch), bflush);
2891 if(prev == *++scan && prev == *++scan && prev == *++scan) {
2894 }
while(prev == *++scan && prev == *++scan &&
2895 prev == *++scan && prev == *++scan &&
2896 prev == *++scan && prev == *++scan &&
2897 prev == *++scan && prev == *++scan &&
static std::size_t constexpr kTooFar
Definition: deflate_stream.hpp:178
Definition: deflate_stream.hpp:285
static_desc l_desc
Definition: deflate_stream.hpp:251
IPos prev_match_
Definition: deflate_stream.hpp:361
block_state f_stored(z_params &zs, Flush flush)
std::uint16_t max_chain
Definition: deflate_stream.hpp:608
Byte * pending_buf_
Definition: deflate_stream.hpp:308
BOOST_STATIC_ASSERT(minMatch==3)
Definition: deflate_stream.hpp:276
Definition: deflate_stream.hpp:191
int data_type
Definition: zlib.hpp:109
uInt good_match_
Definition: deflate_stream.hpp:392
void send_bits(int value, int length)
Definition: deflate_stream.hpp:508
block_state deflate_fast(z_params &zs, Flush flush)
Definition: deflate_stream.hpp:724
static std::uint8_t constexpr REPZ_11_138
Definition: deflate_stream.hpp:153
block_state f_fast(z_params &zs, Flush flush)
uInt insert_
Definition: deflate_stream.hpp:456
void pqdownheap(ct_data const *tree, int k)
Definition: deflate_stream.hpp:1388
uInt prev_length_
Definition: deflate_stream.hpp:370
Definition: deflate_stream.hpp:275
void flush_pending(z_params &zs)
Definition: deflate_stream.hpp:2339
uInt match_length_
Definition: deflate_stream.hpp:360
std::uint8_t const extra_lbits[lengthCodes]
Definition: deflate_stream.hpp:215
void clear_hash()
Definition: deflate_stream.hpp:559
void update_hash(uInt &h, std::uint8_t c)
Definition: deflate_stream.hpp:550
Definition: async_result.hpp:20
int nice_match_
Definition: deflate_stream.hpp:394
void tr_flush_block(z_params &zs, char *buf, std::uint32_t stored_len, int last)
Definition: deflate_stream.hpp:2088
compress_func func
Definition: deflate_stream.hpp:609
Definition: deflate_stream.hpp:287
uInt hash_shift_
Definition: deflate_stream.hpp:353
ct_data bl_tree_[ 2 *blCodes+1]
Definition: deflate_stream.hpp:401
std::uint8_t max_length
Definition: deflate_stream.hpp:209
int read_buf(z_params &zs, Byte *buf, unsigned size)
Definition: deflate_stream.hpp:2385
int heap_len_
Definition: deflate_stream.hpp:418
std::uint16_t * head_
Definition: deflate_stream.hpp:341
std::size_t total_out
Definition: zlib.hpp:107
bool smaller(ct_data const *tree, int n, int m)
Definition: deflate_stream.hpp:571
std::uint32_t pending_buf_size_
Definition: deflate_stream.hpp:310
static std::uint16_t constexpr lCodes
Definition: deflate_stream.hpp:123
uInt lit_bufsize_
Definition: deflate_stream.hpp:444
unsigned IPos
Definition: deflate_stream.hpp:294
std::uint8_t base_length[lengthCodes]
Definition: deflate_stream.hpp:247
uInt max_lazy_match_
Definition: deflate_stream.hpp:386
static std::uint8_t constexpr REP_3_6
Definition: deflate_stream.hpp:147
void init_block()
Definition: deflate_stream.hpp:1365
std::uint32_t high_water_
Definition: deflate_stream.hpp:473
std::uint16_t * prev_
Definition: deflate_stream.hpp:339
Definition: deflate_stream.hpp:286
void send_code(int value, ct_data const *tree)
Definition: deflate_stream.hpp:526
config(std::uint16_t good_length_, std::uint16_t max_lazy_, std::uint16_t nice_length_, std::uint16_t max_chain_, compress_func func_)
Definition: deflate_stream.hpp:611
Definition: deflate_stream.hpp:212
std::uint16_t good_length
Definition: deflate_stream.hpp:605
void init()
Definition: deflate_stream.hpp:1268
void flush_block(z_params &zs, bool last)
Definition: deflate_stream.hpp:2364
void doParams(z_params &zs, int level, Strategy strategy, error_code &ec)
Definition: deflate_stream.hpp:990
Definition: config.hpp:10
void insert_string(IPos &hash_head)
Definition: deflate_stream.hpp:589
lut_type const & lut_
Definition: deflate_stream.hpp:301
std::uint8_t d_code(unsigned dist)
Definition: deflate_stream.hpp:536
void tr_init()
Definition: deflate_stream.hpp:1999
std::uint16_t max_lazy
Definition: deflate_stream.hpp:606
block_state f_rle(z_params &zs, Flush flush)
static std::uint16_t constexpr END_BLOCK
Definition: deflate_stream.hpp:144
uInt w_mask_
Definition: deflate_stream.hpp:318
uInt strstart_
Definition: deflate_stream.hpp:363
static lut_type const & get_lut()
unsigned char Byte
Definition: zlib.hpp:50
static std::uint8_t constexpr Buf_size
Definition: deflate_stream.hpp:175
unsigned int uInt
Definition: zlib.hpp:52
void fill_window(z_params &zs)
Definition: deflate_stream.hpp:2184
std::uint8_t dist_code[distCodeLen]
Definition: deflate_stream.hpp:243
uInt last_lit_
Definition: deflate_stream.hpp:445
boost::optional< Flush > last_flush_
Definition: deflate_stream.hpp:314
int heap_max_
Definition: deflate_stream.hpp:419
uInt w_size_
Definition: deflate_stream.hpp:316
static std::uint8_t constexpr maxBits
Definition: deflate_stream.hpp:114
Flush
Definition: zlib.hpp:114
std::uint16_t dl
Definition: deflate_stream.hpp:194
block_state deflate_huff(z_params &zs, Flush flush)
Definition: deflate_stream.hpp:742
Byte * window_
Definition: deflate_stream.hpp:328
int detect_data_type()
Definition: deflate_stream.hpp:1905
std::size_t max_dist() const
Definition: deflate_stream.hpp:486
Definition: deflate_stream.hpp:274
std::size_t total_in
Definition: zlib.hpp:95
tree_desc l_desc_
Definition: deflate_stream.hpp:403
Definition: deflate_stream.hpp:203
boost::system::error_code error_code
The type of error code used by the library.
Definition: error.hpp:21
void bi_flush()
Definition: deflate_stream.hpp:1953
uInt longest_match(IPos cur_match)
Definition: deflate_stream.hpp:2414
std::uint8_t depth_[2 *lCodes+1]
Definition: deflate_stream.hpp:422
uInt hash_bits_
Definition: deflate_stream.hpp:345
static std::uint8_t constexpr maxBlBits
Definition: deflate_stream.hpp:135
void send_all_trees(int lcodes, int dcodes, int blcodes)
Definition: deflate_stream.hpp:1814
ct_data * dyn_tree
Definition: deflate_stream.hpp:267
std::uint8_t * l_buf_
Definition: deflate_stream.hpp:424
std::uint8_t const bl_order[blCodes]
Definition: deflate_stream.hpp:232
std::uint16_t fc
Definition: deflate_stream.hpp:193
Definition: deflate_stream.hpp:110
std::size_t buf_size_
Definition: deflate_stream.hpp:304
static std::uint16_t constexpr HEAP_SIZE
Definition: deflate_stream.hpp:172
block_state deflate_stored(z_params &zs, Flush flush)
Definition: deflate_stream.hpp:718
ct_data ltree[lCodes+2]
Definition: deflate_stream.hpp:236
block_state deflate_slow(z_params &zs, Flush flush)
Definition: deflate_stream.hpp:730
void const * next_in
Definition: zlib.hpp:85
int status_
Definition: deflate_stream.hpp:307
uInt hash_mask_
Definition: deflate_stream.hpp:346
void tr_stored_block(char *bu, std::uint32_t stored_len, int last)
Definition: deflate_stream.hpp:2045
std::uint32_t opt_len_
Definition: deflate_stream.hpp:453
void * next_out
Definition: zlib.hpp:99
void tr_flush_bits()
Definition: deflate_stream.hpp:2035
void compress_block(ct_data const *ltree, ct_data const *dtree)
Definition: deflate_stream.hpp:1837
uInt pending_
Definition: deflate_stream.hpp:312
std::uint16_t bi_buf_
Definition: deflate_stream.hpp:461
static std::uint16_t constexpr dCodes
Definition: deflate_stream.hpp:126
void build_tree(tree_desc *desc)
Definition: deflate_stream.hpp:1534
static config get_config(std::size_t level)
Definition: deflate_stream.hpp:628
Byte * pending_out_
Definition: deflate_stream.hpp:311
Strategy strategy_
Definition: deflate_stream.hpp:389
uInt ins_h_
Definition: deflate_stream.hpp:343
uInt max_chain_length_
Definition: deflate_stream.hpp:376
static std::uint16_t constexpr distCodeLen
Definition: deflate_stream.hpp:132
void tr_tally_dist(std::uint16_t dist, std::uint8_t len, bool &flush)
Definition: deflate_stream.hpp:2058
std::uint16_t elems
Definition: deflate_stream.hpp:208
static std::uint8_t constexpr STATIC_TREES
Definition: deflate_stream.hpp:157
void doTune(int good_length, int max_lazy, int nice_length, int max_chain)
Definition: deflate_stream.hpp:975
std::size_t avail_out
Definition: zlib.hpp:103
std::unique_ptr< std::uint8_t[]> buf_
Definition: deflate_stream.hpp:305
void doDictionary(Byte const *dict, uInt dictLength, error_code &ec)
Definition: deflate_stream.hpp:1172
static std::uint16_t constexpr minMatch
Definition: deflate_stream.hpp:137
void bi_windup()
Definition: deflate_stream.hpp:1938
void maybe_init()
Definition: deflate_stream.hpp:648
void lm_init()
Definition: deflate_stream.hpp:1337
void send_tree(ct_data *tree, int max_code)
Definition: deflate_stream.hpp:1696
std::uint8_t const * extra_bits
Definition: deflate_stream.hpp:206
int max_code
Definition: deflate_stream.hpp:268
static_desc bl_desc
Definition: deflate_stream.hpp:259
static std::uint8_t constexpr DYN_TREES
Definition: deflate_stream.hpp:158
Definition: deflate_stream.hpp:283
std::uint16_t * d_buf_
Definition: deflate_stream.hpp:451
ct_data const * static_tree
Definition: deflate_stream.hpp:205
std::size_t avail_in
Definition: zlib.hpp:91
Definition: deflate_stream.hpp:265
static std::uint8_t constexpr DEF_MEM_LEVEL
Definition: deflate_stream.hpp:164
void doWrite(z_params &zs, boost::optional< Flush > flush, error_code &ec)
Definition: deflate_stream.hpp:1029
int build_bl_tree()
Definition: deflate_stream.hpp:1778
void doReset()
Definition: deflate_stream.hpp:934
std::uint8_t length_code[maxMatch-minMatch+1]
Definition: deflate_stream.hpp:245
U clamp(U u, V v)
Definition: ranges.hpp:92
int level_
Definition: deflate_stream.hpp:388
static std::uint16_t constexpr maxMatch
Definition: deflate_stream.hpp:138
static std::size_t constexpr kSmallest
Definition: deflate_stream.hpp:411
block_state deflate_rle(z_params &zs, Flush flush)
Definition: deflate_stream.hpp:736
std::uint16_t base_dist[dCodes]
Definition: deflate_stream.hpp:249
void scan_tree(ct_data *tree, int max_code)
Definition: deflate_stream.hpp:1627
void doClear()
Definition: deflate_stream.hpp:942
tree_desc d_desc_
Definition: deflate_stream.hpp:404
block_state
Definition: deflate_stream.hpp:272
void copy_block(char *buf, unsigned len, int header)
Definition: deflate_stream.hpp:1975
void put_short(std::uint16_t w)
Definition: deflate_stream.hpp:498
uInt lookahead_
Definition: deflate_stream.hpp:365
long block_start_
Definition: deflate_stream.hpp:358
std::uint16_t bl_count_[maxBits+1]
Definition: deflate_stream.hpp:408
static std::uint16_t constexpr lengthCodes
Definition: deflate_stream.hpp:117
deflate_stream()
Definition: deflate_stream.hpp:477
static Unsigned bi_reverse(Unsigned code, unsigned len)
Definition: deflate_stream.hpp:755
std::size_t doUpperBound(std::size_t sourceLen) const
Definition: deflate_stream.hpp:951
uInt hash_size_
Definition: deflate_stream.hpp:344
static std::size_t constexpr kMinLookahead
Definition: deflate_stream.hpp:183
uInt match_start_
Definition: deflate_stream.hpp:364
static std::uint16_t constexpr blCodes
Definition: deflate_stream.hpp:129
block_state f_slow(z_params &zs, Flush flush)
static_desc const * stat_desc
Definition: deflate_stream.hpp:269
StreamStatus
Definition: deflate_stream.hpp:281
ct_data dyn_dtree_[ 2 *dCodes+1]
Definition: deflate_stream.hpp:399
uInt matches_
Definition: deflate_stream.hpp:455
uInt w_bits_
Definition: deflate_stream.hpp:317
static std::uint8_t constexpr STORED_BLOCK
Definition: deflate_stream.hpp:156
void doPrime(int bits, int value, error_code &ec)
Definition: deflate_stream.hpp:1227
void tr_tally_lit(std::uint8_t c, bool &flush)
Definition: deflate_stream.hpp:2072
std::uint16_t nice_length
Definition: deflate_stream.hpp:607
void gen_bitlen(tree_desc *desc)
Definition: deflate_stream.hpp:1441
static std::uint8_t constexpr REPZ_3_10
Definition: deflate_stream.hpp:150
static std::uint16_t constexpr literals
Definition: deflate_stream.hpp:120
Strategy
Definition: zlib.hpp:140
ct_data dyn_ltree_[ HEAP_SIZE]
Definition: deflate_stream.hpp:397
block_state f_huff(z_params &zs, Flush flush)
bool operator==(ct_data const &rhs) const
Definition: deflate_stream.hpp:197
void put_byte(std::uint8_t c)
Definition: deflate_stream.hpp:492
Definition: deflate_stream.hpp:284
static std::size_t constexpr kWinInit
Definition: deflate_stream.hpp:188
std::uint32_t static_len_
Definition: deflate_stream.hpp:454
static std::uint8_t constexpr MAX_MEM_LEVEL
Definition: deflate_stream.hpp:161
bool inited_
Definition: deflate_stream.hpp:303
int heap_[2 *lCodes+1]
Definition: deflate_stream.hpp:417
static void gen_codes(ct_data *tree, int max_code, std::uint16_t *bl_count)
Definition: deflate_stream.hpp:779
static_desc d_desc
Definition: deflate_stream.hpp:255
int match_available_
Definition: deflate_stream.hpp:362
block_state(self::* compress_func)(z_params &zs, Flush flush)
Definition: deflate_stream.hpp:297
Definition: deflate_stream.hpp:277
std::uint8_t const extra_dbits[dCodes]
Definition: deflate_stream.hpp:220
Definition: deflate_stream.hpp:288
std::uint16_t extra_base
Definition: deflate_stream.hpp:207
void pqremove(ct_data const *tree, int &top)
Definition: deflate_stream.hpp:1422
tree_desc bl_desc_
Definition: deflate_stream.hpp:405
void tr_align()
Definition: deflate_stream.hpp:2023
ct_data dtree[dCodes]
Definition: deflate_stream.hpp:238
void doPending(unsigned *value, int *bits)
Definition: deflate_stream.hpp:1254
std::uint32_t window_size_
Definition: deflate_stream.hpp:333
int bi_valid_
Definition: deflate_stream.hpp:466