Rizin
unix-like reverse engineering framework and cli tools
|
LZ in window. More...
Go to the source code of this file.
Classes | |
struct | lzma_coder |
LZ in window.
Definition in file lz_encoder.c.
|
static |
Tries to fill the input window (mf->buffer)
If we are the last encoder in the chain, our input data is in in[]. Otherwise we call the next filter in the chain to process in[] and write its output to mf->buffer.
This function must not be called once it has returned LZMA_STREAM_END.
Definition at line 81 of file lz_encoder.c.
References test-lz4-speed::action, lzma_mf_s::action, allocator, assert(), lzma_mf_s::buffer, lzma_next_coder_s::code, lzma_next_coder_s::coder, in, in_pos, in_size, lzma_mf_s::keep_size_after, lzma_bufcpy(), LZMA_MEMCMPLEN_EXTRA, LZMA_OK, LZMA_RUN, LZMA_STREAM_END, memzero, lzma_coder::mf, move_window(), lzma_coder::next, NULL, lzma_mf_s::pending, lzma_mf_s::read_limit, lzma_mf_s::read_pos, lzma_mf_s::size, lzma_mf_s::skip, and lzma_mf_s::write_pos.
Referenced by lz_encode().
|
static |
Definition at line 160 of file lz_encoder.c.
References test-lz4-speed::action, lzma_mf_s::action, allocator, lzma_lz_decoder::code, lzma_lz_decoder::coder, fill_window(), in, in_pos, in_size, lzma_coder::lz, LZMA_OK, LZMA_RUN, lzma_coder::mf, out, out_pos, lzma_mf_s::read_limit, lzma_mf_s::read_pos, and return_if_error.
Referenced by lzma_lz_encoder_init().
|
static |
Definition at line 486 of file lz_encoder.c.
References allocator, lzma_mf_s::buffer, lzma_lz_decoder::coder, lzma_lz_decoder::end, lzma_mf_s::hash, lzma_coder::lz, lzma_free(), lzma_next_end(), lzma_coder::mf, lzma_coder::next, NULL, and lzma_mf_s::son.
Referenced by lzma_lz_encoder_init().
|
static |
Definition at line 371 of file lz_encoder.c.
References lzma_mf_s::action, allocator, lzma_mf_s::buffer, lzma_mf_s::cyclic_pos, lzma_mf_s::cyclic_size, lzma_mf_s::hash, lzma_mf_s::hash_count, lzma_alloc(), lzma_free(), LZMA_MEMCMPLEN_EXTRA, LZMA_RUN, LZMA_SYNC_FLUSH, memcpy(), memzero, my_min, NULL, lzma_mf_s::offset, lzma_mf_s::pending, lzma_lz_options::preset_dict, lzma_lz_options::preset_dict_size, lzma_mf_s::read_ahead, lzma_mf_s::read_limit, lzma_mf_s::read_pos, lzma_mf_s::size, SIZE_MAX, lzma_mf_s::skip, lzma_mf_s::son, lzma_mf_s::sons_count, and lzma_mf_s::write_pos.
Referenced by lzma_lz_encoder_init().
|
static |
Definition at line 193 of file lz_encoder.c.
References lzma_lz_options::after_size, allocator, lzma_lz_options::before_size, lzma_mf_s::buffer, lzma_mf_s::cyclic_size, lzma_mf_s::depth, lzma_lz_options::depth, lzma_lz_options::dict_size, lzma_mf_s::find, lzma_mf_s::hash, HASH_2_SIZE, HASH_3_SIZE, lzma_mf_s::hash_count, lzma_mf_s::hash_mask, hs, lzma_mf_s::keep_size_after, lzma_mf_s::keep_size_before, LZMA_DICT_SIZE_MIN, lzma_free(), LZMA_MF_BT2, lzma_mf_bt2_find(), lzma_mf_bt2_skip(), LZMA_MF_BT3, lzma_mf_bt3_find(), lzma_mf_bt3_skip(), LZMA_MF_BT4, lzma_mf_bt4_find(), lzma_mf_bt4_skip(), LZMA_MF_HC3, lzma_mf_hc3_find(), lzma_mf_hc3_skip(), LZMA_MF_HC4, lzma_mf_hc4_find(), lzma_mf_hc4_skip(), lzma_lz_options::match_finder, lzma_mf_s::match_len_max, lzma_lz_options::match_len_max, lzma_mf_s::nice_len, lzma_lz_options::nice_len, NULL, lzma_mf_s::size, lzma_mf_s::skip, lzma_mf_s::son, lzma_mf_s::sons_count, and UINT32_C.
Referenced by lzma_lz_encoder_init(), and lzma_lz_encoder_memusage().
|
static |
Definition at line 507 of file lz_encoder.c.
References allocator, lzma_lz_decoder::coder, lzma_coder::lz, lzma_next_filter_update(), LZMA_PROG_ERROR, lzma_coder::next, NULL, and return_if_error.
Referenced by lzma_lz_encoder_init().
LZMA_API | ( | lzma_bool | ) |
Definition at line 585 of file lz_encoder.c.
References LZMA_MF_BT2, LZMA_MF_BT3, LZMA_MF_BT4, LZMA_MF_HC3, and LZMA_MF_HC4.
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().
|
static |
Moves the data in the input window to free space for new data.
mf->buffer is a sliding input window, which keeps mf->keep_size_before bytes of input history available all the time. Now and then we need to "slide" the buffer to make space for the new data to the end of the buffer. At the same time, data older than keep_size_before is dropped.
Definition at line 46 of file lz_encoder.c.
References assert(), lzma_mf_s::buffer, lzma_mf_s::keep_size_before, lzma_mf_s::offset, lzma_mf_s::read_limit, lzma_mf_s::read_pos, UINT32_C, and lzma_mf_s::write_pos.
Referenced by fill_window().