summaryrefslogtreecommitdiffstats
path: root/decoder.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 09:58:16 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 09:58:16 +0000
commit51c12e5bd97a911ab71bae9cc4c22c5a072a2a38 (patch)
tree6afa6655e77149ce493d352f229d1b1258fd5994 /decoder.cc
parentAdding upstream version 1.15~pre1. (diff)
downloadlzip-51c12e5bd97a911ab71bae9cc4c22c5a072a2a38.tar.xz
lzip-51c12e5bd97a911ab71bae9cc4c22c5a072a2a38.zip
Adding upstream version 1.15~pre2.upstream/1.15_pre2
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'decoder.cc')
-rw-r--r--decoder.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/decoder.cc b/decoder.cc
index 1d4774f..5f14fca 100644
--- a/decoder.cc
+++ b/decoder.cc
@@ -175,7 +175,7 @@ bool LZ_decoder::verify_trailer( const Pretty_print & pp ) const
trailer.member_size(), member_size, member_size );
}
}
- if( !error && pp.verbosity() >= 3 && data_position() > 0 && member_size > 0 )
+ if( !error && pp.verbosity() >= 2 && data_position() > 0 && member_size > 0 )
std::fprintf( stderr, "%6.3f:1, %6.3f bits/byte, %5.2f%% saved. ",
(double)data_position() / member_size,
( 8.0 * member_size ) / data_position(),
@@ -214,7 +214,7 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
while( !rdec.finished() )
{
const int pos_state = data_position() & pos_state_mask;
- if( rdec.decode_bit( bm_match[state()][pos_state] ) == 0 )
+ if( rdec.decode_bit( bm_match[state()][pos_state] ) == 0 ) // 1st bit
{
const uint8_t prev_byte = get_prev_byte();
if( state.is_char() )
@@ -227,21 +227,21 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
else
{
int len;
- if( rdec.decode_bit( bm_rep[state()] ) == 1 )
+ if( rdec.decode_bit( bm_rep[state()] ) == 1 ) // 2nd bit
{
- if( rdec.decode_bit( bm_rep0[state()] ) == 0 )
+ if( rdec.decode_bit( bm_rep0[state()] ) == 0 ) // 3rd bit
{
- if( rdec.decode_bit( bm_len[state()][pos_state] ) == 0 )
+ if( rdec.decode_bit( bm_len[state()][pos_state] ) == 0 ) // 4th bit
{ state.set_short_rep(); put_byte( get_byte( rep0 ) ); continue; }
}
else
{
unsigned distance;
- if( rdec.decode_bit( bm_rep1[state()] ) == 0 )
+ if( rdec.decode_bit( bm_rep1[state()] ) == 0 ) // 4th bit
distance = rep1;
else
{
- if( rdec.decode_bit( bm_rep2[state()] ) == 0 )
+ if( rdec.decode_bit( bm_rep2[state()] ) == 0 ) // 5th bit
distance = rep2;
else
{ distance = rep3; rep3 = rep2; }