diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-15 07:40:21 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-15 07:40:21 +0200 |
commit | d13d693155c176fc9e9ad5c50d48ccba27c2d9c6 (patch) | |
tree | b688e0baaca289c39c329bae9fafb97f3b68682b /src/liblzma/rangecoder/range_encoder.h | |
parent | Remove RC_BUFFER_SIZE from lzma_encoder_private.h (diff) | |
download | xz-d13d693155c176fc9e9ad5c50d48ccba27c2d9c6.tar.xz |
Added precomputed range coder probability price table.
Diffstat (limited to 'src/liblzma/rangecoder/range_encoder.h')
-rw-r--r-- | src/liblzma/rangecoder/range_encoder.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/liblzma/rangecoder/range_encoder.h b/src/liblzma/rangecoder/range_encoder.h index cd5e6457..9f03e226 100644 --- a/src/liblzma/rangecoder/range_encoder.h +++ b/src/liblzma/rangecoder/range_encoder.h @@ -246,21 +246,20 @@ do { \ } while (0) -////////////////////// -// Global variables // -////////////////////// - -// Probability prices used by *_get_price() macros. This is initialized -// by lzma_rc_init() and is not modified later. +#ifdef HAVE_SMALL +/// Probability prices used by *_get_price() macros. This is initialized +/// by lzma_rc_init() and is not modified later. extern uint32_t lzma_rc_prob_prices[BIT_MODEL_TOTAL >> MOVE_REDUCING_BITS]; - -/////////////// -// Functions // -/////////////// - /// Initializes lzma_rc_prob_prices[]. This needs to be called only once. extern void lzma_rc_init(void); +#else +// Not building a size optimized version, so we use a precomputed +// constant table. +extern const uint32_t +lzma_rc_prob_prices[BIT_MODEL_TOTAL >> MOVE_REDUCING_BITS]; + +#endif #endif |