opt: estimate cost of both Hufman and FSE symbols

For FSE symbols : provide an upper bound,
in nb of bits,
since cost function is not able to store fractional bit costs.
This commit is contained in:
Yann Collet
2018-05-08 16:11:21 -07:00
parent 338f738c24
commit 6a3c34aa58
2 changed files with 30 additions and 4 deletions
+6
View File
@@ -575,6 +575,12 @@ MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePt
BIT_flushBits(bitC);
}
MEM_STATIC U32 FSE_getMaxNbBits(const FSE_symbolCompressionTransform* symbolTT, U32 symbolValue)
{
assert(symbolValue <= FSE_MAX_SYMBOL_VALUE);
return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;
}
/* ====== Decompression ====== */