summaryrefslogtreecommitdiffstats
path: root/encoder.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 11:40:25 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 11:40:25 +0000
commit90cd6e9b8b41a5418b87ab3f4832fdcc3cf2c3f5 (patch)
treea728c7e31e9a10563bdf13b21214f69e9d575f04 /encoder.h
parentAdding debian version 1.5~rc1-1. (diff)
downloadclzip-90cd6e9b8b41a5418b87ab3f4832fdcc3cf2c3f5.tar.xz
clzip-90cd6e9b8b41a5418b87ab3f4832fdcc3cf2c3f5.zip
Merging upstream version 1.5.
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 365d602..a1d9478 100644
--- a/encoder.h
+++ b/encoder.h
@@ -488,7 +488,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[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];
@@ -501,8 +501,8 @@ struct LZ_encoder
struct Pair pairs[max_match_len+1];
struct 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;
};
@@ -568,12 +568,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)];
}
@@ -582,7 +582,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,
@@ -613,7 +613,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 )