summaryrefslogtreecommitdiffstats
path: root/encoder.c
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.c
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 '')
-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 );