diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 10:08:36 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 10:08:36 +0000 |
commit | 62327bcaed81d8c02f11aec2c49f7d09c5edddb7 (patch) | |
tree | 7eb93beb78b7ee8ab3288c5b31a3f7c99c8f2572 /encoder_base.h | |
parent | Adding upstream version 1.17~rc2. (diff) | |
download | lzip-62327bcaed81d8c02f11aec2c49f7d09c5edddb7.tar.xz lzip-62327bcaed81d8c02f11aec2c49f7d09c5edddb7.zip |
Adding upstream version 1.17.upstream/1.17
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | encoder_base.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/encoder_base.h b/encoder_base.h index 27c7a90..b032fae 100644 --- a/encoder_base.h +++ b/encoder_base.h @@ -60,14 +60,14 @@ public: for( int i = 0; i < bit_model_total >> price_step_bits; ++i ) { unsigned val = ( i * price_step ) + ( price_step / 2 ); - int bits = 0; /* base 2 logarithm of val */ + int bits = 0; // base 2 logarithm of val for( int j = 0; j < price_shift_bits; ++j ) { val = val * val; bits <<= 1; while( val >= 1 << 16 ) { val >>= 1; ++bits; } } - bits += 15; /* remaining bits in val */ + bits += 15; // remaining bits in val data[i] = ( bit_model_total_bits << price_shift_bits ) - bits; } } @@ -155,7 +155,7 @@ inline int price_matched( const Bit_model bm[], int symbol, int match_byte ) symbol <<= 1; const int bit = symbol & 0x100; price += price_bit( bm[match_bit+(symbol>>9)+mask], bit ); - mask &= ~(match_byte ^ symbol); /* if( match_bit != bit ) mask = 0; */ + mask &= ~(match_byte ^ symbol); // if( match_bit != bit ) mask = 0; } while( symbol < 0x10000 ); return price; @@ -172,21 +172,21 @@ class Matchfinder_base protected: unsigned long long partial_data_pos; - uint8_t * buffer; /* input buffer */ - int32_t * prev_positions; /* 1 + last seen position of key. else 0 */ - int32_t * pos_array; /* may be tree or chain */ - const int before_size; /* bytes to keep in buffer before dictionary */ + uint8_t * buffer; // input buffer + int32_t * prev_positions; // 1 + last seen position of key. else 0 + int32_t * pos_array; // may be tree or chain + const int before_size; // bytes to keep in buffer before dictionary int buffer_size; - int dictionary_size; /* bytes to keep in buffer before pos */ - int pos; /* current pos in buffer */ - int cyclic_pos; /* cycles through [0, dictionary_size] */ - int stream_pos; /* first byte not yet read from file */ - int pos_limit; /* when reached, a new block must be read */ + int dictionary_size; // bytes to keep in buffer before pos + int pos; // current pos in buffer + int cyclic_pos; // cycles through [0, dictionary_size] + int stream_pos; // first byte not yet read from file + int pos_limit; // when reached, a new block must be read int key4_mask; - int num_prev_positions; /* size of prev_positions */ + 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 */ + 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, @@ -228,11 +228,11 @@ class Range_encoder enum { buffer_size = 65536 }; uint64_t low; unsigned long long partial_member_pos; - uint8_t * const buffer; /* output buffer */ - int pos; /* current pos in buffer */ + uint8_t * const buffer; // output buffer + int pos; // current pos in buffer uint32_t range; unsigned ff_count; - const int outfd; /* output file descriptor */ + const int outfd; // output file descriptor uint8_t cache; File_header header; @@ -377,7 +377,7 @@ public: symbol <<= 1; const int bit = symbol & 0x100; encode_bit( bm[match_bit+(symbol>>9)+mask], bit ); - mask &= ~(match_byte ^ symbol); /* if( match_bit != bit ) mask = 0; */ + mask &= ~(match_byte ^ symbol); // if( match_bit != bit ) mask = 0; } while( symbol < 0x10000 ); } @@ -406,7 +406,7 @@ class LZ_encoder_base : public Matchfinder_base { protected: enum { max_marker_size = 16, - num_rep_distances = 4 }; /* must be 4 */ + num_rep_distances = 4 }; // must be 4 uint32_t crc_; |