From baff8d6c1f9615f716e3f59bbd2669210d554eb6 Mon Sep 17 00:00:00 2001 From: inikep Date: Thu, 4 Feb 2016 16:02:05 +0100 Subject: [PATCH] gitignore --- .gitignore | 4 +++- lib/zstd_opt.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8b7aa0c3..a31ffdc7 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,6 @@ ipch/ _codelite _zstdbench -lib/zstd_opt_LZ5.c \ No newline at end of file +lib/zstd_opt_LZ5.c +lib/zstd_opt_llen.c +lib/zstd_opt_nollen.c \ No newline at end of file diff --git a/lib/zstd_opt.c b/lib/zstd_opt.c index 25275945..976c9877 100644 --- a/lib/zstd_opt.c +++ b/lib/zstd_opt.c @@ -150,7 +150,7 @@ FORCE_INLINE size_t ZSTD_getPrice(seqStore_t* seqStorePtr, size_t litLength, con size_t match_cost_old = ZSTD_highbit((U32)matchLength+1) + Offbits + ZSTD_highbit((U32)offset+1); size_t match_cost = ZSTD_getMatchPriceReal(seqStorePtr, offset, matchLength); // printf("old=%d new=%d\n", (int)match_cost2, (int)match_cost); - return lit_cost + match_cost_old; + return lit_cost + match_cost; #else size_t lit_cost = (litLength<<3); size_t match_cost = ZSTD_highbit((U32)matchLength+1) + Offbits + ZSTD_highbit((U32)offset+1); @@ -653,9 +653,9 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, goto _storeSequence; } + litlen = opt[0].litlen + 1; do { - litlen = opt[0].litlen + 1; price = ZSTD_getPrice(seqStorePtr, litlen, anchor, 0, mlen - MINMATCH); if (mlen + 1 > last_pos || price < opt[mlen + 1].price) SET_PRICE(mlen + 1, mlen, 0, litlen, price); @@ -703,9 +703,9 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx, mlen = (i>0) ? matches[i-1].len+1 : best_mlen; best_mlen = (matches[i].len < ZSTD_OPT_NUM) ? matches[i].len : ZSTD_OPT_NUM; ZSTD_LOG_PARSER("%d: start Found mlen=%d off=%d best_mlen=%d last_pos=%d\n", (int)(ip-base), matches[i].len, matches[i].off, (int)best_mlen, (int)last_pos); + litlen = opt[0].litlen; while (mlen <= best_mlen) { - litlen = opt[0].litlen; price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[i].off, mlen - MINMATCH); if (mlen > last_pos || price < opt[mlen].price) SET_PRICE(mlen, mlen, matches[i].off, litlen, price);