]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[opt] Delete ZSTD_litLengthContribution 2028/head
authorNick Terrell <terrelln@fb.com>
Thu, 5 Mar 2020 00:35:26 +0000 (16:35 -0800)
committerNick Terrell <terrelln@fb.com>
Thu, 5 Mar 2020 00:35:26 +0000 (16:35 -0800)
lib/compress/zstd_opt.c

index 896365fc8779ed1aa56e7388cc97d15920a24c9a..3caa4a1c31e6b63786cc3b4d4ce259cb3964d723 100644 (file)
@@ -249,27 +249,6 @@ static U32 ZSTD_litLengthPrice(U32 const litLength, const optState_t* const optP
     }
 }
 
-/* ZSTD_litLengthContribution() :
- * @return ( cost(litlength) - cost(0) )
- * this value can then be added to rawLiteralsCost()
- * to provide a cost which is directly comparable to a match ending at same position */
-static int ZSTD_litLengthContribution(U32 const litLength, const optState_t* const optPtr, int optLevel)
-{
-    if (optPtr->priceType >= zop_predef) return (int)WEIGHT(litLength, optLevel);
-
-    /* dynamic statistics */
-    {   U32 const llCode = ZSTD_LLcode(litLength);
-        int const contribution = (int)(LL_bits[llCode] * BITCOST_MULTIPLIER)
-                               + (int)WEIGHT(optPtr->litLengthFreq[0], optLevel)   /* note: log2litLengthSum cancel out */
-                               - (int)WEIGHT(optPtr->litLengthFreq[llCode], optLevel);
-#if 1
-        return contribution;
-#else
-        return MAX(0, contribution); /* sometimes better, sometimes not ... */
-#endif
-    }
-}
-
 /* ZSTD_getMatchPrice() :
  * Provides the cost of the match part (offset + matchLength) of a sequence
  * Must be combined with ZSTD_fullLiteralsCost() to get the full cost of a sequence.