]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
changed : sufficientLength => targetLength
authorYann Collet <yann.collet.73@gmail.com>
Thu, 11 Feb 2016 03:38:55 +0000 (04:38 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Thu, 11 Feb 2016 03:38:55 +0000 (04:38 +0100)
lib/zstd_compress.c
lib/zstd_opt.h
lib/zstd_static.h
programs/paramgrill.c

index 137058b5b92358c7c8f69bff9b3ccb739b775d02..dda6683e6d7d4aa6dfb97d515ad881ad20050530 100644 (file)
@@ -191,7 +191,7 @@ void ZSTD_validateParams(ZSTD_parameters* params)
     CLAMP(params->hashLog, ZSTD_HASHLOG_MIN, ZSTD_HASHLOG_MAX);
     CLAMP(params->searchLog, ZSTD_SEARCHLOG_MIN, ZSTD_SEARCHLOG_MAX);
     CLAMP(params->searchLength, ZSTD_SEARCHLENGTH_MIN, ZSTD_SEARCHLENGTH_MAX);
-    CLAMP(params->sufficientLength, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX);
+    CLAMP(params->targetLength, ZSTD_TARGETLENGTH_MIN, ZSTD_TARGETLENGTH_MAX);
     if ((U32)params->strategy>(U32)ZSTD_opt_bt) params->strategy = ZSTD_opt_bt;
 
     /* correct params, to use less memory */
index 8d9598db3f51de139b9e53c4b8e6b3c60fce1bf3..a936d31313b63d965898a0f4ffb38df32ef3297a 100644 (file)
@@ -440,7 +440,7 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx,
     const BYTE* inr;
     U32 skip_num, cur, cur2, match_num, last_pos, litlen, price;
 
-    const U32 sufficient_len = ctx->params.sufficientLength;
+    const U32 sufficient_len = ctx->params.targetLength;
     const U32 faster_get_matches = (ctx->params.strategy == ZSTD_opt);
 
 
@@ -800,7 +800,7 @@ void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx,
     const BYTE* inr;
     U32 skip_num, cur, cur2, match_num, last_pos, litlen, price;
 
-    const U32 sufficient_len = ctx->params.sufficientLength;
+    const U32 sufficient_len = ctx->params.targetLength;
     const U32 faster_get_matches = (ctx->params.strategy == ZSTD_opt);
 
 
index 8b7d63b23035eebf9aa83a894b36187d8c6debcb..f31e63a287872a97d882c318ed01780e5add31eb 100644 (file)
@@ -27,7 +27,7 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
     You can contact the author at :
-    - zstd source repository : https://github.com/Cyan4973/zstd
+    - zstd homepage : http://www.zstd.net
 */
 #ifndef ZSTD_STATIC_H
 #define ZSTD_STATIC_H
@@ -71,7 +71,7 @@ typedef enum { ZSTD_fast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2, ZSTD
 typedef struct
 {
     U64 srcSize;       /* optional : tells how much bytes are present in the frame. Use 0 if not known. */
-    U32 sufficientLength; /* size of matches which is acceptable (used only by the optimal parser): larger == more compression, slower */
+    U32 targetLength;  /* acceptable match size for optimal parser (only) : larger == more compression, slower */
     U32 windowLog;     /* largest match distance : larger == more compression, more memory needed during decompression */
     U32 contentLog;    /* full search segment : larger == more compression, slower, more memory (useless for fast) */
     U32 hashLog;       /* dispatch table : larger == faster, more memory */
index e3f421277105326850f8c406558488eac779ad57..b77f7a38c0a364ce634cead4e8bb961bb15e6a73 100644 (file)
@@ -265,7 +265,7 @@ static size_t BMK_benchParam(BMK_result_t* resultPtr,
     U32 Hlog = params.hashLog;
     U32 Slog = params.searchLog;
     U32 Slength = params.searchLength;
-    U32 Tlength = params.sufficientLength;
+    U32 Tlength = params.targetLength;
     ZSTD_strategy strat = params.strategy;
     char name[30] = { 0 };
     U64 crcOrig;
@@ -414,7 +414,7 @@ static void BMK_printWinner(FILE* f, U32 cLevel, BMK_result_t result, ZSTD_param
     DISPLAY("\r%79s\r", "");
     fprintf(f,"    {%3u,%3u,%3u,%3u,%3u,%3u,%3u, %s },  ",
             0, params.windowLog, params.contentLog, params.hashLog, params.searchLog, params.searchLength,
-            params.sufficientLength, g_stratName[(U32)(params.strategy)]);
+            params.targetLength, g_stratName[(U32)(params.strategy)]);
     fprintf(f,
             "/* level %2u */   /* R:%5.3f at %5.1f MB/s - %5.1f MB/s */\n",
             cLevel, (double)srcSize / result.cSize, (double)result.cSpeed / 1000., (double)result.dSpeed / 1000.);
@@ -550,7 +550,7 @@ static ZSTD_parameters* sanitizeParams(ZSTD_parameters params)
     if (params.strategy == ZSTD_fast)
         g_params.contentLog = 0, g_params.searchLog = 0;
     if ((params.strategy != ZSTD_opt) && (params.strategy != ZSTD_opt_bt))
-        g_params.sufficientLength = 0;
+        g_params.targetLength = 0;
     return &g_params;
 }
 
@@ -587,9 +587,9 @@ static void paramVariation(ZSTD_parameters* p)
         case 11:
             p->strategy = (ZSTD_strategy)(((U32)p->strategy)-1); break;
         case 12:
-            p->sufficientLength *= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break;
+            p->targetLength *= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break;
         case 13:
-            p->sufficientLength /= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break;
+            p->targetLength /= 1 + ((double)(FUZ_rand(&g_rand)&255)) / 256.; break;
         }
     }
     ZSTD_validateParams(p);
@@ -647,7 +647,7 @@ static void potentialRandomParams(ZSTD_parameters* p, U32 inverseChance)
         p->searchLog  = FUZ_rand(&g_rand) % (ZSTD_SEARCHLOG_MAX+1 - ZSTD_SEARCHLOG_MIN) + ZSTD_SEARCHLOG_MIN;
         p->windowLog  = FUZ_rand(&g_rand) % (ZSTD_WINDOWLOG_MAX+1 - ZSTD_WINDOWLOG_MIN) + ZSTD_WINDOWLOG_MIN;
         p->searchLength=FUZ_rand(&g_rand) % (ZSTD_SEARCHLENGTH_MAX+1 - ZSTD_SEARCHLENGTH_MIN) + ZSTD_SEARCHLENGTH_MIN;
-        p->sufficientLength=FUZ_rand(&g_rand) % (ZSTD_TARGETLENGTH_MAX+1 - ZSTD_TARGETLENGTH_MIN) + ZSTD_TARGETLENGTH_MIN;
+        p->targetLength=FUZ_rand(&g_rand) % (ZSTD_TARGETLENGTH_MAX+1 - ZSTD_TARGETLENGTH_MIN) + ZSTD_TARGETLENGTH_MIN;
         p->strategy   = (ZSTD_strategy) (FUZ_rand(&g_rand) % (ZSTD_opt_bt+1));
         ZSTD_validateParams(p);
     }