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:
@@ -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 ====== */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user