aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/rangecoder (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-02-14liblzma: Silence warnings in --enable-small build.Lasse Collin1-0/+1
2024-02-14liblzma: Silence a warning.Lasse Collin1-1/+1
2024-02-14liblzma: Add comments.Lasse Collin1-2/+9
2024-02-14liblzma: Choose the range decoder variants using a bitmask macro.Lasse Collin1-11/+53
2024-02-14liblzma: Range decoder: Add x86-64 inline assembly.Lasse Collin1-0/+491
It's compatible with GCC and Clang.
2024-02-14liblzma: Range decoder: Add branchless C code.Lasse Collin1-0/+76
It's used only for basic bittrees and fixed-size reverse bittree because those showed a clear benefit on x86-64 with GCC and Clang. The other methods were more mixed and thus are commented out but they should be tested on other archs.
2024-02-14liblzma: LZMA decoder: Optimize loop comparison.Lasse Collin1-1/+9
But now it needs one more local variable.
2024-02-14liblzma: LZMA decoder improvements.Lasse Collin2-14/+132
This adds macros for bittree decoding which prepares the code for alternative C versions and inline assembly.
2024-02-14liblzma: Creates separate "safe" range decoder mode.Jia Tan1-20/+57
The new "safe" range decoder mode is the same as old range decoder, but now the default behavior of the range decoder will not check if there is enough input or output to complete the operation. When the buffers are close to fully consumed, the "safe" operations must be used instead. This will improve speed because it will reduce the number of branches needed for most of the range decoder operations.
2024-02-14liblzma: Include the SPDX license identifier 0BSD to generated files.Lasse Collin2-6/+10
Perhaps the generated files aren't even copyrightable but using the same license for them as for the rest of the liblzma keeps things more consistent for tools that look for license info.
2024-02-14liblzma: Fix compilation of price_tablegen.c.Lasse Collin2-1/+9
It is built and run only manually so this didn't matter unless one wanted to regenerate the price_table.c.
2024-02-14Add SPDX license identifier into 0BSD source code files.Lasse Collin6-2/+11
2024-02-14Change most public domain parts to 0BSD.Lasse Collin6-18/+0
Translations and doc/xz-file-format.txt and doc/lzma-file-format.txt were not touched. COPYING.0BSD was added.
2023-10-30liblzma: Use lzma_attr_visibility_hidden on private extern declarations.Lasse Collin1-0/+1
These variables are internal to liblzma and not exposed in the API.
2023-09-24liblzma: Change quoting style from `...' to '...'.Jia Tan1-1/+1
This was done for both internal and API headers.
2022-02-06liblzma: Fix uint64_t vs. size_t confusion.Lasse Collin1-4/+7
This broke 32-bit builds due to a pointer type mismatch. This bug was introduced with the output-size-limited encoding in 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c. Thanks to huangqinjin for the bug report.
2021-01-14liblzma: Fix missing normalization in rc_encode_dummy().Lasse Collin1-1/+6
Without this fix it could attempt to create too much output.
2021-01-14liblzma: Add rough support for output-size-limited encoding in LZMA1.Lasse Collin1-0/+111
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.
2020-03-02liblzma: Fix a comment and RC_SYMBOLS_MAX.Lasse Collin1-2/+2
The comment didn't match the value of RC_SYMBOLS_MAX and the value itself was slightly larger than actually needed. The only harm about this was that memory usage was a few bytes larger.
2018-02-06liblzma: Remove incorrect #ifdef from range_common.h.Lasse Collin1-3/+1
In most cases it was harmless but it could affect some custom build systems. Thanks to Pippijn van Steenhoven.
2012-06-28liblzma: Check that the first byte of range encoded data is 0x00.Lasse Collin1-3/+9
It is just to be more pedantic and thus perhaps catch broken files slightly earlier.
2009-06-30Build system fixesLasse Collin2-26/+21
Don't use libtool convenience libraries to avoid recently discovered long-standing subtle but somewhat severe bugs in libtool (at least 1.5.22 and 2.2.6 are affected). It was found when porting XZ Utils to Windows <http://lists.gnu.org/archive/html/libtool/2009-06/msg00070.html> but the problem is significant also e.g. on GNU/Linux. Unless --disable-shared is passed to configure, static library built from a set of convenience libraries will contain PIC objects. That is, while libtool builds non-PIC objects too, only PIC objects will be used from the convenience libraries. On 32-bit x86 (tested on mobile XP2400+), using PIC instead of non-PIC makes the decompressor 10 % slower with the default CFLAGS. So while xz was linked against static liblzma by default, it got the slower PIC objects unless --disable-shared was used. I tend develop and benchmark with --disable-shared due to faster build time, so I hadn't noticed the problem in benchmarks earlier. This commit also adds support for building Windows resources into liblzma and executables.
2009-06-26Fix @variables@ to $(variables) in Makefile.am files.Lasse Collin1-2/+2
Fix the ordering of libgnu.a and LTLIBINTL on the linker command line and added missing LTLIBINTL to tests/Makefile.am.
2009-04-13Put the interesting parts of XZ Utils into the public domain.Lasse Collin6-67/+26
Some minor documentation cleanups were made at the same time.
2008-12-31Remove lzma_init() and other init functions from liblzma API.Lasse Collin5-83/+49
Half of developers were already forgetting to use these functions, which could have caused total breakage in some future liblzma version or even now if --enable-small was used. Now liblzma uses pthread_once() to do the initializations unless it has been built with --disable-threads which make these initializations thread-unsafe. When --enable-small isn't used, liblzma currently gets needlessly linked against libpthread (on systems that have it). While it is stupid for now, liblzma will need threads in future anyway, so this stupidity will be temporary only. When --enable-small is used, different code CRC32 and CRC64 is now used than without --enable-small. This made the resulting binary slightly smaller, but the main reason was to clean it up and to handle the lack of lzma_init_check(). The pkg-config file lzma.pc was renamed to liblzma.pc. I'm not sure if it works correctly and portably for static linking (Libs.private includes -pthread or other operating system specific flags). Hopefully someone complains if it is bad. lzma_rc_prices[] is now included as a precomputed array even with --enable-small. It's just 128 bytes now that it uses uint8_t instead of uint32_t. Smaller array seemed to be at least as fast as the more bloated uint32_t array on x86; hopefully it's not bad on other architectures.
2008-09-27Some API changes, bug fixes, cleanups etc.Lasse Collin1-2/+2
2008-08-28Sort of garbage collection commit. :-| Many things are stillLasse Collin8-303/+272
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-178/+205
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-24Switch to uint16_t as the type of range coder probabilities.Lasse Collin1-6/+19
2008-04-24Use 64-bit integer as range encoder's cache size. This fixes aLasse Collin1-1/+1
theoretical data corruption, which should be very hard to trigger even intentionally.
2008-03-24Replaced the range decoder optimization that used arithmeticLasse Collin1-37/+16
right shift with as fast version that doesn't need arithmetic right shift. Removed the related check from configure.ac.
2008-03-22Take advantage of arithmetic right shift in range decoder.Lasse Collin1-15/+37
2008-01-15Omit invalid space from printf() format stringLasse Collin1-1/+1
in price_table_gen.c.
2008-01-15Convert bittree_get_price() and bittree_reverse_get_price()Lasse Collin1-33/+43
from macros to inline functions.
2008-01-15Added precomputed range coder probability price table.Lasse Collin6-15/+150
2008-01-14Major changes to LZ encoder, LZMA encoder, and range encoder.Lasse Collin1-84/+33
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-04Moved range decoder initialization (reading the firstLasse Collin1-27/+60
five input bytes) from LZMA decoder to range decoder header. Did the same for decoding of direct bits.
2007-12-09Imported to git.Lasse Collin5-0/+648