aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/api
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-11-24 16:25:10 +0200
committerLasse Collin <lasse.collin@tukaani.org>2022-11-24 16:25:10 +0200
commit93439cfafe1768b3b18d67d2356ef7e7559bba59 (patch)
tree7b02d2ea781fa77021c587f7d95c173a88c8d9cd /src/liblzma/api
parentUpdate THANKS. (diff)
downloadxz-93439cfafe1768b3b18d67d2356ef7e7559bba59.tar.xz
liblzma: Add lzma_filters_update() support to the multi-threaded encoder.
A tiny downside of this is that now a 1-4 tiny allocations are made for every Block because each worker thread needs its own copy of the filter chain.
Diffstat (limited to 'src/liblzma/api')
-rw-r--r--src/liblzma/api/lzma/filter.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/liblzma/api/lzma/filter.h b/src/liblzma/api/lzma/filter.h
index 41c5895e..5d0a63c5 100644
--- a/src/liblzma/api/lzma/filter.h
+++ b/src/liblzma/api/lzma/filter.h
@@ -226,21 +226,27 @@ extern LZMA_API(lzma_ret) lzma_raw_decoder(
/**
* \brief Update the filter chain in the encoder
*
- * This function is for advanced users only. This function has two slightly
- * different purposes:
- *
- * - After LZMA_FULL_FLUSH when using Stream encoder: Set a new filter
- * chain, which will be used starting from the next Block.
- *
- * - After LZMA_SYNC_FLUSH using Raw, Block, or Stream encoder: Change
- * the filter-specific options in the middle of encoding. The actual
- * filters in the chain (Filter IDs) cannot be changed. In the future,
- * it might become possible to change the filter options without
- * using LZMA_SYNC_FLUSH.
- *
- * While rarely useful, this function may be called also when no data has
- * been compressed yet. In that case, this function will behave as if
- * LZMA_FULL_FLUSH (Stream encoder) or LZMA_SYNC_FLUSH (Raw or Block
+ * This function may be called after lzma_code() has returned LZMA_STREAM_END
+ * when LZMA_FULL_BARRIER, LZMA_FULL_FLUSH, or LZMA_SYNC_FLUSH was used:
+ *
+ * - After LZMA_FULL_BARRIER or LZMA_FULL_FLUSH: Single-threaded .xz Stream
+ * encoder (lzma_stream_encoder()) and (since liblzma 5.4.0) multi-threaded
+ * Stream encoder (lzma_stream_encoder_mt()) allow setting a new filter
+ * chain to be used for the next Block(s).
+ *
+ * - After LZMA_SYNC_FLUSH: Raw encoder (lzma_raw_encoder()),
+ * Block encocder (lzma_block_encoder()), and single-threaded .xz Stream
+ * encoder (lzma_stream_encoder()) allow changing certain filter-specific
+ * options in the middle of encoding. The actual filters in the chain
+ * (Filter IDs) must not be changed! Currently only the lc, lp, and pb
+ * options of LZMA2 (not LZMA1) can be changed this way.
+ *
+ * - In the future some filters might allow changing some of their options
+ * without any barrier or flushing but currently such filters don't exist.
+ *
+ * This function may also be called when no data has been compressed yet
+ * although this is rarely useful. In that case, this function will behave
+ * as if LZMA_FULL_FLUSH (Stream encoders) or LZMA_SYNC_FLUSH (Raw or Block
* encoder) had been used right before calling this function.
*
* \return - LZMA_OK