diff options
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 // ////////////////// |