From: Bimba Shrestha Date: Fri, 12 Jun 2020 02:41:03 +0000 (-0700) Subject: loading dict using new algorithm X-Git-Tag: v1.4.7~81^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=628559d0e4c8ace6c29c187ac59a897b7ee4b7de;p=thirdparty%2Fzstd.git loading dict using new algorithm --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 31c49a9c3..4ad60400f 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2892,7 +2892,9 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, case ZSTD_greedy: case ZSTD_lazy: case ZSTD_lazy2: - if (chunk >= HASH_READ_SIZE) + if (chunk >= HASH_READ_SIZE && params->enableDedicatedDictSearch) + ZSTD_lazy_loadDictionary(ms, ichunk-HASH_READ_SIZE); + else if (chunk >= HASH_READ_SIZE) ZSTD_insertAndFindFirstIndex(ms, ichunk-HASH_READ_SIZE); break; diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c index f58e6a27b..e717ef74e 100644 --- a/lib/compress/zstd_lazy.c +++ b/lib/compress/zstd_lazy.c @@ -580,7 +580,7 @@ size_t ZSTD_HcFindBestMatch_generic ( /* save best solution */ if (currentMl > ml) { ml = currentMl; - *offsetPtr = current - (matchIndex + dmsIndexDelta) + ZSTD_REP_MOVE; + *offsetPtr = curr - (matchIndex + dmsIndexDelta) + ZSTD_REP_MOVE; if (ip+currentMl == iLimit) break; /* best possible, avoids read overflow on next attempt */ }