summaryrefslogtreecommitdiffstats
path: root/encoder.h
diff options
context:
space:
mode:
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 b3d3c8b..ac98e6a 100644
--- a/encoder.h
+++ b/encoder.h
@@ -591,7 +591,7 @@ struct LZ_encoder
Bit_model bm_rep1[states];
Bit_model bm_rep2[states];
Bit_model bm_len[states][pos_states];
- Bit_model bm_dis_slot[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];
@@ -605,8 +605,8 @@ struct LZ_encoder
struct Pair pairs[max_match_len+1];
struct Trial trials[max_num_trials];
- int dis_slot_prices[dis_states][2*max_dictionary_bits];
- int dis_prices[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;
int fill_counter;
@@ -678,12 +678,12 @@ static inline int LZe_price_rep0_len( const struct LZ_encoder * const encoder,
}
static inline int LZe_price_dis( const struct LZ_encoder * const encoder,
- const int dis, const int dis_state )
+ const int dis, const int len_state )
{
if( dis < modeled_distances )
- return encoder->dis_prices[dis_state][dis];
+ return encoder->dis_prices[len_state][dis];
else
- return encoder->dis_slot_prices[dis_state][get_slot( dis )] +
+ return encoder->dis_slot_prices[len_state][get_slot( dis )] +
encoder->align_prices[dis & (dis_align_size - 1)];
}
@@ -692,7 +692,7 @@ static inline int LZe_price_pair( const struct LZ_encoder * const encoder,
const int pos_state )
{
return Lee_price( &encoder->match_len_encoder, len, pos_state ) +
- LZe_price_dis( encoder, dis, get_dis_state( len ) );
+ LZe_price_dis( encoder, dis, get_len_state( len ) );
}
static inline int LZe_price_literal( const struct LZ_encoder * const encoder,
@@ -723,7 +723,7 @@ static inline void LZe_encode_pair( struct LZ_encoder * const encoder,
{
const int dis_slot = get_slot( dis );
Lee_encode( &encoder->match_len_encoder, &encoder->renc, len, pos_state );
- Re_encode_tree( &encoder->renc, encoder->bm_dis_slot[get_dis_state(len)],
+ Re_encode_tree( &encoder->renc, encoder->bm_dis_slot[get_len_state(len)],
dis_slot, dis_slot_bits );
if( dis_slot >= start_dis_model )