summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* updated LZ4F_compressBound() documentationYann Collet2018-02-281-3/+6
| | | | to clarify it includes potentially buffered data.
* Merge pull request #478 from lz4/mergeOptYann Collet2018-02-263-361/+328
|\ | | | | merge lz4opt.h into lz4hc.c
| * merge lz4opt.h into lz4hc.cYann Collet2018-02-253-361/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Having a dedicated file for optimal parser made sense during its creation, it allowed Przemyslaw to work more freely on lz4opt, with less dependency on lz4hc, moreover, the optimal parser was more complex, with its own search functions. Since the optimal was rewritten last year, it's now a lot lighter. It makes more sense now to integrate it directly inside lz4hc.c, making it easier to edit (editors are a bit "lost" inside a `*.h` dependent on its #include position), it also reduces the number of files in the project, which fits pretty well with lz4 objectives. (adding lz4hc requires "just" lz4hc.h and lz4hc.c).
* | bumped version number to v1.8.2Yann Collet2018-02-261-1/+1
| | | | | | | | updated NEWS was current progresses
* | update code comment on LZ4 streaming interfaceYann Collet2018-02-261-11/+12
|/ | | | | notably regarding LZ4_saveDict() speed advantage, answering #477.
* edge case : compress up to end-mflimit (12 bytes)Yann Collet2018-02-243-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LZ4 block format specification states that the last match must start at a minimum distance of 12 bytes from the end of the block. However, out of an abundance of caution, the reference implementation would actually stop searching matches at 13 bytes from the end of the block. This patch fixes this small detail. The new version is now able to properly compress a limit case such as `aaaaaaaabaaa\n` as reported by Gao Xiang (@hsiangkao). Obviously, it doesn't change a lot of things. This is just one additional match candidate per block, with a maximum match length of 7 (since last 5 bytes must remain literals). With default policy, blocks are 4 MB long, so it doesn't happen too often Compressing silesia.tar at default level 1 saves 5 bytes (100930101 -> 100930096). At max level 12, it saves a grand 16 bytes (77389871 -> 77389855). The impact is a bit more visible when blocks are smaller, hence more numerous. For example, compressing silesia with blocks of 64 KB (using -12 -B4D) saves 543 bytes (77304583 -> 77304040). So the smaller the packet size, the more visible the impact. And it happens we have a ton of scenarios with little blocks using LZ4 compression ... And a useless "hooray" sidenote : the patch improves the LZ4 compression record of silesia (using -12 -B7D --no-frame-crc) by 16 bytes (77270672 -> 77270656) and the record on enwik9 by 44 bytes (371680396 -> 371680352) (previously claimed by [smallz4](http://create.stephan-brumme.com/smallz4/) ).
* Merge pull request #471 from lz4/fasterHCYann Collet2018-02-211-25/+18
|\ | | | | Faster HC
| * added one assert()Yann Collet2018-02-201-3/+7
| | | | | | | | suggested by @terrelln
| * slight hc speed benefit (~+1%)Yann Collet2018-02-121-21/+10
| | | | | | | | by optimizing countback
| * slightly improved hc compression speed (+~1-2%)Yann Collet2018-02-111-1/+1
| | | | | | | | by removing bad candidates faster.
* | update API doc regarding double-buffer strategyYann Collet2018-02-181-1/+3
| | | | | | | | answering question #473
* | removed LZ4_copy8Yann Collet2018-02-121-11/+6
| | | | | | | | better use memcpy() directly
* | slightly improved decompression speed (~+1-2%)Yann Collet2018-02-111-2/+5
|/ | | | by making shortcut slightly more common
* intel: do not use __attribute__((packed)) on WindowsBen Boeckel2018-02-082-2/+2
| | | | | | | On Windows, the Intel compiler is closer to MSVC rather than GCC and does not support the GCC attribute syntax. Fixes #468
* fixed code comment as detected in #466Yann Collet2018-02-071-27/+28
| | | | | Also clarified a few API code comments and updated associated html documentation
* Clarify the requirements of the LZ4 streaming APINick Terrell2018-02-021-2/+4
|
* Merge branch 'dev' into frameCompressYann Collet2018-02-012-35/+33
|\
| * Always prefer c++14 attributes if availableAsger Hautop Drewsen2018-01-311-4/+2
| |
| * Ensure LZ4_DEPRECATED("...") is before LZ4LIB_APIAsger Hautop Drewsen2018-01-312-31/+31
| | | | | | | | | | | | When using clang++ with std c++14 or c++17 you would get the error "an attribute list cannot appear here" when including "lz4.h" as the visibility attribute is before the c++ attribute. This ensures that the [[deprecated]] c++ attribute is before everything else in the function declarations.
* | refactored frameCompress exampleYann Collet2018-01-312-5/+10
|/ | | | to better reflect LZ4F API usage.
* [lz4hc] level == 0 means default, not level 1Nick Terrell2018-01-221-1/+1
|
* Change file format back to ASCII (from UTF-8)Po-Chuan Hsieh2018-01-171-2/+2
| | | | | | | - Replace U+00A0 by space - Fix build failure of archivers/py-borgbackup in FreeBSD Reference: https://bugs.FreeBSD.org/225235
* lz4frame : removed some intermediate stage from LZ4F_decompress()Yann Collet2018-01-141-16/+6
| | | | | ensure some strange jump cases are not possible (they were already not possible, but static analyzer couldn't understand it).
* ensure a ptr is non-nullYann Collet2018-01-141-0/+9
| | | | | with an assert() to help static analyzer understanding this condition.
* modified formulation for LZ4F_compressBound()Yann Collet2018-01-142-24/+24
| | | | | | previous version used an intentional overflow, which is defined since it uses unsigned type, but static analyzer complain about it.
* Fix lz4 versionPo-Chuan Hsieh2018-01-131-1/+1
|
* updated LZ4F_decompress() documentationYann Collet2018-01-131-11/+16
|
* Merge pull request #443 from terrelln/440Yann Collet2018-01-101-2/+4
|\ | | | | [lz4f] Skip memcpy() on empty dictionary
| * [lz4f] Skip memcpy() on empty dictionaryNick Terrell2018-01-051-2/+4
| |
* | Add Option to Make lz4frame_static.h Functions Visible in Shared ObjectsW. Felix Handte2018-01-081-16/+27
| | | | | | | | | | | | | | | | | | | | In some contexts, *cough*like at facebook*cough*, dynamic linking is used in contexts which aren't truly dynamic. That is, the guarantee is maintained that a program will only ever execute against the library version it was compiled to interact with. For those situations, introduce a compile-time flag that overrides hiding these unstable APIs in shared objects.
* | Merge pull request #434 from lz4/patternYann Collet2018-01-062-8/+17
|\ \ | | | | | | conditional pattern analysis
| * | conditional pattern analysisYann Collet2017-12-222-8/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pattern analysis (currently limited to long ranges of identical bytes) is actually detrimental to performance when `nbSearches` is low. Reason is : `nbSearches` provides a built-in protection for these cases. The problem with patterns is that they dramatically increase the number of candidates to visit. But with a low nbSearches, the match finder just aborts early. In such cases, pattern analysis adds some complexity without reducing total nb of candidates. It actually increases compression ratio a little bit, by filtering only "good" candidates, but at a measurable speed cost, so it's not a good trade-off. This patch makes pattern analysis optional. It's enabled for levels 8+ only.
* | lz4opt supports _destSizeYann Collet2017-12-222-26/+49
|/ | | | no longer limited to level 9
* new level 10Yann Collet2017-12-202-15/+39
| | | | | | | | | | | | lz4opt is only competitive vs lz4hc level 10. Below that level, it doesn't match the speed / compression effectiveness of regular hc parser. This patch propose to extend lz4opt to levels 10-12. The new level 10 tend to compress a bit better and a bit faster than previous one (mileage vary depending on file) The only downside is that `limitedDestSize` mode is now limited to max level 9 (vs 10), since it's only compatible with regular HC parser. (Note : I suspect it's possible to convert lz4opt to support it too, but haven't spent time into it).
* remove `register` keywordYann Collet2017-12-051-13/+13
| | | | | deprecated in newer C++ versions, and dubious utility
* API : changed a few variables' names for clarityYann Collet2017-11-201-44/+44
| | | | | updated relevant doc. This patch has no impact on ABI/API, nor on binary generation.
* Merge pull request #416 from lz4/newoptYann Collet2017-11-096-391/+415
|\ | | | | Improve Optimal parser
| * added code commentsYann Collet2017-11-091-1/+6
| |
| * added constant TRAILING_LITERALSYann Collet2017-11-091-5/+6
| | | | | | | | | | which is more explicit than its value `3`. reported by @terrelln
| * lz4opt: simplified match finder invocation to LZ4HC_FindLongerMatch()Yann Collet2017-11-092-21/+12
| |
| * added code commentsYann Collet2017-11-081-5/+8
| |
| * fixed LZ4HC_reverseCountPattern()Yann Collet2017-11-081-6/+5
| | | | | | | | | | for multi-bytes patterns (which is not useful for the time being)
| * removed the ip++ at the beginning of blockYann Collet2017-11-082-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The first byte used to be skipped to avoid a infinite self-comparison. This is no longer necessary, since init() ensures that index starts at 64K. The first byte is also useless to search when each block is independent, but it's no longer the case when blocks are linked. Removing the first-byte-skip saves about 10 bytes / MB on files compressed with -BD4 (linked blocks 64Kb), which feels correct as each MB has 16 blocks of 64KB.
| * removed legacy version of LZ4HC_InsertAndFindBestMatch()Yann Collet2017-11-071-53/+1
| |
| * ensure `pattern` is a 1-byte repetitionYann Collet2017-11-071-1/+2
| |
| * removed useless `(1 && ...)` conditionYann Collet2017-11-071-3/+4
| | | | | | | | as reported by @terrelln
| * improved LZ4HC_reverseCountPattern() :Yann Collet2017-11-071-3/+7
| | | | | | | | | | works for any repetitive pattern of length 1, 2 or 4 (but not 3!) works for any endianess
| * fixed LZ4HC_countPattern()Yann Collet2017-11-071-5/+19
| | | | | | | | | | | | | | - works with byte values other than `0` - works for any repetitive pattern of length 1, 2 or 4 (but not 3!) - works for little and big endian systems - preserve speed of previous implementation
| * fixed minor static analyzer warningYann Collet2017-11-031-1/+0
| | | | | | | | dead assignment
| * minor comment editYann Collet2017-11-033-33/+29
| |