Rizin
unix-like reverse engineering framework and cli tools
|
#include <lz_encoder.h>
Public Attributes | |
uint8_t * | buffer |
Pointer to buffer with data to be compressed. More... | |
uint32_t | size |
uint32_t | keep_size_before |
uint32_t | keep_size_after |
uint32_t | offset |
uint32_t | read_pos |
uint32_t | read_ahead |
uint32_t | read_limit |
uint32_t | write_pos |
uint32_t | pending |
uint32_t(* | find )(lzma_mf *mf, lzma_match *matches) |
void(* | skip )(lzma_mf *mf, uint32_t num) |
uint32_t * | hash |
uint32_t * | son |
uint32_t | cyclic_pos |
uint32_t | cyclic_size |
uint32_t | hash_mask |
uint32_t | depth |
Maximum number of loops in the match finder. More... | |
uint32_t | nice_len |
Maximum length of a match that the match finder will try to find. More... | |
uint32_t | match_len_max |
lzma_action | action |
uint32_t | hash_count |
Number of elements in hash[]. More... | |
uint32_t | sons_count |
Number of elements in son[]. More... | |
Definition at line 29 of file lz_encoder.h.
lzma_action lzma_mf_s::action |
When running out of input, binary tree match finders need to know if it is due to flushing or finishing. The action is used also by the LZ-based encoders themselves.
Definition at line 119 of file lz_encoder.h.
Referenced by encode_init(), fill_window(), lz_encode(), and lz_encoder_init().
uint8_t* lzma_mf_s::buffer |
Pointer to buffer with data to be compressed.
Definition at line 35 of file lz_encoder.h.
Referenced by encode_init(), fill_window(), literal(), lz_encoder_end(), lz_encoder_init(), lz_encoder_prepare(), lzma_lz_encoder_init(), lzma_lz_encoder_memusage(), mf_ptr(), mf_read(), and move_window().
uint32_t lzma_mf_s::cyclic_pos |
Definition at line 101 of file lz_encoder.h.
Referenced by lz_encoder_init(), and move_pos().
uint32_t lzma_mf_s::cyclic_size |
Definition at line 102 of file lz_encoder.h.
Referenced by lz_encoder_init(), lz_encoder_prepare(), move_pos(), and normalize().
uint32_t lzma_mf_s::depth |
Maximum number of loops in the match finder.
Definition at line 106 of file lz_encoder.h.
Referenced by lz_encoder_prepare().
uint32_t(* lzma_mf_s::find) (lzma_mf *mf, lzma_match *matches) |
Find matches. Returns the number of distance-length pairs written to the matches array. This is called only via lzma_mf_find().
Definition at line 92 of file lz_encoder.h.
Referenced by lz_encoder_prepare(), and lzma_mf_find().
uint32_t* lzma_mf_s::hash |
Definition at line 99 of file lz_encoder.h.
Referenced by lz_encoder_end(), lz_encoder_init(), lz_encoder_prepare(), lzma_lz_encoder_init(), and normalize().
uint32_t lzma_mf_s::hash_count |
Number of elements in hash[].
Definition at line 122 of file lz_encoder.h.
Referenced by lz_encoder_init(), lz_encoder_prepare(), lzma_lz_encoder_init(), lzma_lz_encoder_memusage(), and normalize().
uint32_t lzma_mf_s::hash_mask |
Definition at line 103 of file lz_encoder.h.
Referenced by lz_encoder_prepare().
uint32_t lzma_mf_s::keep_size_after |
Number of bytes that must be kept in buffer after read_pos. That is, read_pos <= write_pos - keep_size_after as long as action is LZMA_RUN; when action != LZMA_RUN, read_pos is allowed to reach write_pos so that the last bytes get encoded too.
Definition at line 51 of file lz_encoder.h.
Referenced by fill_window(), and lz_encoder_prepare().
uint32_t lzma_mf_s::keep_size_before |
Number of bytes that must be kept available in our input history. That is, once keep_size_before bytes have been processed, buffer[read_pos - keep_size_before] is the oldest byte that must be available for reading.
Definition at line 45 of file lz_encoder.h.
Referenced by lz_encoder_prepare(), and move_window().
uint32_t lzma_mf_s::match_len_max |
Maximum length of a match supported by the LZ-based encoder. If the longest match found by the match finder is nice_len, mf_find() tries to expand it up to match_len_max bytes.
Definition at line 114 of file lz_encoder.h.
Referenced by lz_encoder_prepare(), and lzma_mf_find().
uint32_t lzma_mf_s::nice_len |
Maximum length of a match that the match finder will try to find.
Definition at line 109 of file lz_encoder.h.
Referenced by lz_encoder_prepare(), and lzma_mf_find().
uint32_t lzma_mf_s::offset |
Match finders store locations of matches using 32-bit integers. To avoid adjusting several megabytes of integers every time the input window is moved with move_window, we only adjust the offset of the buffer. Thus, buffer[value_in_hash_table - offset] is the byte pointed by value_in_hash_table.
Definition at line 58 of file lz_encoder.h.
Referenced by lz_encoder_init(), move_pos(), move_window(), and normalize().
uint32_t lzma_mf_s::pending |
Number of bytes not hashed before read_pos. This is needed to restart the match finder after LZMA_SYNC_FLUSH.
Definition at line 84 of file lz_encoder.h.
Referenced by fill_window(), lz_encoder_init(), and move_pending().
uint32_t lzma_mf_s::read_ahead |
Number of bytes that have been ran through the match finder, but which haven't been encoded by the LZ-based encoder yet.
Definition at line 67 of file lz_encoder.h.
Referenced by encode_init(), encode_symbol(), literal(), lz_encoder_init(), lzma_mf_find(), mf_position(), mf_read(), mf_skip(), and mf_unencoded().
uint32_t lzma_mf_s::read_limit |
As long as read_pos is less than read_limit, there is enough input available in buffer for at least one encoding loop.
Because of the stateful API, read_limit may and will get greater than read_pos quite often. This is taken into account when calculating the value for keep_size_after.
Definition at line 75 of file lz_encoder.h.
Referenced by encode_init(), fill_window(), lz_encode(), lz_encoder_init(), and move_window().
uint32_t lzma_mf_s::read_pos |
buffer[read_pos] is the next byte to run through the match finder. This is incremented in the match finder once the byte has been processed.
Definition at line 63 of file lz_encoder.h.
Referenced by encode_init(), fill_window(), literal(), lz_encode(), lz_encoder_init(), mf_avail(), mf_position(), mf_ptr(), mf_read(), mf_unencoded(), move_pending(), move_pos(), move_window(), and normalize().
uint32_t lzma_mf_s::size |
Total size of the allocated buffer (that is, including all the extra space)
Definition at line 39 of file lz_encoder.h.
Referenced by fill_window(), lz_encoder_init(), lz_encoder_prepare(), lzma_lz_encoder_init(), and lzma_lz_encoder_memusage().
Skips num bytes. This is like find() but doesn't make the distance-length pairs available, thus being a little faster. This is called only via mf_skip().
Definition at line 97 of file lz_encoder.h.
Referenced by fill_window(), lz_encoder_init(), lz_encoder_prepare(), and mf_skip().
uint32_t* lzma_mf_s::son |
Definition at line 100 of file lz_encoder.h.
Referenced by lz_encoder_end(), lz_encoder_init(), lz_encoder_prepare(), lzma_lz_encoder_init(), and normalize().
uint32_t lzma_mf_s::sons_count |
Number of elements in son[].
Definition at line 125 of file lz_encoder.h.
Referenced by lz_encoder_init(), lz_encoder_prepare(), lzma_lz_encoder_init(), lzma_lz_encoder_memusage(), and normalize().
uint32_t lzma_mf_s::write_pos |
buffer[write_pos] is the first byte that doesn't contain valid uncompressed data; that is, the next input byte will be copied to buffer[write_pos].
Definition at line 80 of file lz_encoder.h.
Referenced by encode_init(), fill_window(), lz_encoder_init(), mf_avail(), mf_unencoded(), move_pending(), move_pos(), and move_window().