aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lz/lz_decoder.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-02-14liblzma: LZ decoder: Add unlikely().Lasse Collin1-1/+1
2024-02-14liblzma: LZ decoder: Remove a useless unlikely().Lasse Collin1-1/+1
2024-02-14liblzma: Optimize LZ decoder slightly.Lasse Collin1-47/+54
Now extra buffer space is reserved so that repeating bytes for any single match will never need to copy from two places (both the beginning and the end of the buffer). This simplifies dict_repeat() and helps a little with speed. This seems to reduce .lzma decompression time about 2 %, so with .xz and CRC it could be slightly less. The small things add up still.
2024-02-14liblzma: Creates Non-resumable and Resumable modes for lzma_decoder.Jia Tan1-2/+12
The new decoder resumes the first decoder loop in the Resumable mode. Then, the code executes in Non-resumable mode until it detects that it cannot guarantee to have enough input/output to decode another symbol. The Resumable mode is how the decoder has always worked. Before decoding every input bit, it checks if there is enough space and will save its location to be resumed later. When the decoder has more input/output, it jumps back to the correct sequence in the Resumable mode code. When the input/output buffers are large, the Resumable mode is much slower than the Non-resumable because it has more branches and is harder for the compiler to optimize since it is in a large switch block. Early benchmarking shows significant time improvement (8-10% on gcc and clang x86) by using the Non-resumable code as much as possible.
2024-02-14Add SPDX license identifier into 0BSD source code files.Lasse Collin1-0/+2
2024-02-14Change most public domain parts to 0BSD.Lasse Collin1-3/+0
Translations and doc/xz-file-format.txt and doc/lzma-file-format.txt were not touched. COPYING.0BSD was added.
2022-11-28liblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused.Lasse Collin1-3/+0
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-07-13liblzma: Add optional autodetection of LZMA end marker.Lasse Collin1-3/+5
Turns out that this is needed for .lzma files as the spec in LZMA SDK says that end marker may be present even if the size is stored in the header. Such files are rare but exist in the real world. The code in liblzma is so old that the spec didn't exist in LZMA SDK back then and I had understood that such files weren't possible (the lzma tool in LZMA SDK didn't create such files). This modifies the internal API so that LZMA decoder can be told if EOPM is allowed even when the uncompressed size is known. It's allowed with .lzma and not with other uses. Thanks to Karl Beldan for reporting the problem.
2016-11-21liblzma: Avoid multiple definitions of lzma_coder structures.Lasse Collin1-7/+6
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/+4
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.
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-04-10Fix off-by-one in LZ decoder.Lasse Collin1-1/+1
Fortunately, this bug had no security risk other than accepting some corrupt files as valid.
2009-01-27Added initial support for preset dictionary for raw LZMA1Lasse Collin1-1/+8
and LZMA2. It is not supported by the .xz format or the xz command line tool yet.
2008-12-15Fix data corruption in LZMA2 decoder.Lasse Collin1-3/+5
2008-11-19Oh well, big messy commit again. Some highlights:Lasse Collin1-2/+2
- Updated to the latest, probably final file format version. - Command line tool reworked to not use threads anymore. Threading will probably go into liblzma anyway. - Memory usage limit is now about 30 % for uncompression and about 90 % for compression. - Progress indicator with --verbose - Simplified --help and full --long-help - Upgraded to the last LGPLv2.1+ getopt_long from gnulib. - Some bug fixes
2008-08-28Sort of garbage collection commit. :-| Many things are stillLasse Collin1-147/+161
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-18Update the code to mostly match the new simpler file formatLasse Collin1-3/+7
specification. Simplify things by removing most of the support for known uncompressed size in most places. There are some miscellaneous changes here and there too. The API of liblzma has got many changes and still some more will be done soon. While most of the code has been updated, some things are not fixed (the command line tool will choke with invalid filter chain, if nothing else). Subblock filter is somewhat broken for now. It will be updated once the encoded format of the Subblock filter has been decided.
2007-12-09Imported to git.Lasse Collin1-0/+214