diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-02-16 22:53:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-02-16 22:53:52 +0000 |
commit | 006e85e57e005079065991a735a5007ab99f7071 (patch) | |
tree | 06ad797bb9415413b606043f87213703d02e0505 /encoder_base.h | |
parent | Adding upstream version 1.19. (diff) | |
download | lzip-upstream/1.20.tar.xz lzip-upstream/1.20.zip |
Adding upstream version 1.20.upstream/1.20
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'encoder_base.h')
-rw-r--r-- | encoder_base.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/encoder_base.h b/encoder_base.h index e186c2d..6a651f0 100644 --- a/encoder_base.h +++ b/encoder_base.h @@ -1,5 +1,5 @@ /* Lzip - LZMA lossless data compressor - Copyright (C) 2008-2017 Antonio Diaz Diaz. + Copyright (C) 2008-2018 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -181,14 +181,15 @@ protected: int stream_pos; // first byte not yet read from file int pos_limit; // when reached, a new block must be read int key4_mask; + const int num_prev_positions23; int num_prev_positions; // size of prev_positions int pos_array_size; const int infd; // input file descriptor bool at_stream_end; // stream_pos shows real end of file - Matchfinder_base( const int before, const int dict_size, - const int after_size, const int dict_factor, - const int num_prev_positions23, + Matchfinder_base( const int before_size_, + const int dict_size, const int after_size, + const int dict_factor, const int num_prev_positions23_, const int pos_array_factor, const int ifd ); ~Matchfinder_base() @@ -250,7 +251,7 @@ class Range_encoder void operator=( const Range_encoder & ); // declared as private public: - void reset() + void reset( const unsigned dictionary_size ) { low = 0; partial_member_pos = 0; @@ -258,18 +259,17 @@ public: range = 0xFFFFFFFFU; ff_count = 0; cache = 0; + header.dictionary_size( dictionary_size ); for( int i = 0; i < File_header::size; ++i ) put_byte( header.data[i] ); } Range_encoder( const unsigned dictionary_size, const int ofd ) : - buffer( new uint8_t[buffer_size] ), - outfd( ofd ) + buffer( new uint8_t[buffer_size] ), outfd( ofd ) { header.set_magic(); - header.dictionary_size( dictionary_size ); - reset(); + reset( dictionary_size ); } ~Range_encoder() { delete[] buffer; } @@ -417,13 +417,13 @@ protected: Len_model rep_len_model; Range_encoder renc; - LZ_encoder_base( const int before, const int dict_size, + LZ_encoder_base( const int before_size, const int dict_size, const int after_size, const int dict_factor, const int num_prev_positions23, const int pos_array_factor, const int ifd, const int outfd ) : - Matchfinder_base( before, dict_size, after_size, dict_factor, + Matchfinder_base( before_size, dict_size, after_size, dict_factor, num_prev_positions23, pos_array_factor, ifd ), crc_( 0xFFFFFFFFU ), renc( dictionary_size, outfd ) |