diff options
Diffstat (limited to 'encoder.cc')
-rw-r--r-- | encoder.cc | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -416,7 +416,7 @@ int LZ_encoder::sequence_optimizer( const int reps[num_rep_distances], if( replens[rep] < min_match_len ) continue; const int price = rep_match_price + price_rep( rep, state, pos_state ); for( int len = min_match_len; len <= replens[rep]; ++len ) - trials[len].update( price + rep_match_len_encoder.price( len, pos_state ), + trials[len].update( price + rep_len_encoder.price( len, pos_state ), rep, 0 ); } @@ -586,8 +586,7 @@ int LZ_encoder::sequence_optimizer( const int reps[num_rep_distances], trials[++num_trials].price = infinite_price; int price = rep_match_price + price_rep( rep, cur_state, pos_state ); for( int i = min_match_len; i <= len; ++i ) - trials[cur+i].update( price + - rep_match_len_encoder.price( i, pos_state ), + trials[cur+i].update( price + rep_len_encoder.price( i, pos_state ), rep, cur ); if( rep == 0 ) start_len = len + 1; // discard shorter matches @@ -602,7 +601,7 @@ int LZ_encoder::sequence_optimizer( const int reps[num_rep_distances], int pos_state2 = ( pos_state + len ) & pos_state_mask; State state2 = cur_state; state2.set_rep(); - price += rep_match_len_encoder.price( len, pos_state ) + + price += rep_len_encoder.price( len, pos_state ) + price0( bm_match[state2()][pos_state2] ) + price_matched( data[len-1], data[len], data[len-dis] ); pos_state2 = ( pos_state2 + 1 ) & pos_state_mask; @@ -750,7 +749,7 @@ bool LZ_encoder::encode_member( const unsigned long long member_size ) if( len == 1 ) state.set_short_rep(); else { - rep_match_len_encoder.encode( range_encoder, len, pos_state ); + rep_len_encoder.encode( range_encoder, len, pos_state ); state.set_rep(); } } |