/* States and probability entries for item type disambiguation */
u32 main_state;
- struct lzms_probability_entry main_probs[LZMS_NUM_MAIN_PROBS];
-
u32 match_state;
- struct lzms_probability_entry match_probs[LZMS_NUM_MATCH_PROBS];
-
u32 lz_state;
- struct lzms_probability_entry lz_probs[LZMS_NUM_LZ_PROBS];
-
u32 delta_state;
- struct lzms_probability_entry delta_probs[LZMS_NUM_DELTA_PROBS];
-
u32 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS];
+ u32 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS];
+
+ struct lzms_probability_entry main_probs[LZMS_NUM_MAIN_PROBS];
+ struct lzms_probability_entry match_probs[LZMS_NUM_MATCH_PROBS];
+ struct lzms_probability_entry lz_probs[LZMS_NUM_LZ_PROBS];
+ struct lzms_probability_entry delta_probs[LZMS_NUM_DELTA_PROBS];
struct lzms_probability_entry lz_rep_probs[LZMS_NUM_LZ_REP_DECISIONS]
[LZMS_NUM_LZ_REP_PROBS];
-
- u32 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS];
struct lzms_probability_entry delta_rep_probs[LZMS_NUM_DELTA_REP_DECISIONS]
[LZMS_NUM_DELTA_REP_PROBS];
/* Load the probability entry corresponding to the current state. */
prob_entry = &probs[*state_p];
- /* Get the probability (out of LZMS_PROBABILITY_DENOMINATOR) that the
- * next bit is 0. */
- prob = lzms_get_probability(prob_entry);
-
/* Normalize if needed. */
if (rd->range <= 0xffff) {
rd->range <<= 16;
rd->code |= le16_to_cpu(*rd->next++);
}
+ /* Get the probability (out of LZMS_PROBABILITY_DENOMINATOR) that the
+ * next bit is 0. */
+ prob = lzms_get_probability(prob_entry);
+
/* Based on the probability, calculate the bound between the 0-bit
* region and the 1-bit region of the range. */
bound = (rd->range >> LZMS_PROBABILITY_BITS) * prob;
}
}
-static int
+static inline int
lzms_decode_main_bit(struct lzms_decompressor *d)
{
return lzms_decode_bit(&d->rd, &d->main_state,
LZMS_NUM_MAIN_PROBS, d->main_probs);
}
-static int
+static inline int
lzms_decode_match_bit(struct lzms_decompressor *d)
{
return lzms_decode_bit(&d->rd, &d->match_state,
LZMS_NUM_MATCH_PROBS, d->match_probs);
}
-static int
+static inline int
lzms_decode_lz_bit(struct lzms_decompressor *d)
{
return lzms_decode_bit(&d->rd, &d->lz_state,
LZMS_NUM_LZ_PROBS, d->lz_probs);
}
-static int
+static inline int
lzms_decode_delta_bit(struct lzms_decompressor *d)
{
return lzms_decode_bit(&d->rd, &d->delta_state,
LZMS_NUM_DELTA_PROBS, d->delta_probs);
}
-static noinline int
+static inline int
lzms_decode_lz_rep_bit(struct lzms_decompressor *d, int idx)
{
return lzms_decode_bit(&d->rd, &d->lz_rep_states[idx],
LZMS_NUM_LZ_REP_PROBS, d->lz_rep_probs[idx]);
}
-static noinline int
+static inline int
lzms_decode_delta_rep_bit(struct lzms_decompressor *d, int idx)
{
return lzms_decode_bit(&d->rd, &d->delta_rep_states[idx],
return sym;
}
-static unsigned
+static inline unsigned
lzms_decode_literal(struct lzms_decompressor *d)
{
return lzms_decode_huffman_symbol(&d->is,
&d->literal_rebuild_info);
}
-static u32
+static inline u32
lzms_decode_lz_offset(struct lzms_decompressor *d)
{
unsigned slot = lzms_decode_huffman_symbol(&d->is,
lzms_read_bits(&d->is, lzms_extra_offset_bits[slot]);
}
-static u32
+static inline u32
lzms_decode_length(struct lzms_decompressor *d)
{
unsigned slot = lzms_decode_huffman_symbol(&d->is,
return length;
}
-static u32
+static inline u32
lzms_decode_delta_offset(struct lzms_decompressor *d)
{
unsigned slot = lzms_decode_huffman_symbol(&d->is,
lzms_read_bits(&d->is, lzms_extra_offset_bits[slot]);
}
-static unsigned
+static inline unsigned
lzms_decode_delta_power(struct lzms_decompressor *d)
{
return lzms_decode_huffman_symbol(&d->is,