summaryrefslogtreecommitdiffstats
path: root/encoder.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--encoder.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/encoder.c b/encoder.c
index 66358cb..088a9e5 100644
--- a/encoder.c
+++ b/encoder.c
@@ -317,7 +317,7 @@ static void LZe_fill_align_prices( struct LZ_encoder * const encoder )
static void LZe_fill_distance_prices( struct LZ_encoder * const encoder )
{
- int dis, dis_state;
+ int dis, len_state;
for( dis = start_dis_model; dis < modeled_distances; ++dis )
{
const int dis_slot = dis_slots[dis];
@@ -326,15 +326,15 @@ static void LZe_fill_distance_prices( struct LZ_encoder * const encoder )
const int price =
price_symbol_reversed( encoder->bm_dis + base - dis_slot - 1,
dis - base, direct_bits );
- for( dis_state = 0; dis_state < max_dis_states; ++dis_state )
- encoder->dis_prices[dis_state][dis] = price;
+ for( len_state = 0; len_state < len_states; ++len_state )
+ encoder->dis_prices[len_state][dis] = price;
}
- for( dis_state = 0; dis_state < max_dis_states; ++dis_state )
+ for( len_state = 0; len_state < len_states; ++len_state )
{
- int * const dsp = encoder->dis_slot_prices[dis_state];
- int * const dp = encoder->dis_prices[dis_state];
- const Bit_model * const bmds = encoder->bm_dis_slot[dis_state];
+ int * const dsp = encoder->dis_slot_prices[len_state];
+ int * const dp = encoder->dis_prices[len_state];
+ const Bit_model * const bmds = encoder->bm_dis_slot[len_state];
int slot = 0;
for( ; slot < end_dis_model && slot < encoder->num_dis_slots; ++slot )
dsp[slot] = price_symbol( bmds, slot, dis_slot_bits );
@@ -365,7 +365,7 @@ bool LZe_init( struct LZ_encoder * const encoder,
Bm_array_init( encoder->bm_rep1, states );
Bm_array_init( encoder->bm_rep2, states );
Bm_array_init( encoder->bm_len[0], states * pos_states );
- Bm_array_init( encoder->bm_dis_slot[0], max_dis_states * (1 << dis_slot_bits) );
+ Bm_array_init( encoder->bm_dis_slot[0], len_states * (1 << dis_slot_bits) );
Bm_array_init( encoder->bm_dis, modeled_distances - end_dis_model );
Bm_array_init( encoder->bm_align, dis_align_size );