diff options
Diffstat (limited to 'encoder.h')
-rw-r--r-- | encoder.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 ) |