diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-14 13:39:54 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-01-14 13:39:54 +0200 |
commit | e22b37968d153683fec61ad37b6b160cb7ca4ddc (patch) | |
tree | d9631e988ead9de0fcac67a9abc803a37324e3a6 /src/liblzma/lz/lz_encoder.h | |
parent | Added one assert() to process.c of the command line tool. (diff) | |
download | xz-e22b37968d153683fec61ad37b6b160cb7ca4ddc.tar.xz |
Major changes to LZ encoder, LZMA encoder, and range encoder.
These changes implement support for LZMA_SYNC_FLUSH in LZMA
encoder, and move the temporary buffer needed by range encoder
from lzma_range_encoder structure to lzma_lz_encoder.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/lz/lz_encoder.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/liblzma/lz/lz_encoder.h b/src/liblzma/lz/lz_encoder.h index fe94618b..11d12722 100644 --- a/src/liblzma/lz/lz_encoder.h +++ b/src/liblzma/lz/lz_encoder.h @@ -24,11 +24,15 @@ #include "common.h" +#define LZMA_LZ_TEMP_SIZE 64 + + typedef struct lzma_lz_encoder_s lzma_lz_encoder; struct lzma_lz_encoder_s { enum { - SEQ_INIT, SEQ_RUN, + SEQ_FLUSH, + SEQ_FLUSH_END, SEQ_FINISH, SEQ_END } sequence; @@ -36,8 +40,15 @@ struct lzma_lz_encoder_s { bool (*process)(lzma_coder *coder, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size); + /// Uncompressed Size or LZMA_VLI_VALUE_UNKNOWN if using EOPM. We need + /// to track Uncompressed Size to prevent writing flush marker to the + /// very end of stream that doesn't use EOPM. lzma_vli uncompressed_size; + /// Temporary buffer for range encoder. + uint8_t temp[LZMA_LZ_TEMP_SIZE]; + size_t temp_size; + /////////////// // In Window // /////////////// @@ -84,10 +95,6 @@ struct lzma_lz_encoder_s { /// is allowed to reach write_pos). size_t keep_size_after; - /// This is set to true once the last byte of the input data has - /// been copied to buffer. - bool stream_end_was_reached; - ////////////////// // Match Finder // ////////////////// |