aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_literal.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-06-19 16:35:08 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-06-19 16:35:08 +0300
commit0809c46534fa5664fe35d9e98d95e87312ed130e (patch)
tree6923ece40819c97cdd786dfdb01a7904043b1026 /src/liblzma/lzma/lzma_literal.h
parentComments (diff)
downloadxz-0809c46534fa5664fe35d9e98d95e87312ed130e.tar.xz
Add limit of lc + lp <= 4. Now we can allocate the
literal coder as part of the main LZMA encoder or decoder structure. Make the LZMA decoder to rely on the current internal API to free the allocated memory in case an error occurs.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lzma/lzma_literal.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/liblzma/lzma/lzma_literal.h b/src/liblzma/lzma/lzma_literal.h
index 174f5ed4..208abd99 100644
--- a/src/liblzma/lzma/lzma_literal.h
+++ b/src/liblzma/lzma/lzma_literal.h
@@ -45,9 +45,9 @@
/// byte; and
/// - the highest literal_context_bits bits of the previous byte.
#define literal_get_subcoder(literal_coder, pos, prev_byte) \
- (literal_coder)->coders[(((pos) & (literal_coder)->literal_pos_mask) \
- << (literal_coder)->literal_context_bits) \
- + ((prev_byte) >> (8 - (literal_coder)->literal_context_bits))]
+ (literal_coder).coders[(((pos) & (literal_coder).literal_pos_mask) \
+ << (literal_coder).literal_context_bits) \
+ + ((prev_byte) >> (8 - (literal_coder).literal_context_bits))]
typedef struct {
@@ -59,16 +59,13 @@ typedef struct {
/// There are (1 << (literal_pos_bits + literal_context_bits))
/// literal coders.
- probability coders[][LIT_SIZE];
+ probability coders[1 << LZMA_LITERAL_BITS_MAX][LIT_SIZE];
} lzma_literal_coder;
extern lzma_ret lzma_literal_init(
- lzma_literal_coder **coder, lzma_allocator *allocator,
+ lzma_literal_coder *coder,
uint32_t literal_context_bits, uint32_t literal_pos_bits);
-extern void lzma_literal_end(
- lzma_literal_coder **coder, lzma_allocator *allocator);
-
#endif