aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_encoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-15 08:36:25 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-15 08:36:25 +0200
commit9f9b1983013048f2142e8bc7e240149d2687bedc (patch)
treecee2139cc8e5de11d0f5baca7aec714624e596b7 /src/liblzma/lzma/lzma_encoder.c
parentFix CRC code in case --enable-small is used. (diff)
downloadxz-9f9b1983013048f2142e8bc7e240149d2687bedc.tar.xz
Convert bittree_get_price() and bittree_reverse_get_price()
from macros to inline functions.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lzma/lzma_encoder.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/liblzma/lzma/lzma_encoder.c b/src/liblzma/lzma/lzma_encoder.c
index 2c46b0c5..f68633b8 100644
--- a/src/liblzma/lzma/lzma_encoder.c
+++ b/src/liblzma/lzma/lzma_encoder.c
@@ -116,23 +116,18 @@ lzma_length_encoder_update_table(lzma_length_encoder *lencoder,
uint32_t *prices = lencoder->prices[pos_state];
uint32_t i = 0;
- for (i = 0; i < num_symbols && i < LEN_LOW_SYMBOLS; ++i) {
- prices[i] = a0;
- bittree_get_price(prices[i], lencoder->low[pos_state],
+ for (i = 0; i < num_symbols && i < LEN_LOW_SYMBOLS; ++i)
+ prices[i] = a0 + bittree_get_price(lencoder->low[pos_state],
LEN_LOW_BITS, i);
- }
- for (; i < num_symbols && i < LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS; ++i) {
- prices[i] = b0;
- bittree_get_price(prices[i], lencoder->mid[pos_state],
+ for (; i < num_symbols && i < LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS; ++i)
+ prices[i] = b0 + bittree_get_price(lencoder->mid[pos_state],
LEN_MID_BITS, i - LEN_LOW_SYMBOLS);
- }
- for (; i < num_symbols; ++i) {
- prices[i] = b1;
- bittree_get_price(prices[i], lencoder->high, LEN_HIGH_BITS,
+ for (; i < num_symbols; ++i)
+ prices[i] = b1 + bittree_get_price(
+ lencoder->high, LEN_HIGH_BITS,
i - LEN_LOW_SYMBOLS - LEN_MID_SYMBOLS);
- }
lencoder->counters[pos_state] = num_symbols;