Lines Matching refs:statePtr
427 ZSTD_STATIC void FSE_initCState(FSE_CState_t *statePtr, const FSE_CTable *ct)
432 statePtr->value = (ptrdiff_t)1 << tableLog;
433 statePtr->stateTable = u16ptr + 2;
434 statePtr->symbolTT = ((const U32 *)ct + 1 + (tableLog ? (1 << (tableLog - 1)) : 1));
435 statePtr->stateLog = tableLog;
441 ZSTD_STATIC void FSE_initCState2(FSE_CState_t *statePtr, const FSE_CTable *ct, U32 symbol)
443 FSE_initCState(statePtr, ct);
445 const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform *)(statePtr->symbolTT))[symbol];
446 const U16 *stateTable = (const U16 *)(statePtr->stateTable);
448 statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
449 statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
453 ZSTD_STATIC void FSE_encodeSymbol(BIT_CStream_t *bitC, FSE_CState_t *statePtr, U32 symbol)
455 const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform *)(statePtr->symbolTT))[symbol];
456 const U16 *const stateTable = (const U16 *)(statePtr->stateTable);
457 U32 nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
458 BIT_addBits(bitC, statePtr->value, nbBitsOut);
459 statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
462 ZSTD_STATIC void FSE_flushCState(BIT_CStream_t *bitC, const FSE_CState_t *statePtr)
464 BIT_addBits(bitC, statePtr->value, statePtr->stateLog);