removed a bunch of code related to cached literal price

optState was used both to evaluate price
and to cache cost of previously calculated literals.
This created a strong dependency, forcing parser to request cost in a strict order.
This limitation is forbids future parser with skipping capabilities.

After this patch, caching literals price still exists,
but is now explicit, in a stack structure.
This commit is contained in:
Yann Collet
2017-11-28 12:32:24 -08:00
parent 03f30d9dcb
commit b71405dc51
2 changed files with 22 additions and 96 deletions
-3
View File
@@ -93,9 +93,6 @@ typedef struct {
U32 factor; /* fixed cost added when calculating ZSTD_getPrice() (but why ? seems to favor less sequences) */
/* end : updated by ZSTD_setLog2Prices */
U32 staticPrices; /* prices follow a pre-defined cost structure, statistics are irrelevant */
U32 cachedPrice;
U32 cachedLitLength;
const BYTE* cachedLiterals;
} optState_t;
typedef struct {