lzma_coder_s Struct Reference

Public Types

enum  {
  SEQ_PROPERTIES, SEQ_DICTIONARY_SIZE, SEQ_UNCOMPRESSED_SIZE, SEQ_CODER_INIT,
  SEQ_CODE
}
enum  { SEQ_HEADER, SEQ_CODE }
enum  { SEQ_INIT, SEQ_CODE, SEQ_FINISH }
enum  { SEQ_CODE, SEQ_PADDING, SEQ_CHECK }
enum  { SEQ_CODE, SEQ_PADDING, SEQ_CHECK }
enum  {
  SEQ_INDICATOR, SEQ_COUNT, SEQ_MEMUSAGE, SEQ_UNPADDED,
  SEQ_UNCOMPRESSED, SEQ_PADDING_INIT, SEQ_PADDING, SEQ_CRC32
}
enum  {
  SEQ_INDICATOR, SEQ_COUNT, SEQ_UNPADDED, SEQ_UNCOMPRESSED,
  SEQ_NEXT, SEQ_PADDING, SEQ_CRC32
}
enum  {
  SEQ_STREAM_HEADER, SEQ_BLOCK_HEADER, SEQ_BLOCK, SEQ_INDEX,
  SEQ_STREAM_FOOTER, SEQ_STREAM_PADDING
}
enum  {
  SEQ_STREAM_HEADER, SEQ_BLOCK_INIT, SEQ_BLOCK_HEADER, SEQ_BLOCK_ENCODE,
  SEQ_INDEX_ENCODE, SEQ_STREAM_FOOTER
}
enum  sequence {
  SEQ_CONTROL, SEQ_UNCOMPRESSED_1, SEQ_UNCOMPRESSED_2, SEQ_COMPRESSED_0,
  SEQ_COMPRESSED_1, SEQ_PROPERTIES, SEQ_LZMA, SEQ_COPY
}
enum  {
  SEQ_INIT, SEQ_LZMA_ENCODE, SEQ_LZMA_COPY, SEQ_UNCOMPRESSED_HEADER,
  SEQ_UNCOMPRESSED_COPY
}
enum  {
  SEQ_NORMALIZE, SEQ_IS_MATCH, seq_8 = (SEQ_LITERAL), seq_8 = (SEQ_LITERAL),
  SEQ_LITERAL_WRITE, SEQ_IS_REP, seq_len = (SEQ_MATCH_LEN), seq_6 = (SEQ_POS_SLOT),
  SEQ_POS_MODEL, SEQ_DIRECT, seq_4 = (SEQ_ALIGN), SEQ_EOPM,
  SEQ_IS_REP0, SEQ_SHORTREP, SEQ_IS_REP0_LONG, SEQ_IS_REP1,
  SEQ_IS_REP2, seq_len = (SEQ_MATCH_LEN), SEQ_COPY
}
 

Position where to continue the decoder loop.

More...
enum  {
  SEQ_FLAGS, SEQ_FILTER_FLAGS, SEQ_FILTER_END, SEQ_REPEAT_COUNT_1,
  SEQ_REPEAT_COUNT_2, SEQ_REPEAT_COUNT_3, SEQ_REPEAT_SIZE, SEQ_REPEAT_READ_DATA,
  SEQ_SIZE_1, SEQ_SIZE_2, SEQ_SIZE_3, SEQ_DATA,
  SEQ_REPEAT_FAST, SEQ_REPEAT_NORMAL
}
enum  {
  SEQ_FILL, SEQ_FLUSH, SEQ_RLE_COUNT_0, SEQ_RLE_COUNT_1,
  SEQ_RLE_COUNT_2, SEQ_RLE_COUNT_3, SEQ_RLE_SIZE, SEQ_RLE_DATA,
  SEQ_DATA_SIZE_0, SEQ_DATA_SIZE_1, SEQ_DATA_SIZE_2, SEQ_DATA_SIZE_3,
  SEQ_DATA, SEQ_SUBFILTER_INIT, SEQ_SUBFILTER_FLAGS
}

Data Fields

lzma_next_coder next
 Stream decoder or LZMA_Alone decoder.
enum lzma_coder_s:: { ... }  sequence
size_t pos
 Position in the header fields.
lzma_vli uncompressed_size
 Uncompressed size decoded from the header.
uint64_t memlimit
 Memory usage limit.
uint64_t memusage
 Amount of memory actually needed (only an estimate).
lzma_options_lzma options
enum lzma_coder_s:: { ... }  sequence
size_t header_pos
uint8_t header [ALONE_HEADER_SIZE]
uint32_t flags
enum lzma_coder_s:: { ... }  sequence
enum lzma_coder_s:: { ... }  sequence
lzma_blockblock
lzma_vli compressed_size
 Compressed Size calculated while decoding.
lzma_vli compressed_limit
size_t check_pos
 Position when reading the Check field.
lzma_check_state check
 Check of the uncompressed data.
enum lzma_coder_s:: { ... }  sequence
lzma_next_coder stream_encoder
lzma_options_lzma opt_lzma
 Options for LZMA2.
lzma_filter filters [LZMA_FILTERS_MAX+1]
enum lzma_coder_s:: { ... }  sequence
lzma_indexindex
 Target Index.
lzma_vli count
 Number of Records left to decode.
lzma_vli unpadded_size
 The most recent Unpadded Size field.
uint32_t crc32
 CRC32 of the List of Records field.
enum lzma_coder_s:: { ... }  sequence
lzma_index_record record
 The current Index Record being encoded.
enum lzma_coder_s:: { ... }  sequence
lzma_next_coder block_decoder
lzma_block block_options
 Options for the Block encoder.
lzma_stream_flags stream_flags
 Stream Flags from Stream Header.
lzma_index_hashindex_hash
bool tell_no_check
bool tell_unsupported_check
bool tell_any_check
 If true, LZMA_GET_CHECK is returned after decoding Stream Header.
bool concatenated
bool first_stream
uint8_t buffer [LZMA_BLOCK_HEADER_SIZE_MAX]
 Temporary buffer.
enum lzma_coder_s:: { ... }  sequence
lzma_next_coder block_encoder
 Block.
lzma_next_coder index_encoder
size_t buffer_pos
 Read position in buffer[].
size_t buffer_size
 Total number of bytes in buffer[].
size_t distance
 Delta distance.
uint8_t pos
 Position in history[].
uint8_t history [LZMA_DELTA_DIST_MAX]
 Buffer to hold history of the original data.
lzma_dict dict
 Dictionary (history buffer).
lzma_lz_decoder lz
 The actual LZ-based decoder e.g. LZMA.
bool next_finished
 True if the next filter in the chain has returned LZMA_STREAM_END.
bool this_finished
struct {
   size_t   pos
   size_t   size
   uint8_t   buffer [LZMA_BUFFER_SIZE]
temp
lzma_lz_encoder lz
 LZ-based encoder e.g. LZMA.
lzma_mf mf
 History buffer and match finder.
enum lzma_coder_s::sequence sequence
enum sequence next_sequence
 Sequence after the size fields have been decoded.
lzma_lz_decoder lzma
 LZMA decoder.
size_t uncompressed_size
 Uncompressed size of LZMA chunk.
size_t compressed_size
bool need_properties
bool need_dictionary_reset
enum lzma_coder_s:: { ... }  sequence
lzma_coderlzma
 LZMA encoder.
const lzma_options_lzmaopt_new
lzma_options_lzma opt_cur
 LZMA options currently in use.
bool need_state_reset
size_t buf_pos
 Read position in buf[].
uint8_t buf [LZMA2_HEADER_MAX+LZMA2_CHUNK_MAX]
 Buffer to hold the chunk header and LZMA compressed data.
probability literal [LITERAL_CODERS_MAX][LITERAL_CODER_SIZE]
 Literals; see comments in lzma_common.h.
probability is_match [STATES][POS_STATES_MAX]
 If 1, it's a match. Otherwise it's a single 8-bit literal.
probability is_rep [STATES]
 If 1, it's a repeated match. The distance is one of rep0 .. rep3.
probability is_rep0 [STATES]
probability is_rep1 [STATES]
probability is_rep2 [STATES]
 If 0, distance of a repeated match is rep2. Otherwise it is rep3.
probability is_rep0_long [STATES][POS_STATES_MAX]
probability pos_slot [LEN_TO_POS_STATES][POS_SLOTS]
probability pos_special [FULL_DISTANCES-END_POS_MODEL_INDEX]
probability pos_align [ALIGN_TABLE_SIZE]
lzma_length_decoder match_len_decoder
 Length of a normal match.
lzma_length_decoder rep_len_decoder
 Length of a repeated match.
lzma_range_decoder rc
lzma_lzma_state state
 State.
uint32_t rep0
 Distance of the latest match.
uint32_t rep1
 Distance of second latest match.
uint32_t rep2
 Distance of third latest match.
uint32_t rep3
 Distance of fourth latest match.
uint32_t pos_mask
 (1 << pos_bits) - 1
uint32_t literal_context_bits
uint32_t literal_pos_mask
enum lzma_coder_s:: { ... }  sequence
 Position where to continue the decoder loop.
probabilityprobs
 Base of the current probability tree.
uint32_t symbol
uint32_t limit
uint32_t offset
uint32_t len
lzma_range_encoder rc
 Range encoder.
uint32_t reps [REP_DISTANCES]
 The four most recent match distances.
lzma_match matches [MATCH_LEN_MAX+1]
 Array of match candidates.
uint32_t matches_count
 Number of match candidates in matches[].
uint32_t longest_match_length
bool fast_mode
 True if using getoptimumfast.
bool is_initialized
bool is_flushed
lzma_length_encoder match_len_encoder
lzma_length_encoder rep_len_encoder
uint32_t pos_slot_prices [LEN_TO_POS_STATES][POS_SLOTS]
uint32_t distances_prices [LEN_TO_POS_STATES][FULL_DISTANCES]
uint32_t dist_table_size
uint32_t match_price_count
uint32_t align_prices [ALIGN_TABLE_SIZE]
uint32_t align_price_count
uint32_t opts_end_index
uint32_t opts_current_index
lzma_optimal opts [OPTS]
bool end_was_reached
bool is_encoder
size_t(* filter )(lzma_simple *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size)
lzma_simplesimple
uint32_t now_pos
size_t allocated
 Size of the memory allocated for the buffer.
size_t filtered
enum lzma_coder_s:: { ... }  sequence
uint32_t padding
 Number of consecutive Subblocks with Subblock Type Padding.
bool allow_subfilters
 True if Subfilters are allowed.
bool got_output_with_subfilter
lzma_next_coder subfilter
 Possible subfilter.
lzma_next_coder filter_flags_decoder
lzma_filter filter_flags
 The filter_flags_decoder stores its results here.
lzma_options_subblock_helper helper
struct {
   size_t   count
 How many times buffer should be repeated.
   size_t   size
 Size of the buffer.
   size_t   pos
 Position in the buffer.
   uint8_t   buffer [LZMA_SUBBLOCK_RLE_MAX]
 Buffer to hold the data to be repeated.
repeat
struct {
   size_t   pos
   size_t   size
   uint8_t   buffer [LZMA_BUFFER_SIZE]
temp
const
lzma_options_subblock_helper
options
enum lzma_coder_s:: { ... }  sequence
lzma_options_subblockoptions
uint32_t tmp
struct {
   uint32_t   multiple
   uint32_t   in_pos
   uint32_t   out_pos
 Number of bytes written out.
alignment
struct {
   uint8_t *   data
   size_t   size
 Number of bytes in the buffer.
   size_t   limit
 Allocated size of the buffer.
   uint32_t   in_pending
subblock
struct {
   uint8_t   buffer [LZMA_SUBBLOCK_RLE_MAX]
   size_t   size
 Number of bytes in buffer[].
   uint64_t   count
   uint32_t   in_pending
 Like subblock.in_pending above, but for RLE.
rle
struct {
enum  {
  SUB_NONE, SUB_SET, SUB_RUN, SUB_FLUSH,
  SUB_FINISH, SUB_END_MARKER
}
   enum lzma_coder_s:: { ... }    mode
   bool   allow
   bool   mode_locked
   bool   got_input
   size_t   in_avail
   uint8_t *   flags
   uint32_t   flags_size
 Size of Filter Flags field.
   lzma_next_coder   subcoder
 Pointers to Subfilter.
subfilter
struct {
   size_t   pos
   size_t   size
   uint8_t   buffer [LZMA_BUFFER_SIZE]
temp
 Temporary buffer used when we are not the last filter in the chain.

Member Enumeration Documentation

anonymous enum

Position where to continue the decoder loop.


Field Documentation

Stream decoder or LZMA_Alone decoder.

Next filter in the chain.

Next coder in the chain.

The filters in the chain; initialized with lzma_raw_decoder_init().

Next filter in the chain, if any. Note that LZMA and LZMA2 are only allowed as the last filter, but the long-range filter in future can be in the middle of the chain.

Referenced by copy_or_code(), and fill_window().

Position in the header fields.

Position in various arrays.

Position in the buffer.

Write position in buffer[] and position in Stream Padding.

Position in integers.

Position in the Check field.

Flushing position in the temporary buffer. buffer[pos] is the next byte to be copied to out[].

Referenced by copy_and_encode(), and encode_in_place().

Uncompressed size decoded from the header.

Uncompressed size of a chunk.

The most recent Uncompressed Size field.

Uncompressed Size calculated while encoding.

Uncompressed Size calculated while decoding.

Uncompressed size as bytes, or LZMA_VLI_UNKNOWN if end of payload marker is expected.

Memory usage limit.

Amount of memory actually needed (only an estimate).

Options decoded from the header needed to initialize the LZMA decoder

Decoding options; we also write Compressed Size and Uncompressed Size back to this structure when the decoding has been finished.

Encoding options; we also write Unpadded Size, Compressed Size, and Uncompressed Size back to this structure when the encoding has been finished.

Compressed Size calculated while decoding.

Compressed Size calculated while encoding.

Compressed size of a chunk (excluding headers); this is also used to indicate the end of buf[] in SEQ_LZMA_COPY.

Maximum allowed Compressed Size; this takes into account the size of the Block Header and Check fields when Compressed Size is unknown.

Position when reading the Check field.

Check of the uncompressed data.

Options for LZMA2.

lzma_filter lzma_coder_s::filters[LZMA_FILTERS_MAX+1]

We need to keep the filters array available in case LZMA_FULL_FLUSH is used.

Referenced by LZMA_API().

Target Index.

Index to hold sizes of the Blocks.

Index given to us to encode. Note that we modify it in sense that we read it, and read position is tracked in lzma_index structure.

Number of Records left to decode.

Referenced by subblock_rle_flush().

The most recent Unpadded Size field.

CRC32 of the List of Records field.

The current Index Record being encoded.

Block or Metadata decoder. This takes little memory and the same data structure can be used to decode every Block Header, so it's a good idea to have a separate lzma_next_coder structure for it.

Options for the Block encoder.

Block options decoded by the Block Header decoder and used by the Block decoder.

Stream Flags from Stream Header.

Index is hashed so that it can be compared to the sizes of Blocks with O(1) memory usage.

If true, LZMA_NO_CHECK is returned if the Stream has no integrity check.

If true, LZMA_UNSUPPORTED_CHECK is returned if the Stream has an integrity check that isn't supported by this liblzma build.

If true, LZMA_GET_CHECK is returned after decoding Stream Header.

If true, we will decode concatenated Streams that possibly have Stream Padding between or after them. LZMA_STREAM_END is returned once the application isn't giving us any new input, and we aren't in the middle of a Stream, and possible Stream Padding is a multiple of four bytes.

When decoding concatenated Streams, this is true as long as we are decoding the first Stream. This is needed to avoid misleading LZMA_FORMAT_ERROR in case the later Streams don't have valid magic bytes.

Temporary buffer.

Buffer to hold the data to be repeated.

Buffer to hold Stream Header, Block Header, and Stream Footer. Block Header has biggest maximum size.

Buffer to hold the data that may be coded with Subblock Type `Repeating Data'.

Referenced by subblock_rle_flush().

Block.

Index encoder. This is separate from Block encoder, because this doesn't take much memory, and when encoding multiple Streams with the same encoding options we avoid reallocating memory.

Read position in buffer[].

Total number of bytes in buffer[].

Delta distance.

Referenced by copy_and_encode(), and encode_in_place().

Position in history[].

uint8_t lzma_coder_s::history[LZMA_DELTA_DIST_MAX]

Buffer to hold history of the original data.

Referenced by copy_and_encode(), and encode_in_place().

Dictionary (history buffer).

The actual LZ-based decoder e.g. LZMA.

True if the next filter in the chain has returned LZMA_STREAM_END.

True when .next.code() has returned LZMA_STREAM_END.

True if the LZ decoder (e.g. LZMA) has detected end of payload marker. This may become true before next_finished becomes true.

True when the Subblock decoder has detected End of Payload Marker. This may become true before next_finished becomes true.

Number of bytes left in the current Subblock Data field.

Number of bytes in buffer[].

Number of bytes in the buffer.

Size of the buffer.

Total number of bytes (both filtered and unfiltered) currently in the temporary buffer.

Referenced by subblock_rle_flush().

struct { ... } lzma_coder_s::temp

Temporary buffer needed when the LZ-based filter is not the last filter in the chain. The output of the next filter is first decoded into buffer[], which is then used as input for the actual LZ-based decoder.

LZ-based encoder e.g. LZMA.

History buffer and match finder.

Referenced by fill_window().

Sequence after the size fields have been decoded.

LZMA decoder.

Uncompressed size of LZMA chunk.

Uncompressed size of a chunk.

Compressed size of the chunk (naturally equals to uncompressed size of uncompressed chunk)

Compressed size of a chunk (excluding headers); this is also used to indicate the end of buf[] in SEQ_LZMA_COPY.

True if properties are needed. This is false before the first LZMA chunk.

True if dictionary reset is needed. This is false before the first chunk (LZMA or uncompressed).

LZMA encoder.

If this is not NULL, we will check new options from this structure when starting a new chunk.

LZMA options currently in use.

Read position in buf[].

uint8_t lzma_coder_s::buf[LZMA2_HEADER_MAX+LZMA2_CHUNK_MAX]

Buffer to hold the chunk header and LZMA compressed data.

Literals; see comments in lzma_common.h.

If 1, it's a match. Otherwise it's a single 8-bit literal.

If 1, it's a repeated match. The distance is one of rep0 .. rep3.

If 0, distance of a repeated match is rep0. Otherwise check is_rep1.

If 0, distance of a repeated match is rep1. Otherwise check is_rep2.

If 0, distance of a repeated match is rep2. Otherwise it is rep3.

If 1, the repeated match has length of one byte. Otherwise the length is decoded from rep_len_decoder.

Probability tree for the highest two bits of the match distance. There is a separate probability tree for match lengths of 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273].

Probility trees for additional bits for match distance when the distance is in the range [4, 127].

Probability tree for the lowest four bits of a match distance that is equal to or greater than 128.

Length of a normal match.

Length of a repeated match.

State.

Distance of the latest match.

Distance of second latest match.

Distance of third latest match.

Distance of fourth latest match.

(1 << pos_bits) - 1

enum { ... } lzma_coder_s::sequence

Position where to continue the decoder loop.

Base of the current probability tree.

Symbol being decoded. This is also used as an index variable in bittree decoders: probs[symbol]

Used as a loop termination condition on bittree decoders and direct bits decoder.

Referenced by subblock_data_size().

Matched literal decoder: 0x100 or 0 to help avoiding branches. Bittree reverse decoders: Offset of the next bit: 1 << offset

If decoding a literal: match byte. If decoding a match: length of the match.

lzma_range_encoder lzma_coder_s::rc

Range encoder.

uint32_t lzma_coder_s::reps[REP_DISTANCES]

The four most recent match distances.

Array of match candidates.

Number of match candidates in matches[].

Varibale to hold the length of the longest match between calls to lzma_lzma_optimum_*().

True if using getoptimumfast.

True if the encoder has been initialized by encoding the first byte as a literal.

True if the range encoder has been flushed, but not all bytes have been written to the output buffer yet.

True if the next coder in the chain has returned LZMA_STREAM_END or if we have processed uncompressed_size bytes.

Referenced by copy_or_code().

True if filter() should encode the data; false to decode. Currently all simple filters use the same function for encoding and decoding, because the difference between encoders and decoders is very small.

Referenced by copy_or_code().

size_t(* lzma_coder_s::filter)(lzma_simple *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size)

Pointer to filter-specific function, which does the actual filtering.

Pointer to filter-specific data, or NULL if filter doesn't need any extra data.

The lowest 32 bits of the current position in the data. Most filters need this to do conversions between absolute and relative addresses.

Size of the memory allocated for the buffer.

buffer[filtered] is the first unfiltered byte. When pos is smaller than filtered, there is unflushed filtered data in the buffer.

Number of consecutive Subblocks with Subblock Type Padding.

True if Subfilters are allowed.

Indicates if at least one byte of decoded output has been produced after enabling Subfilter.

Possible subfilter.

Referenced by subfilter_decode().

Filter Flags decoder is needed to parse the ID and Properties of the subfilter.

The filter_flags_decoder stores its results here.

Options for the Subblock decoder helper. This is used to tell the helper when it should return LZMA_STREAM_END to the subfilter.

How many times buffer should be repeated.

struct { ... } lzma_coder_s::temp

Temporary buffer needed when the Subblock filter is not the last filter in the chain. The output of the next filter is first decoded into buffer[], which is then used as input for the actual Subblock decoder.

Pointer to the options given by the application. This is used for two-way communication with the application.

Holds subblock.size - 1 or rle.size - 1 when encoding size of Data or Repeat Count.

Referenced by subblock_rle_flush().

This is a copy of options->alignment, or LZMA_SUBBLOCK_ALIGNMENT_DEFAULT if options is NULL.

Referenced by subblock_align().

Number of input bytes which we have processed and started writing out. 32-bit integer is enough since we care only about the lowest bits when fixing alignment.

Referenced by subblock_align().

Number of bytes written out.

Referenced by subblock_align().

Pointer to allocated buffer holding the Data field of Subblock Type "Data".

Referenced by subblock_data_size().

Allocated size of the buffer.

Like subblock.in_pending above, but for RLE.

Number of input bytes that we have already read but not yet started writing out. This can be different to `size' when using Subfilter. That's why we track in_pending separately for RLE (see below).

Number of times the first `size' bytes of buffer[] will be repeated.

This is a copy of options->allow_subfilters. We use this to verify that the application doesn't change the value of allow_subfilters.

When this is true, application is not allowed to modify options->subblock_mode. We may still modify it here.

True if we have encoded at least one byte of data with the Subfilter.

Track the amount of input available once LZMA_SUBFILTER_FINISH has been enabled. This is needed for sanity checking (kind of duplicating what common/code.c does).

uint8_t* lzma_coder_s::flags

Buffer for the Filter Flags field written after the `Set Subfilter' indicator.

Size of Filter Flags field.

Pointers to Subfilter.

struct { ... } lzma_coder_s::temp

Temporary buffer used when we are not the last filter in the chain.


The documentation for this struct was generated from the following files:

Generated on Tue Oct 6 14:02:23 2009 for XZ Utils by  doxygen 1.6.1