Rizin
unix-like reverse engineering framework and cli tools
|
Filter ID mapping to filter-specific functions. More...
#include "filter_encoder.h"
#include "filter_common.h"
#include "lzma_encoder.h"
#include "lzma2_encoder.h"
#include "simple_encoder.h"
#include "delta_encoder.h"
Go to the source code of this file.
Classes | |
struct | lzma_filter_encoder |
Functions | |
static const lzma_filter_encoder * | encoder_find (lzma_vli id) |
LZMA_API (lzma_bool) | |
LZMA_API (lzma_ret) | |
lzma_ret | lzma_raw_encoder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *options) |
LZMA_API (uint64_t) | |
Calculate approximate memory usage of easy encoder. More... | |
uint64_t | lzma_mt_block_size (const lzma_filter *filters) |
Variables | |
static const lzma_filter_encoder | encoders [] |
Filter ID mapping to filter-specific functions.
Definition in file filter_encoder.c.
|
static |
Definition at line 154 of file filter_encoder.c.
References ARRAY_SIZE, encoders, i, and NULL.
Referenced by LZMA_API(), lzma_mt_block_size(), and lzma_raw_encoder_init().
LZMA_API | ( | lzma_bool | ) |
Definition at line 164 of file filter_encoder.c.
References encoder_find(), and NULL.
LZMA_API | ( | lzma_ret | ) |
Definition at line 171 of file filter_encoder.c.
References lzma_stream::allocator, lzma_next_coder_s::coder, count, filters, i, lzma_filter::id, lzma_stream::internal, LZMA_FILTERS_MAX, LZMA_OPTIONS_ERROR, LZMA_PROG_ERROR, LZMA_VLI_UNKNOWN, lzma_internal_s::next, NULL, strm, UINT64_MAX, and lzma_next_coder_s::update.
LZMA_API | ( | uint64_t | ) |
Calculate approximate memory usage of easy encoder.
Get the total amount of physical memory (RAM) in bytes.
Calculate approximate memory usage of multithreaded .xz encoder.
Calculate approximate decoder memory usage of a preset.
This function is a wrapper for lzma_raw_encoder_memusage().
preset | Compression preset (level and possible flags) |
This function is a wrapper for lzma_raw_decoder_memusage().
preset | Compression preset (level and possible flags) |
Since doing the encoding in threaded mode doesn't affect the memory requirements of single-threaded decompressor, you can use lzma_easy_decoder_memusage(options->preset) or lzma_raw_decoder_memusage(options->filters) to calculate the decompressor memory requirements.
options | Compression options |
Calculate approximate memory usage of easy encoder.
Get the uncompressed size of the file.
Get the total size of the file.
Get the total size of the Blocks.
Get the total size of the Stream.
Get the size of the Index field as bytes.
Get the number of Blocks.
Get the number of Streams.
Calculate the memory usage of an existing lzma_index.
On disk, the size of the Index field depends on both the number of Records stored and how big values the Records store (due to variable-length integer encoding). When the Index is kept in lzma_index structure, the memory usage depends only on the number of Records/Blocks stored in the Index(es), and in case of concatenated lzma_indexes, the number of Streams. The size in RAM is almost always significantly bigger than in the encoded form on disk.
This function calculates an approximate amount of memory needed hold the given number of Streams and Blocks in lzma_index structure. This value may vary between CPU architectures and also between liblzma versions if the internal implementation is modified.
This is a shorthand for lzma_index_memusage(lzma_index_stream_count(i), lzma_index_block_count(i)).
This returns the total number of Blocks in lzma_index. To get number of Blocks in individual Streams, use lzma_index_iter.
This is needed to verify the Backward Size field in the Stream Footer.
If multiple lzma_indexes have been combined, this works as if the Blocks were in a single Stream. This is useful if you are going to combine Blocks from multiple Streams into a single new Stream.
This doesn't include the Stream Header, Stream Footer, Stream Padding, or Index fields.
When no lzma_indexes have been combined with lzma_index_cat() and there is no Stream Padding, this function is identical to lzma_index_stream_size(). If multiple lzma_indexes have been combined, this includes also the headers of each separate Stream and the possible Stream Padding fields.
Definition at line 221 of file filter_encoder.c.
References encoder_find(), filters, and lzma_raw_coder_memusage().
uint64_t lzma_mt_block_size | ( | const lzma_filter * | filters | ) |
Definition at line 230 of file filter_encoder.c.
References lzma_filter_encoder::block_size, encoder_find(), filters, i, lzma_filter::id, LZMA_VLI_UNKNOWN, max, NULL, and options.
Referenced by get_options().
lzma_ret lzma_raw_encoder_init | ( | lzma_next_coder * | next, |
const lzma_allocator * | allocator, | ||
const lzma_filter * | options | ||
) |
Definition at line 199 of file filter_encoder.c.
References allocator, encoder_find(), lzma_raw_coder_init(), and options.
Referenced by block_encode_normal(), LZMA_API(), and lzma_block_encoder_init().
|
static |
Definition at line 56 of file filter_encoder.c.
Referenced by encoder_find().