Approximate FSE encoding costs for selection
Estimate the cost for using FSE modes `set_basic`, `set_compressed`, and `set_repeat`, and select the one with the lowest cost. * The cost of `set_basic` is computed using the cross-entropy cost function `ZSTD_crossEntropyCost()`, using the normalized default count and the count. * The cost of `set_repeat` is computed using `FSE_bitCost()`. We check the previous table to see if it is able to represent the distribution. * The cost of `set_compressed` is computed with the entropy cost function `ZSTD_entropyCost()`, together with the cost of writing the normalized count `ZSTD_NCountCost()`.
This commit is contained in:
@@ -53,11 +53,15 @@ typedef struct ZSTD_prefixDict_s {
|
||||
} ZSTD_prefixDict;
|
||||
|
||||
typedef struct {
|
||||
/* Huffman data
|
||||
* Must be before the FSE data.
|
||||
*/
|
||||
U32 hufCTable[HUF_CTABLE_SIZE_U32(255)];
|
||||
HUF_repeat hufCTable_repeatMode;
|
||||
/* FSE data */
|
||||
FSE_CTable offcodeCTable[FSE_CTABLE_SIZE_U32(OffFSELog, MaxOff)];
|
||||
FSE_CTable matchlengthCTable[FSE_CTABLE_SIZE_U32(MLFSELog, MaxML)];
|
||||
FSE_CTable litlengthCTable[FSE_CTABLE_SIZE_U32(LLFSELog, MaxLL)];
|
||||
HUF_repeat hufCTable_repeatMode;
|
||||
FSE_repeat offcode_repeatMode;
|
||||
FSE_repeat matchlength_repeatMode;
|
||||
FSE_repeat litlength_repeatMode;
|
||||
|
||||
Reference in New Issue
Block a user