diff options
author | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-06 18:42:47 (GMT) |
---|---|---|
committer | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-06 18:42:47 (GMT) |
commit | cfe6a24b0844dffa79f4a7749e076aadb4497f75 (patch) | |
tree | 551c38e669760d01d89f12ed7b2884deb2c59292 /lib/lz4opt.h | |
parent | 2113ead176e0032c7ba04aa93f3bcc3d04ba6142 (diff) | |
download | lz4-cfe6a24b0844dffa79f4a7749e076aadb4497f75.zip lz4-cfe6a24b0844dffa79f4a7749e076aadb4497f75.tar.gz lz4-cfe6a24b0844dffa79f4a7749e076aadb4497f75.tar.bz2 |
updated LZ4HC_get_price
Diffstat (limited to 'lib/lz4opt.h')
-rw-r--r-- | lib/lz4opt.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h index fbd3048..5208438 100644 --- a/lib/lz4opt.h +++ b/lib/lz4opt.h @@ -63,7 +63,7 @@ FORCE_INLINE size_t LZ4_LIT_ONLY_COST(size_t litlen) return price; } -FORCE_INLINE size_t LZ4HC_get_price(size_t litlen, size_t offset, size_t mlen) +FORCE_INLINE size_t LZ4HC_get_price(size_t litlen, size_t mlen) { size_t price = 16 + 8; /* 16-bit offset + token */ @@ -307,7 +307,7 @@ FORCE_INLINE int LZ4HC_BinTree_GetAllMatches ( static int LZ4HC_compress_optimal ( LZ4HC_CCtx_internal* ctx, - const BYTE* source, + const char* const source, char* dest, int inputSize, int maxOutputSize, @@ -374,7 +374,7 @@ static int LZ4HC_compress_optimal ( while (mlen <= best_mlen) { litlen = 0; - price = LZ4HC_get_price(llen + litlen, matches[i].off, mlen - MINMATCH) - llen; + price = LZ4HC_get_price(llen + litlen, mlen - MINMATCH) - llen; if (mlen > last_pos || price < (size_t)opt[mlen].price) SET_PRICE(mlen, mlen, matches[i].off, litlen, price); mlen++; @@ -465,14 +465,14 @@ static int LZ4HC_compress_optimal ( litlen = opt[cur2].litlen; if (cur2 != litlen) - price = opt[cur2 - litlen].price + LZ4HC_get_price(litlen, matches[i].off, mlen - MINMATCH); + price = opt[cur2 - litlen].price + LZ4HC_get_price(litlen, mlen - MINMATCH); else - price = LZ4HC_get_price(llen + litlen, matches[i].off, mlen - MINMATCH) - llen; + price = LZ4HC_get_price(llen + litlen, mlen - MINMATCH) - llen; } else { litlen = 0; - price = opt[cur2].price + LZ4HC_get_price(litlen, matches[i].off, mlen - MINMATCH); + price = opt[cur2].price + LZ4HC_get_price(litlen, mlen - MINMATCH); } LZ4_LOG_PARSER("%d: Found2 pred=%d mlen=%d best_mlen=%d off=%d price=%d litlen=%d price[%d]=%d\n", (int)(inr-source), matches[i].back, mlen, best_mlen, matches[i].off, price, litlen, cur - litlen, opt[cur - litlen].price); |