aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lz/lz_encoder.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-24liblzma: Change quoting style from `...' to '...'.Jia Tan1-1/+1
This was done for both internal and API headers.
2023-07-31Docs: Fix typos found by codespellDimitri Papadopoulos Orfanos1-1/+1
2023-05-11liblzma: Creates IS_ENC_DICT_SIZE_VALID() macro.Jia Tan1-0/+8
This creates an internal liblzma macro to test if the dictionary size is valid for encoding.
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-11-24liblzma: Allow nice_len 2 and 3 even if match finder requires 3 or 4.Lasse Collin1-0/+9
That is, if the specified nice_len is smaller than the minimum of the match finder, silently use the match finder's minimum value instead of reporting an error. The old behavior is annoying to users and it complicates xz options handling too.
2021-01-14liblzma: Add rough support for output-size-limited encoding in LZMA1.Lasse Collin1-0/+4
With this it is possible to encode LZMA1 data without EOPM so that the encoder will encode as much input as it can without exceeding the specified output size limit. The resulting LZMA1 stream will be a normal LZMA1 stream without EOPM. The actual uncompressed size will be available to the caller via the uncomp_size pointer. One missing thing is that the LZMA layer doesn't inform the LZ layer when the encoding is finished and thus the LZ may read more input when it won't be used. However, this doesn't matter if encoding is done with a single call (which is the planned use case for now). For proper multi-call encoding this should be improved. This commit only adds the functionality for internal use. Nothing uses it yet.
2016-11-21liblzma: Avoid multiple definitions of lzma_coder structures.Lasse Collin1-5/+4
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
2014-05-25liblzma: Use lzma_alloc_zero() in LZ encoder initialization.Lasse Collin1-1/+1
This avoids a memzero() call for a newly-allocated memory, which can be expensive when encoding small streams with an over-sized dictionary. To avoid using lzma_alloc_zero() for memory that doesn't need to be zeroed, lzma_mf.son is now allocated separately, which requires handling it separately in normalize() too. Thanks to Vincenzo Innocente for reporting the problem.
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.
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-14Fix a design error in liblzma API.Lasse Collin1-0/+4
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-09-12A few grammar fixes.Lasse Collin1-5/+5
Thanks to Christian Weisgerber for pointing out some of these.
2009-08-16Fix data corruption in LZ/LZMA2 encoder.Lasse Collin1-1/+1
Thanks to Jonathan Stott for the bug report.
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.
2008-09-27Some API changes, bug fixes, cleanups etc.Lasse Collin1-13/+13
2008-09-06CommentsLasse Collin1-6/+6
2008-09-02Some fixes to LZ encoder.Lasse Collin1-8/+10
2008-08-28Sort of garbage collection commit. :-| Many things are stillLasse Collin1-80/+254
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.
2008-06-01Fix a buffer overflow in the LZMA encoder. It was due to myLasse Collin1-16/+2
misunderstanding of the code. There's no tiny fix for this problem, so I also cleaned up the code in general. This reduces the speed of the encoder 2-5 % in the fastest compression mode ("lzma -1"). High compression modes should have no noticeable performance difference. This commit breaks things (especially LZMA_SYNC_FLUSH) but I will fix them once the new format and LZMA2 has been roughly implemented. Plain LZMA won't support LZMA_SYNC_FLUSH at all and won't be supported in the new .lzma format. This may change still but this is what it looks like now. Support for known uncompressed size (that is, LZMA or LZMA2 without EOPM) is likely to go away. This means there will be API changes.
2008-04-24Fix wrong return type (uint32_t -> bool).Lasse Collin1-1/+1
2008-04-24Fix data corruption in LZ encoder with LZMA_SYNC_FLUSH.Lasse Collin1-0/+4
2008-01-18Fix LZMA_SYNC_FLUSH handling in LZ and LZMA encoders.Lasse Collin1-0/+1
That code is now almost completely in LZ coder, where it can be shared with other LZ77-based algorithms in future.
2008-01-14Major changes to LZ encoder, LZMA encoder, and range encoder.Lasse Collin1-5/+12
These changes implement support for LZMA_SYNC_FLUSH in LZMA encoder, and move the temporary buffer needed by range encoder from lzma_range_encoder structure to lzma_lz_encoder.
2008-01-10Eliminate lzma_lz_encoder.must_move_pos. It's neededLasse Collin1-4/+0
only in one place which isn't performance criticial.
2007-12-09Imported to git.Lasse Collin1-0/+161