summaryrefslogtreecommitdiffstats
path: root/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-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; }