XZ Utils  5.1.0alpha
Public Types | Data Fields
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_DIST_SLOT),
  SEQ_DIST_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...

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
enum lzma_coder_s:: { ... }  sequence
lzma_indexindex
 Target Index.
lzma_index ** index_ptr
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
const lzma_indexindex
 Index being encoded.
lzma_index_iter iter
 Iterator for the Index 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
bool block_encoder_is_initialized
lzma_next_coder block_encoder
 Block.
lzma_filter filters [LZMA_FILTERS_MAX+1]
 The filter chain currently in use.
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.
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 dist_slot [DIST_STATES][DIST_SLOTS]
probability pos_special [FULL_DISTANCES-DIST_MODEL_END]
probability pos_align [ALIGN_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 [REPS]
 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
probability dist_special [FULL_DISTANCES-DIST_MODEL_END]
probability dist_align [ALIGN_SIZE]
lzma_length_encoder match_len_encoder
lzma_length_encoder rep_len_encoder
uint32_t dist_slot_prices [DIST_STATES][DIST_SLOTS]
uint32_t dist_prices [DIST_STATES][FULL_DISTANCES]
uint32_t dist_table_size
uint32_t match_price_count
uint32_t align_prices [ALIGN_SIZE]
uint32_t align_price_count
uint32_t opts_end_index
uint32_t opts_current_index
lzma_optimal opts [OPTS]
bool end_was_reached
 True if the next coder in the chain has returned LZMA_STREAM_END.
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

Member Enumeration Documentation

anonymous enum

Position where to continue the decoder loop.


Field Documentation

lzma_next_coder lzma_coder_s::next

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().

size_t lzma_coder_s::pos

Position in the header fields.

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().

lzma_vli lzma_coder_s::uncompressed_size

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.

uint64_t lzma_coder_s::memlimit

Memory usage limit.

uint64_t lzma_coder_s::memusage

Amount of memory actually needed (only an estimate)

lzma_options_lzma lzma_coder_s::options

Options decoded from the header needed to initialize the LZMA decoder

lzma_block * lzma_coder_s::block

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.

size_t lzma_coder_s::compressed_size

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.

lzma_vli lzma_coder_s::compressed_limit

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

size_t lzma_coder_s::check_pos

Position when reading the Check field.

lzma_check_state lzma_coder_s::check

Check of the uncompressed data.

lzma_index * lzma_coder_s::index

Target Index.

Index to hold sizes of the Blocks.

Referenced by lzma_index_buffer_decode().

lzma_index** lzma_coder_s::index_ptr

Pointer give by the application, which is set after successful decoding.

lzma_vli lzma_coder_s::count

Number of Records left to decode.

Referenced by lzma_index_buffer_decode().

lzma_vli lzma_coder_s::unpadded_size

The most recent Unpadded Size field.

uint32_t lzma_coder_s::crc32

CRC32 of the List of Records field.

const lzma_index* lzma_coder_s::index

Index being encoded.

lzma_index_iter lzma_coder_s::iter

Iterator for the Index being encoded.

lzma_next_coder lzma_coder_s::block_decoder

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.

lzma_block lzma_coder_s::block_options

Options for the Block encoder.

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

lzma_stream_flags lzma_coder_s::stream_flags

Stream Flags from Stream Header.

lzma_index_hash* lzma_coder_s::index_hash

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

bool lzma_coder_s::tell_no_check

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

bool lzma_coder_s::tell_unsupported_check

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

bool lzma_coder_s::tell_any_check

If true, LZMA_GET_CHECK is returned after decoding Stream Header.

bool lzma_coder_s::concatenated

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.

bool lzma_coder_s::first_stream

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.

uint8_t lzma_coder_s::buffer

Temporary buffer.

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

bool lzma_coder_s::block_encoder_is_initialized

True if Block encoder has been initialized by stream_encoder_init() or stream_encoder_update() and thus doesn't need to be initialized in stream_encode().

lzma_next_coder lzma_coder_s::block_encoder

Block.

lzma_filter lzma_coder_s::filters[LZMA_FILTERS_MAX+1]

The filter chain currently in use.

lzma_next_coder lzma_coder_s::index_encoder

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.

size_t lzma_coder_s::buffer_pos

Read position in buffer[].

size_t lzma_coder_s::buffer_size

Total number of bytes in buffer[].

size_t lzma_coder_s::distance

Delta distance.

Referenced by copy_and_encode(), and encode_in_place().

uint8_t lzma_coder_s::pos

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().

lzma_dict lzma_coder_s::dict

Dictionary (history buffer)

lzma_lz_decoder lzma_coder_s::lz

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

bool lzma_coder_s::next_finished

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

bool lzma_coder_s::this_finished

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

size_t lzma_coder_s::size

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

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.

lzma_lz_encoder lzma_coder_s::lz

LZ-based encoder e.g. LZMA.

lzma_mf lzma_coder_s::mf

History buffer and match finder.

Referenced by fill_window().

enum sequence lzma_coder_s::next_sequence

Sequence after the size fields have been decoded.

lzma_lz_decoder lzma_coder_s::lzma

LZMA decoder.

size_t lzma_coder_s::uncompressed_size

Uncompressed size of LZMA chunk.

Uncompressed size of a chunk.

size_t lzma_coder_s::compressed_size

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.

bool lzma_coder_s::need_properties

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

bool lzma_coder_s::need_dictionary_reset

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

lzma_coder* lzma_coder_s::lzma

LZMA encoder.

lzma_options_lzma lzma_coder_s::opt_cur

LZMA options currently in use.

size_t lzma_coder_s::buf_pos

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.

probability lzma_coder_s::literal

Literals; see comments in lzma_common.h.

probability lzma_coder_s::is_match

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

probability lzma_coder_s::is_rep

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

probability lzma_coder_s::is_rep0

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

probability lzma_coder_s::is_rep1

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

probability lzma_coder_s::is_rep2

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

probability lzma_coder_s::is_rep0_long

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

probability lzma_coder_s::dist_slot

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].

probability lzma_coder_s::pos_special[FULL_DISTANCES-DIST_MODEL_END]

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

probability lzma_coder_s::pos_align[ALIGN_SIZE]

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

lzma_length_decoder lzma_coder_s::match_len_decoder

Length of a normal match.

lzma_length_decoder lzma_coder_s::rep_len_decoder

Length of a repeated match.

lzma_lzma_state lzma_coder_s::state

State.

uint32_t lzma_coder_s::rep0

Distance of the latest match.

uint32_t lzma_coder_s::rep1

Distance of second latest match.

uint32_t lzma_coder_s::rep2

Distance of third latest match.

uint32_t lzma_coder_s::rep3

Distance of fourth latest match.

uint32_t lzma_coder_s::pos_mask

(1 << pos_bits) - 1

enum { ... } lzma_coder_s::sequence

Position where to continue the decoder loop.

probability* lzma_coder_s::probs

Base of the current probability tree.

uint32_t lzma_coder_s::symbol

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

uint32_t lzma_coder_s::limit

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

uint32_t lzma_coder_s::offset

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

uint32_t lzma_coder_s::len

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[REPS]

The four most recent match distances.

lzma_match lzma_coder_s::matches[MATCH_LEN_MAX+1]

Array of match candidates.

uint32_t lzma_coder_s::matches_count

Number of match candidates in matches[].

uint32_t lzma_coder_s::longest_match_length

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

bool lzma_coder_s::fast_mode

True if using getoptimumfast.

bool lzma_coder_s::is_initialized

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

bool lzma_coder_s::is_flushed

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

bool lzma_coder_s::end_was_reached

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

Referenced by copy_or_code().

bool lzma_coder_s::is_encoder

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.

lzma_simple* lzma_coder_s::simple

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

uint32_t lzma_coder_s::now_pos

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

size_t lzma_coder_s::allocated

Size of the memory allocated for the buffer.

size_t lzma_coder_s::filtered

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


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