cbfstool/lzma: Remove code which depends on commented out defines

These options seem to control the behavior of the encoder/decoder,
with comments citing a trade-off between memory usage and performance.
I removed these in a separate patch to make reverting in the future
easier, if we find these options are useful.

Change-Id: I24cb7101b89e60f4fb96777e3681c03d2a62e3d5
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/5084
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Alexandru Gagniuc 2014-01-29 16:55:48 -06:00
parent c1d1fd850e
commit 7c9bb41817
3 changed files with 3 additions and 21 deletions

View File

@ -28,11 +28,6 @@
#define TREE_DECODE(probs, limit, i) \ #define TREE_DECODE(probs, limit, i) \
{ i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
/* #define _LZMA_SIZE_OPT */
#ifdef _LZMA_SIZE_OPT
#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
#else
#define TREE_6_DECODE(probs, i) \ #define TREE_6_DECODE(probs, i) \
{ i = 1; \ { i = 1; \
TREE_GET_BIT(probs, i); \ TREE_GET_BIT(probs, i); \
@ -42,7 +37,6 @@
TREE_GET_BIT(probs, i); \ TREE_GET_BIT(probs, i); \
TREE_GET_BIT(probs, i); \ TREE_GET_BIT(probs, i); \
i -= 0x40; } i -= 0x40; }
#endif
#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } #define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }

View File

@ -6,16 +6,7 @@
#include "Types.h" #include "Types.h"
/* #define _LZMA_PROB32 */ typedef uint16_t CLzmaProb;
/* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */
#ifdef _LZMA_PROB32
#define CLzmaProb uint32_t
#else
#define CLzmaProb uint16_t
#endif
/* ---------- LZMA Properties ---------- */ /* ---------- LZMA Properties ---------- */

View File

@ -174,11 +174,8 @@ struct COptimal
#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) #define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
#ifdef _LZMA_PROB32 typedef uint16_t CLzmaProb;
#define CLzmaProb uint32_t
#else
#define CLzmaProb uint16_t
#endif
#define LZMA_PB_MAX 4 #define LZMA_PB_MAX 4
#define LZMA_LC_MAX 8 #define LZMA_LC_MAX 8