MCPcopy Create free account
hub / github.com/F-Stack/f-stack / FSE_minTableLog

Function FSE_minTableLog

freebsd/contrib/openzfs/module/zstd/lib/zstd.c:7795–7802  ·  view source on GitHub ↗

provides the minimum logSize to safely represent a distribution */

Source from the content-addressed store, hash-verified

7793
7794/* provides the minimum logSize to safely represent a distribution */
7795static unsigned FSE_minTableLog(size_t srcSize, unsigned maxSymbolValue)
7796{
7797 U32 minBitsSrc = BIT_highbit32((U32)(srcSize)) + 1;
7798 U32 minBitsSymbols = BIT_highbit32(maxSymbolValue) + 2;
7799 U32 minBits = minBitsSrc < minBitsSymbols ? minBitsSrc : minBitsSymbols;
7800 assert(srcSize > 1); /* Not supported, RLE should be used instead */
7801 return minBits;
7802}
7803
7804unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus)
7805{

Callers 2

FSE_normalizeCountFunction · 0.70

Calls 1

BIT_highbit32Function · 0.70

Tested by

no test coverage detected