aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_encoder_getoptimum.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_getoptimum.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_getoptimum.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/liblzma/lzma/lzma_encoder_getoptimum.c b/src/liblzma/lzma/lzma_encoder_getoptimum.c
index cdeb3145..b00f5c38 100644
--- a/src/liblzma/lzma/lzma_encoder_getoptimum.c
+++ b/src/liblzma/lzma/lzma_encoder_getoptimum.c
@@ -111,8 +111,7 @@ fill_distances_prices(lzma_coder *coder)
const uint32_t pos_slot = get_pos_slot(i);
const uint32_t footer_bits = ((pos_slot >> 1) - 1);
const uint32_t base = (2 | (pos_slot & 1)) << footer_bits;
- temp_prices[i] = 0;
- bittree_reverse_get_price(temp_prices[i],
+ temp_prices[i] = bittree_reverse_get_price(
coder->pos_encoders + base - pos_slot - 1,
footer_bits, i - base);
}
@@ -129,8 +128,7 @@ fill_distances_prices(lzma_coder *coder)
for (uint32_t pos_slot = 0;
pos_slot < dist_table_size;
++pos_slot) {
- pos_slot_prices[pos_slot] = 0;
- bittree_get_price(pos_slot_prices[pos_slot], encoder,
+ pos_slot_prices[pos_slot] = bittree_get_price(encoder,
POS_SLOT_BITS, pos_slot);
}
@@ -162,14 +160,12 @@ fill_distances_prices(lzma_coder *coder)
static void
fill_align_prices(lzma_coder *coder)
{
- for (uint32_t i = 0; i < ALIGN_TABLE_SIZE; ++i) {
- uint32_t tmp = 0;
- bittree_reverse_get_price(tmp, coder->pos_align_encoder,
- ALIGN_BITS, i);
- coder->align_prices[i] = tmp;
- }
+ for (uint32_t i = 0; i < ALIGN_TABLE_SIZE; ++i)
+ coder->align_prices[i] = bittree_reverse_get_price(
+ coder->pos_align_encoder, ALIGN_BITS, i);
coder->align_price_count = 0;
+ return;
}