diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-15 14:02:22 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-15 14:02:22 +0200 |
commit | e5728142a2048979f5c0c2149ce71ae952a092e1 (patch) | |
tree | 7ea154a3a970afecf25b5de654d9c915e9c0c84d /src/liblzma/lzma/lzma_encoder_init.c | |
parent | Added bsr.h. (diff) | |
download | xz-e5728142a2048979f5c0c2149ce71ae952a092e1.tar.xz |
Revised the fastpos code. It now uses the slightly faster
table-based version from LZMA SDK 4.57. This should be
fast on most systems.
A simpler and smaller alternative version is also provided.
On some CPUs this can be even a little faster than the
default table-based version (see comments in fastpos.h),
but on most systems the table-based code is faster.
Diffstat (limited to 'src/liblzma/lzma/lzma_encoder_init.c')
-rw-r--r-- | src/liblzma/lzma/lzma_encoder_init.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/liblzma/lzma/lzma_encoder_init.c b/src/liblzma/lzma/lzma_encoder_init.c index d7807529..dc66977a 100644 --- a/src/liblzma/lzma/lzma_encoder_init.c +++ b/src/liblzma/lzma/lzma_encoder_init.c @@ -21,28 +21,6 @@ #include "lzma_encoder_private.h" -uint8_t lzma_fastpos[1 << 11]; - -extern void -lzma_fastpos_init(void) -{ - static const uint8_t fast_slots = 22; - - int c = 2; - lzma_fastpos[0] = 0; - lzma_fastpos[1] = 1; - - for (uint8_t slot_fast = 2; slot_fast < fast_slots; ++slot_fast) { - const uint32_t k = (1 << ((slot_fast >> 1) - 1)); - - for (uint32_t j = 0; j < k; ++j, ++c) - lzma_fastpos[c] = slot_fast; - } - - return; -} - - /// \brief Initializes the length encoder static void length_encoder_reset(lzma_length_encoder *lencoder, |