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.c | |
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.c')
-rw-r--r-- | src/liblzma/rangecoder/range_encoder.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/liblzma/rangecoder/range_encoder.c b/src/liblzma/rangecoder/range_encoder.c deleted file mode 100644 index f03bd873..00000000 --- a/src/liblzma/rangecoder/range_encoder.c +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -/// \file range_encoder.c -/// \brief Static initializations for the range encoder's prices array -// -// Copyright (C) 1999-2006 Igor Pavlov -// Copyright (C) 2007 Lasse Collin -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -/////////////////////////////////////////////////////////////////////////////// - -#include "range_encoder.h" - - -#define NUM_BITS (BIT_MODEL_TOTAL_BITS - MOVE_REDUCING_BITS) - - -uint32_t lzma_rc_prob_prices[BIT_MODEL_TOTAL >> MOVE_REDUCING_BITS]; - - -extern void -lzma_rc_init(void) -{ - // Initialize lzma_rc_prob_prices[]. - for (int i = NUM_BITS - 1; i >= 0; --i) { - const uint32_t start = 1 << (NUM_BITS - i - 1); - const uint32_t end = 1 << (NUM_BITS - i); - - for (uint32_t j = start; j < end; ++j) { - lzma_rc_prob_prices[j] = (i << BIT_PRICE_SHIFT_BITS) - + (((end - j) << BIT_PRICE_SHIFT_BITS) - >> (NUM_BITS - i - 1)); - } - } - - return; -} |