diff options
author | Yann Collet <cyan@fb.com> | 2017-11-03 09:01:20 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2017-11-03 09:03:19 (GMT) |
commit | e2eca62046e500a95ab34e913e939aa68acb2cd4 (patch) | |
tree | 2093a20c1fcd451c7c8f1e80e22087c3b1e3090b /lib/lz4opt.h | |
parent | 3b222d2d963fe6144498a3cb306943566ddb6922 (diff) | |
download | lz4-e2eca62046e500a95ab34e913e939aa68acb2cd4.zip lz4-e2eca62046e500a95ab34e913e939aa68acb2cd4.tar.gz lz4-e2eca62046e500a95ab34e913e939aa68acb2cd4.tar.bz2 |
LZ4_compress_HC_continue_destSize() now compatible with optimal parser
levels 11+
Diffstat (limited to 'lib/lz4opt.h')
-rw-r--r-- | lib/lz4opt.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h index a1627f1..18bcd31 100644 --- a/lib/lz4opt.h +++ b/lib/lz4opt.h @@ -160,7 +160,7 @@ static int LZ4HC_compress_optimal ( DEBUGLOG(7, "rPos:%3i => price:%3i (litlen=%i) -- initial setup", rPos, cost, opt[rPos].litlen); } } - /* set prices using matches found for rPos = 0 */ + /* set prices using initial match */ { int mlen = MINMATCH; int const matchML = firstMatch.len; /* necessarily < sufficient_len < LZ4_OPT_NUM */ int const offset = firstMatch.off; @@ -215,7 +215,7 @@ static int LZ4HC_compress_optimal ( goto encode; } - /* before first match : set price with literals at beginning */ + /* before match : set price with literals at beginning */ { int const baseLitlen = opt[cur].litlen; int litlen; for (litlen = 1; litlen < MINMATCH; litlen++) { @@ -230,10 +230,10 @@ static int LZ4HC_compress_optimal ( pos, price, opt[pos].litlen); } } } - /* set prices using matches at position = cur */ + /* set prices using match at position = cur */ { int const matchML = newMatch.len; int ml = MINMATCH; - + assert(cur + newMatch.len < LZ4_OPT_NUM); for ( ; ml <= matchML ; ml++) { int const pos = cur + ml; @@ -255,7 +255,7 @@ static int LZ4HC_compress_optimal ( DEBUGLOG(7, "rPos:%3i => price:%3i (matchlen=%i)", pos, price, ml); assert(pos < LZ4_OPT_NUM); - if ( (ml == matchML) /* last post of last match */ + if ( (ml == matchML) /* last pos of last match */ && (last_match_pos < pos) ) last_match_pos = pos; opt[pos].mlen = ml; |