Rizin
unix-like reverse engineering framework and cli tools
|
LZ in window and match finder API. More...
#include "common.h"
Go to the source code of this file.
Classes | |
struct | lzma_match |
struct | lzma_mf_s |
struct | lzma_lz_options |
struct | lzma_lz_encoder |
Macros | |
#define | mf_find lzma_mf_find |
Since everything else begins with mf_, use it also for lzma_mf_find(). More... | |
Typedefs | |
typedef struct lzma_mf_s | lzma_mf |
LZ in window and match finder API.
Definition in file lz_encoder.h.
#define mf_find lzma_mf_find |
Since everything else begins with mf_, use it also for lzma_mf_find().
Definition at line 259 of file lz_encoder.h.
Definition at line 1 of file lz_encoder.h.
lzma_ret lzma_lz_encoder_init | ( | lzma_next_coder * | next, |
const lzma_allocator * | allocator, | ||
const lzma_filter_info * | filters, | ||
lzma_ret(*)(lzma_lz_encoder *lz, const lzma_allocator *allocator, const void *options, lzma_lz_options *lz_options) | lz_init | ||
) |
Definition at line 525 of file lz_encoder.c.
References allocator, lzma_mf_s::buffer, lzma_next_coder_s::code, lzma_lz_decoder::code, lzma_next_coder_s::coder, lzma_lz_decoder::coder, lzma_next_coder_s::end, lzma_lz_decoder::end, filters, lzma_mf_s::hash, lzma_mf_s::hash_count, lzma_coder::lz, lz_encode(), lz_encoder_end(), lz_encoder_init(), lz_encoder_prepare(), lz_encoder_update(), lzma_alloc(), lzma_crc32_init(), LZMA_MEM_ERROR, LZMA_NEXT_CODER_INIT, lzma_next_filter_init(), LZMA_OPTIONS_ERROR, lzma_coder::mf, lzma_coder::next, NULL, lzma_filter::options, return_if_error, lzma_mf_s::size, lzma_mf_s::son, lzma_mf_s::sons_count, and lzma_next_coder_s::update.
Referenced by lzma_lzma2_encoder_init(), and lzma_lzma_encoder_init().
uint64_t lzma_lz_encoder_memusage | ( | const lzma_lz_options * | lz_options | ) |
Definition at line 464 of file lz_encoder.c.
References lzma_mf_s::buffer, lzma_mf_s::hash_count, lz_encoder_prepare(), NULL, lzma_mf_s::size, lzma_mf_s::sons_count, and UINT64_MAX.
Referenced by lzma_lzma_encoder_memusage().
uint32_t lzma_mf_bt2_find | ( | lzma_mf * | dict, |
lzma_match * | matches | ||
) |
Referenced by lz_encoder_prepare().
Referenced by lz_encoder_prepare().
uint32_t lzma_mf_bt3_find | ( | lzma_mf * | dict, |
lzma_match * | matches | ||
) |
Referenced by lz_encoder_prepare().
Referenced by lz_encoder_prepare().
uint32_t lzma_mf_bt4_find | ( | lzma_mf * | dict, |
lzma_match * | matches | ||
) |
Referenced by lz_encoder_prepare().
Referenced by lz_encoder_prepare().
uint32_t lzma_mf_find | ( | lzma_mf * | mf, |
uint32_t * | count_ptr, | ||
lzma_match * | matches | ||
) |
Find matches starting from the current byte.
Definition at line 23 of file lz_encoder_mf.c.
References assert(), count, lzma_match::dist, lzma_mf_s::find, i, len, lzma_match::len, limit, lzma_mf_s::match_len_max, mf_avail(), mf_ptr(), lzma_mf_s::nice_len, and lzma_mf_s::read_ahead.
uint32_t lzma_mf_hc3_find | ( | lzma_mf * | dict, |
lzma_match * | matches | ||
) |
Referenced by lz_encoder_prepare().
Referenced by lz_encoder_prepare().
uint32_t lzma_mf_hc4_find | ( | lzma_mf * | dict, |
lzma_match * | matches | ||
) |
Referenced by lz_encoder_prepare().
Referenced by lz_encoder_prepare().
Get the number of bytes that haven't been ran through the match finder yet.
Definition at line 229 of file lz_encoder.h.
References lzma_mf_s::read_pos, and lzma_mf_s::write_pos.
Referenced by helper1(), lzma_lzma_optimum_fast(), lzma_lzma_optimum_normal(), and lzma_mf_find().
Calculate the absolute offset from the beginning of the most recent dictionary reset. Only the lowest four bits are important, so there's no problem that we don't know the 64-bit size of the data encoded so far.
NOTE: When moving the input window, we need to do it so that the lowest bits of dict->read_pos are not modified to keep this macro working as intended.
Definition at line 252 of file lz_encoder.h.
References lzma_mf_s::read_ahead, and lzma_mf_s::read_pos.
Referenced by encode_init(), and lzma_lzma_encode().
Get pointer to the first byte not ran through the match finder.
Definition at line 221 of file lz_encoder.h.
References lzma_mf_s::buffer, and lzma_mf_s::read_pos.
Referenced by helper1(), lzma_lzma_optimum_fast(), lzma_lzma_optimum_normal(), and lzma_mf_find().
|
inlinestatic |
Copies at most *left number of bytes from the history buffer to out[]. This is needed by LZMA2 to encode uncompressed chunks.
Definition at line 279 of file lz_encoder.h.
References assert(), lzma_mf_s::buffer, memcpy(), my_min, out, out_pos, lzma_mf_s::read_ahead, and lzma_mf_s::read_pos.
Referenced by lzma2_encode().
Skip the given number of bytes. This is used when a good match was found. For example, if mf_find() finds a match of 200 bytes long, the first byte of that match was already consumed by mf_find(), and the rest 199 bytes have to be skipped with mf_skip(mf, 199).
Definition at line 267 of file lz_encoder.h.
References lzma_mf_s::read_ahead, and lzma_mf_s::skip.
Referenced by encode_init(), helper1(), and lzma_lzma_optimum_fast().
Get the number of bytes that haven't been encoded yet (some of these bytes may have been ran through the match finder though).
Definition at line 238 of file lz_encoder.h.
References lzma_mf_s::read_ahead, lzma_mf_s::read_pos, and lzma_mf_s::write_pos.
Referenced by lzma2_encode().