XZ Utils  5.1.0alpha
Data Structures | Macros | Functions
lzma_decoder.c File Reference

LZMA decoder. More...

#include "lz_decoder.h"
#include "lzma_common.h"
#include "lzma_decoder.h"
#include "range_decoder.h"

Data Structures

struct  lzma_length_decoder
 Length decoder probabilities; see comments in lzma_common.h. More...
struct  lzma_coder_s

Macros

#define seq_4(seq)
#define seq_6(seq)
#define seq_8(seq)
#define seq_len(seq)
#define len_decode(target, ld, pos_state, seq)
#define d(seq)

Functions

static lzma_ret lzma_decode (lzma_coder *restrict coder, lzma_dict *restrict dictptr, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size)
static void lzma_decoder_uncompressed (lzma_coder *coder, lzma_vli uncompressed_size)
static void lzma_decoder_reset (lzma_coder *coder, const void *opt)
lzma_ret lzma_lzma_decoder_create (lzma_lz_decoder *lz, lzma_allocator *allocator, const void *opt, lzma_lz_options *lz_options)
static lzma_ret lzma_decoder_init (lzma_lz_decoder *lz, lzma_allocator *allocator, const void *options, lzma_lz_options *lz_options)
lzma_ret lzma_lzma_decoder_init (lzma_next_coder *next, lzma_allocator *allocator, const lzma_filter_info *filters)
 Allocates and initializes LZMA decoder.
bool lzma_lzma_lclppb_decode (lzma_options_lzma *options, uint8_t byte)
 Decodes the LZMA Properties byte (lc/lp/pb)
uint64_t lzma_lzma_decoder_memusage_nocheck (const void *options)
uint64_t lzma_lzma_decoder_memusage (const void *options)
lzma_ret lzma_lzma_props_decode (void **options, lzma_allocator *allocator, const uint8_t *props, size_t props_size)

Detailed Description

LZMA decoder.

Macro Definition Documentation

#define seq_4 (   seq)
Value:
seq ## 0, \
seq ## 1, \
seq ## 2, \
seq ## 3
#define seq_6 (   seq)
Value:
seq ## 0, \
seq ## 1, \
seq ## 2, \
seq ## 3, \
seq ## 4, \
seq ## 5
#define seq_8 (   seq)
Value:
seq ## 0, \
seq ## 1, \
seq ## 2, \
seq ## 3, \
seq ## 4, \
seq ## 5, \
seq ## 6, \
seq ## 7
#define seq_len (   seq)
Value:
seq ## _CHOICE, \
seq ## _LOW0, \
seq ## _LOW1, \
seq ## _LOW2, \
seq ## _CHOICE2, \
seq ## _MID0, \
seq ## _MID1, \
seq ## _MID2, \
seq ## _HIGH0, \
seq ## _HIGH1, \
seq ## _HIGH2, \
seq ## _HIGH3, \
seq ## _HIGH4, \
seq ## _HIGH5, \
seq ## _HIGH6, \
seq ## _HIGH7
#define d (   seq)
Value:
case seq: \
match_bit = len & offset; \
subcoder_index = offset + match_bit + symbol; \
rc_bit(probs[subcoder_index], \
offset &= ~match_bit, \
offset &= match_bit, \
seq)

Function Documentation

static lzma_ret lzma_decoder_init ( lzma_lz_decoder lz,
lzma_allocator allocator,
const void *  options,
lzma_lz_options lz_options 
)
static

Allocate and initialize LZMA decoder. This is used only via LZ initialization (lzma_lzma_decoder_init() passes function pointer to the LZ initialization).

References lzma_lz_decoder::coder, is_lclppb_valid(), LZMA_OK, LZMA_PROG_ERROR, LZMA_VLI_UNKNOWN, and return_if_error.

Referenced by lzma_lzma_decoder_init().

lzma_ret lzma_lzma_decoder_init ( lzma_next_coder next,
lzma_allocator allocator,
const lzma_filter_info filters 
)

Allocates and initializes LZMA decoder.

References lzma_decoder_init().

bool lzma_lzma_lclppb_decode ( lzma_options_lzma options,
uint8_t  byte 
)

Decodes the LZMA Properties byte (lc/lp/pb)

Returns
true if error occurred, false on success

References lzma_options_lzma::lc, lzma_options_lzma::lp, and lzma_options_lzma::pb.