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

Function FSE_encodeSymbol

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

Source from the content-addressed store, hash-verified

1980}
1981
1982MEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, unsigned symbol)
1983{
1984 FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
1985 const U16* const stateTable = (const U16*)(statePtr->stateTable);
1986 U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
1987 BIT_addBits(bitC, statePtr->value, nbBitsOut);
1988 statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
1989}
1990
1991MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
1992{

Callers 2

Calls 1

BIT_addBitsFunction · 0.70

Tested by

no test coverage detected