diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | lzd.cc | 14 |
4 files changed, 15 insertions, 10 deletions
@@ -1,3 +1,8 @@ +2013-09-17 Antonio Diaz Diaz <antonio@gnu.org> + + * Version 0.5 released. + * Minor changes. + 2013-08-01 Antonio Diaz Diaz <antonio@gnu.org> * Version 0.4 released. @@ -1,3 +1,3 @@ -Changes in version 0.4: +Changes in version 0.5: -A portability problem in the testsuite has been fixed. +Minor changes. @@ -6,7 +6,7 @@ # to copy, distribute and modify it. pkgname=lzd -pkgversion=0.4 +pkgversion=0.5 progname=lzd srctrigger=lzd.cc @@ -56,6 +56,7 @@ enum { pos_states = 1 << pos_state_bits, pos_state_mask = pos_states - 1, + len_states = 4, dis_slot_bits = 6, start_dis_model = 4, end_dis_model = 14, @@ -72,7 +73,6 @@ enum { max_len_symbols = len_low_symbols + len_mid_symbols + len_high_symbols, min_match_len = 2, // must be 2 - max_dis_states = 4, bit_model_move_bits = 5, bit_model_total_bits = 11, @@ -299,7 +299,7 @@ bool LZ_decoder::decode_member() // Returns false if error Bit_model bm_rep1[State::states]; Bit_model bm_rep2[State::states]; Bit_model bm_len[State::states][pos_states]; - Bit_model bm_dis_slot[max_dis_states][1<<dis_slot_bits]; + Bit_model bm_dis_slot[len_states][1<<dis_slot_bits]; Bit_model bm_dis[modeled_distances-end_dis_model]; Bit_model bm_align[dis_align_size]; Len_model match_len_model; @@ -327,9 +327,9 @@ bool LZ_decoder::decode_member() // Returns false if error else { int len; - if( rdec.decode_bit( bm_rep[state()] ) == 1 ) // 2nd bit + if( rdec.decode_bit( bm_rep[state()] ) != 0 ) // 2nd bit { - if( rdec.decode_bit( bm_rep0[state()] ) == 1 ) // 3rd bit + if( rdec.decode_bit( bm_rep0[state()] ) != 0 ) // 3rd bit { unsigned distance; if( rdec.decode_bit( bm_rep1[state()] ) == 0 ) // 4th bit @@ -350,16 +350,16 @@ bool LZ_decoder::decode_member() // Returns false if error if( rdec.decode_bit( bm_len[state()][pos_state] ) == 0 ) // 4th bit { state.set_short_rep(); put_byte( get_byte( rep0 ) ); continue; } } - len = min_match_len + rdec.decode_len( rep_len_model, pos_state ); state.set_rep(); + len = min_match_len + rdec.decode_len( rep_len_model, pos_state ); } else { rep3 = rep2; rep2 = rep1; rep1 = rep0; len = min_match_len + rdec.decode_len( match_len_model, pos_state ); - const int dis_state = std::min( len - min_match_len, max_dis_states - 1 ); + const int len_state = std::min( len - min_match_len, len_states - 1 ); const int dis_slot = - rdec.decode_tree( bm_dis_slot[dis_state], dis_slot_bits ); + rdec.decode_tree( bm_dis_slot[len_state], dis_slot_bits ); if( dis_slot < start_dis_model ) rep0 = dis_slot; else { |