|
static void | worker_error (worker_thread *thr, lzma_ret ret) |
| Tell the main thread that something has gone wrong. More...
|
|
static worker_state | worker_encode (worker_thread *thr, worker_state state) |
|
static MYTHREAD_RET_TYPE | worker_start (void *thr_ptr) |
|
static void | threads_stop (lzma_stream_coder *coder, bool wait_for_threads) |
| Make the threads stop but not exit. Optionally wait for them to stop. More...
|
|
static void | threads_end (lzma_stream_coder *coder, const lzma_allocator *allocator) |
|
static lzma_ret | initialize_new_thread (lzma_stream_coder *coder, const lzma_allocator *allocator) |
| Initialize a new worker_thread structure and create a new thread. More...
|
|
static lzma_ret | get_thread (lzma_stream_coder *coder, const lzma_allocator *allocator) |
|
static lzma_ret | stream_encode_in (lzma_stream_coder *coder, const lzma_allocator *allocator, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, lzma_action action) |
|
static bool | wait_for_work (lzma_stream_coder *coder, mythread_condtime *wait_abs, bool *has_blocked, bool has_input) |
|
static lzma_ret | stream_encode_mt (void *coder_ptr, const lzma_allocator *allocator, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size, lzma_action action) |
|
static void | stream_encoder_mt_end (void *coder_ptr, const lzma_allocator *allocator) |
|
static lzma_ret | get_options (const lzma_mt *options, lzma_options_easy *opt_easy, const lzma_filter **filters, uint64_t *block_size, uint64_t *outbuf_size_max) |
|
static void | get_progress (void *coder_ptr, uint64_t *progress_in, uint64_t *progress_out) |
|
static lzma_ret | stream_encoder_mt_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_mt *options) |
|
lzma_ret | lzma_stream_encoder_mt (lzma_stream *strm, const lzma_mt *options) |
| Initialize multithreaded .xz Stream encoder. More...
|
|
uint64_t | lzma_stream_encoder_mt_memusage (const lzma_mt *options) |
| Calculate approximate memory usage of multithreaded .xz encoder. More...
|
|
Multithreaded .xz Stream encoder.
Initialize multithreaded .xz Stream encoder.
This provides the functionality of lzma_easy_encoder() and lzma_stream_encoder() as a single function for multithreaded use.
The supported actions for lzma_code() are LZMA_RUN, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER, and LZMA_FINISH. Support for LZMA_SYNC_FLUSH might be added in the future.
- Parameters
-
strm | Pointer to properly prepared lzma_stream |
options | Pointer to multithreaded compression options |
- Returns
- - LZMA_OK
- LZMA_MEM_ERROR
- LZMA_UNSUPPORTED_CHECK
- LZMA_OPTIONS_ERROR
- LZMA_PROG_ERROR
References lzma_next_strm_init.
uint64_t lzma_stream_encoder_mt_memusage |
( |
const lzma_mt * |
options | ) |
|
Calculate approximate memory usage of multithreaded .xz encoder.
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.
- Parameters
-
options | Compression options |
- Returns
- Number of bytes of memory required for encoding with the given options. If an error occurs, for example due to unsupported preset or filter chain, UINT64_MAX is returned.
References filters, get_options(), and LZMA_OK.