aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma2_encoder.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-05-11liblzma: Exports lzma_mt_block_size() as an API function.Jia Tan1-0/+3
The lzma_mt_block_size() was previously just an internal function for the multithreaded .xz encoder. It is used to provide a recommended Block size for a given filter chain. This function is helpful to determine the maximum Block size for the multithreaded .xz encoder when one wants to change the filters between blocks. Then, this determined Block size can be provided to lzma_stream_encoder_mt() in the lzma_mt options parameter when intializing the coder. This requires one to know all the filter chains they are using before starting to encode (or at least the filter chain that will need the largest Block size), but that isn't a bad limitation.
2022-11-27liblzma: Add LZMA_FILTER_LZMA1EXT to support LZMA1 without end marker.Lasse Collin1-1/+1
Some file formats need support for LZMA1 streams that don't use the end of payload marker (EOPM) alias end of stream (EOS) marker. So far liblzma API has supported decompressing such streams via lzma_alone_decoder() when .lzma header specifies a known uncompressed size. Encoding support hasn't been available in the API. Instead of adding a new LZMA1-only API for this purpose, this commit adds a new filter ID for use with raw encoder and decoder. The main benefit of this approach is that then also filter chains are possible, for example, if someone wants to implement support for .7z files that use the x86 BCJ filter with LZMA1 (not BCJ2 as that isn't supported in liblzma).
2022-11-27liblzma: Pass the Filter ID to LZ encoder and decoder.Lasse Collin1-1/+2
This allows using two Filter IDs with the same initialization function and data structures.
2022-02-07liblzma: Add NULL checks to LZMA and LZMA2 properties encoders.jiat751-0/+3
Previously lzma_lzma_props_encode() and lzma_lzma2_props_encode() assumed that the options pointers must be non-NULL because the with these filters the API says it must never be NULL. It is good to do these checks anyway.
2016-11-21liblzma: Avoid multiple definitions of lzma_coder structures.Lasse Collin1-22/+29
Only one definition was visible in a translation unit. It avoided a few casts and temp variables but seems that this hack doesn't work with link-time optimizations in compilers as it's not C99/C11 compliant. Fixes: http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html
2012-07-17liblzma: Make the use of lzma_allocator const-correct.Lasse Collin1-3/+3
There is a tiny risk of causing breakage: If an application assigns lzma_stream.allocator to a non-const pointer, such code won't compile anymore. I don't know why anyone would do such a thing though, so in practice this shouldn't cause trouble. Thanks to Jan Kratochvil for the patch.
2011-04-12Remove doubled words from documentation and comments.Lasse Collin1-1/+1
Spot candidates by running these commands: git ls-files |xargs perl -0777 -n \ -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \ -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}' Thanks to Jim Meyering for the original patch.
2011-04-11liblzma: Add the forgotten lzma_lzma2_block_size().Lasse Collin1-0/+10
This should have been in 5eefc0086d24a65e136352f8c1d19cefb0cbac7a.
2010-10-26liblzma: Rename a few variables and constants.Lasse Collin1-1/+1
This has no semantic changes. I find the new names slightly more logical and they match the names that are already used in XZ Embedded. The name fastpos wasn't changed (not worth the hassle).
2010-05-26Rename MIN() and MAX() to my_min() and my_max().Lasse Collin1-1/+1
This should avoid some minor portability issues.
2010-02-12Collection of language fixes to comments and docs.Lasse Collin1-1/+1
Thanks to Jonathan Nieder.
2009-11-15Fix wrong indentation caused by incorrect settingsLasse Collin1-3/+3
in the text editor.
2009-11-14Fix a design error in liblzma API.Lasse Collin1-25/+34
Originally the idea was that using LZMA_FULL_FLUSH with Stream encoder would read the filter chain from the same array that was used to intialize the Stream encoder. Since most apps wouldn't use LZMA_FULL_FLUSH, most apps wouldn't need to keep the filter chain available after initializing the Stream encoder. However, due to my mistake, it actually required keeping the array always available. Since setting the new filter chain via the array used at initialization time is not a nice way to do it for a couple of reasons, this commit ditches it and introduces lzma_filters_update(). This new function replaces also the "persistent" flag used by LZMA2 (and to-be-designed Subblock filter), which was also an ugly thing to do. Thanks to Alexey Tourbin for reminding me about the problem that Stream encoder used to require keeping the filter chain allocated.
2009-04-13Put the interesting parts of XZ Utils into the public domain.Lasse Collin1-12/+5
Some minor documentation cleanups were made at the same time.
2009-01-27Added initial support for preset dictionary for raw LZMA1Lasse Collin1-5/+7
and LZMA2. It is not supported by the .xz format or the xz command line tool yet.
2009-01-19Move some LZMA2 constants to lzma2_encoder.h so that theyLasse Collin1-13/+0
can be used outside lzma2_encoder.c.
2008-12-15Bunch of liblzma API cleanups and fixes.Lasse Collin1-3/+3
2008-12-09Make the memusage functions of LZMA1 and LZMA2 encodersLasse Collin1-1/+4
to validate the filter options. Add missing validation to LZMA2 encoder when options are changed in the middle of encoding.
2008-09-27Some API changes, bug fixes, cleanups etc.Lasse Collin1-17/+10
2008-08-28Sort of garbage collection commit. :-| Many things are stillLasse Collin1-0/+406
broken. API has changed a lot and it will still change a little more here and there. The command line tool doesn't have all the required changes to reflect the API changes, so it's easy to get "internal error" or trigger assertions.