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_lzma1_decoder

## 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 (void *coder_ptr, lzma_dict *restrict dictptr, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size)
static void | lzma_decoder_uncompressed (void *coder_ptr, lzma_vli uncompressed_size)
static void | lzma_decoder_reset (void *coder_ptr, const void *opt)
lzma_ret | lzma_lzma_decoder_create (lzma_lz_decoder *lz, const lzma_allocator *allocator, const void *opt, lzma_lz_options *lz_options)
static lzma_ret | lzma_decoder_init (lzma_lz_decoder *lz, const lzma_allocator *allocator, const void *options, lzma_lz_options *lz_options)
lzma_ret | lzma_lzma_decoder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
| Allocates and initializes LZMA decoder. More...
bool | lzma_lzma_lclppb_decode (lzma_options_lzma *options, uint8_t byte)
| Decodes the LZMA Properties byte (lc/lp/pb) More...
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, const lzma_allocator *allocator, const uint8_t *props, size_t props_size)

## Detailed Description

LZMA decoder.

## Macro Definition Documentation

## seq_4

#define seq_4 | ( |  | seq | ) |

Value:
seq ## 0, \
seq ## 1, \
seq ## 2, \
seq ## 3

## seq_6

#define seq_6 | ( |  | seq | ) |

Value:
seq ## 0, \
seq ## 1, \
seq ## 2, \
seq ## 3, \
seq ## 4, \
seq ## 5

## seq_8

#define seq_8 | ( |  | seq | ) |

Value:
seq ## 0, \
seq ## 1, \
seq ## 2, \
seq ## 3, \
seq ## 4, \
seq ## 5, \
seq ## 6, \
seq ## 7

## seq_len

#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

## d

#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

## lzma_decoder_init()

static lzma_ret lzma_decoder_init | ( | lzma_lz_decoder * | lz,
|  | const 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).

## lzma_lzma_decoder_init()

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

Allocates and initializes LZMA decoder.

## lzma_lzma_lclppb_decode()

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.