summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.c
Commit message (Collapse)AuthorAgeFilesLines
* [lz4hc] level == 0 means default, not level 1Nick Terrell2018-01-221-1/+1
|
* Merge pull request #434 from lz4/patternYann Collet2018-01-061-7/+14
|\ | | | | conditional pattern analysis
| * conditional pattern analysisYann Collet2017-12-221-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-221-8/+6
|/ | | | no longer limited to level 9
* new level 10Yann Collet2017-12-201-14/+38
| | | | | | | | | | | | 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).
* lz4opt: simplified match finder invocation to LZ4HC_FindLongerMatch()Yann Collet2017-11-091-1/+1
|
* 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-081-2/+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
* unified HC levelsYann Collet2017-11-031-8/+4
| | | | | LZ4_setCompressionLevel() can be users accross the whole range of HC levels No more transition issue between Optimal and HC modes
* moved ctx->end handling from parsersYann Collet2017-11-031-2/+2
| | | | responsibility better handled one layer above (LZ4HC_compress_generic())
* removed ctx->searchNumYann Collet2017-11-031-17/+3
| | | | | nbSearches now transmitted directly as function parameter easier to track and debug
* LZ4_compress_HC_continue_destSize() now compatible with optimal parserYann Collet2017-11-031-5/+6
| | | | levels 11+
* removed code and reference to binary tree match finderYann Collet2017-11-031-8/+2
| | | | reduced size of LZ4HC state
* new level 11 uses 512 attemptsYann Collet2017-11-031-1/+1
|
* more generic skip formulaYann Collet2017-11-031-1/+1
| | | | improving speed
* small adaptations for intermediate level 11Yann Collet2017-11-021-1/+1
|
* partial search, while preserving compression ratioYann Collet2017-11-021-2/+2
| | | | tag interesting places
* fixed last lost bytes in maximal modeYann Collet2017-11-021-4/+9
| | | | | even gained 2 bytes on calgary.tar... added conditional traces `g_debuglog_enable`
* changed strategy : opt[] path is complete after each matchYann Collet2017-11-021-7/+14
| | | | | | | previous strategy would leave a few "bad choices" on the ground they would be fixed later, but that requires passing through each position to make the fix and cannot give the end position of the last useful match.
* added hash chain with conditional lengthYann Collet2017-10-251-9/+0
| | | | not a success yet
* lz4opt: added hash chain searchYann Collet2017-10-211-9/+18
|
* fused getLongerMatch and getWiderMatchYann Collet2017-10-091-1/+1
|
* re-inserted last byte test in widerMatchYann Collet2017-10-091-19/+22
|
* early out is not betterYann Collet2017-10-091-1/+0
|
* optional fuseYann Collet2017-10-091-68/+53
|
* improved search of rep-1 patternsYann Collet2017-10-091-27/+131
|
* insertAndFindBestMatch defers to insertAndGetWiderMatchYann Collet2017-10-091-3/+13
|
* FIX: added prefix to FORCE_INLINE to prevent redefinition error during ↵tcpan2017-08-241-4/+4
| | | | compilation when used with other libraries that define FORCE_INLINE
* dictionary compression correctly uses compression levelYann Collet2017-08-101-0/+12
| | | | Not obvious : copying the state was copying cdict's compression level
* implemented dictionary compression in lz4frameYann Collet2017-08-091-2/+10
| | | | | note : only compression API is implemented and tested still to do : decompression API
* Fix gcc7 Wimplicit-fallthrough warningsChocobo12017-06-191-1/+1
| | | | | For the default Wimplicit-fallthrough=3 level, the comment should start with "fall*"
* made level 10 a bit fasterYann Collet2017-06-141-6/+7
| | | | | | | at the expense of a little bit of compression ratio. Now speed is intermediate on calgary corpus : 25 - 12 - 8 - 3
* minor readability changesYann Collet2017-05-021-22/+20
|
* lz4hc.c: clamp compression levels > 12Alexey Tourbin2017-04-291-0/+2
| | | | | | | | | | | | | | | I noticed that, while 'lz4 -12' works fine, 'lz4 -13' does not compress at all. $ cat </etc/passwd |wc -c 2565 $ lz4 -12 </etc/passwd |wc -c 1456 $ lz4 -13 </etc/passwd |wc -c 2584 Perhaps the best way to fix this is to clamp the compression level in the LZ4HC_compress_generic routine.
* improved level 10 speed for degenerated casesYann Collet2017-03-241-1/+1
|
* minor refactorYann Collet2017-03-201-0/+4
|
* LZ4_compress_HC_continue_destSize() works as intended up to level 10Yann Collet2017-03-161-16/+15
| | | | | It's incompatible with btopt though, so cLevel >= 11 feature much reduced performance (degraded mode)
* LZ4_compress_HC_destSize() uses LZ4HC_compress_generic() code pathYann Collet2017-03-161-45/+47
| | | | | Limits compression level to 10, to remain compatible with Hash Chain.
* created LZ4_HC_STATIC_LINKING_ONLY sectionYann Collet2017-03-161-56/+43
| | | | where are exposed new prototypes *_destSize()
* lz4hc: Fix LZ4HC_compress_hashChain for backward compatibilityremittor2017-03-091-2/+2
|
* lz4hc: Fix LZ4HC_compress_hashChain for full support destSize variantremittor2017-03-081-2/+5
|
* lz4hc: Add LZ4_compressHC_destSize and LZ4_compress_HC_continue_destSizeremittor2017-03-081-10/+64
|
* lz4hc: Cleanup function LZ4HC_encodeSequenceremittor2017-03-071-11/+18
|