summaryrefslogtreecommitdiffstats
path: root/encoder.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:00:38 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:00:38 +0000
commitf66493cb0e2e4baa840bdbf4894d02b54ef38d52 (patch)
treeeaf63e5a5650e0fe54293aa687f83d46aa28b7fc /encoder.h
parentAdding debian version 1.15~rc1-1. (diff)
downloadlzip-f66493cb0e2e4baa840bdbf4894d02b54ef38d52.tar.xz
lzip-f66493cb0e2e4baa840bdbf4894d02b54ef38d52.zip
Merging upstream version 1.15.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'encoder.h')
-rw-r--r--encoder.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/encoder.h b/encoder.h
index 577ceeb..725d0e8 100644
--- a/encoder.h
+++ b/encoder.h
@@ -427,7 +427,7 @@ protected:
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];
@@ -488,7 +488,7 @@ protected:
{
match_len_encoder.encode( renc, len, pos_state );
const int dis_slot = get_slot( dis );
- renc.encode_tree( bm_dis_slot[get_dis_state(len)], dis_slot, dis_slot_bits );
+ renc.encode_tree( bm_dis_slot[get_len_state(len)], dis_slot, dis_slot_bits );
if( dis_slot >= start_dis_model )
{
@@ -560,8 +560,8 @@ class LZ_encoder : public LZ_encoder_base
struct Pair pairs[max_match_len+1];
Trial trials[max_num_trials];
- int dis_slot_prices[max_dis_states][2*max_dictionary_bits];
- int dis_prices[max_dis_states][modeled_distances];
+ int dis_slot_prices[len_states][2*max_dictionary_bits];
+ int dis_prices[len_states][modeled_distances];
int align_prices[dis_align_size];
int align_price_count;
@@ -594,19 +594,19 @@ class LZ_encoder : public LZ_encoder_base
rep_len_encoder.price( len, pos_state );
}
- int price_dis( const int dis, const int dis_state ) const
+ int price_dis( const int dis, const int len_state ) const
{
if( dis < modeled_distances )
- return dis_prices[dis_state][dis];
+ return dis_prices[len_state][dis];
else
- return dis_slot_prices[dis_state][get_slot( dis )] +
+ return dis_slot_prices[len_state][get_slot( dis )] +
align_prices[dis & (dis_align_size - 1)];
}
int price_pair( const int dis, const int len, const int pos_state ) const
{
return match_len_encoder.price( len, pos_state ) +
- price_dis( dis, get_dis_state( len ) );
+ price_dis( dis, get_len_state( len ) );
}
int read_match_distances()