Exemplo n.º 1
0
        private static void FSE_encodeSymbol(BIT_CStream_t *bitC, FSE_CState_t *statePtr, uint symbol)
        {
            FSE_symbolCompressionTransform symbolTT = ((FSE_symbolCompressionTransform *)(statePtr->symbolTT))[symbol];
            ushort *stateTable = (ushort *)(statePtr->stateTable);
            uint    nbBitsOut  = (uint)(((nuint)statePtr->value + symbolTT.deltaNbBits) >> 16);

            BIT_addBits(bitC, (nuint)statePtr->value, nbBitsOut);
            statePtr->value = (nint)(stateTable[(statePtr->value >> (int)nbBitsOut) + symbolTT.deltaFindState]);
        }
Exemplo n.º 2
0
        private static void FSE_initCState2(FSE_CState_t *statePtr, uint *ct, uint symbol)
        {
            FSE_initCState(statePtr, ct);

            {
                FSE_symbolCompressionTransform symbolTT = ((FSE_symbolCompressionTransform *)(statePtr->symbolTT))[symbol];
                ushort *stateTable = (ushort *)(statePtr->stateTable);
                uint    nbBitsOut  = (uint)((symbolTT.deltaNbBits + (uint)((1 << 15))) >> 16);

                statePtr->value = (nint)((nbBitsOut << 16) - symbolTT.deltaNbBits);
                statePtr->value = (nint)(stateTable[(statePtr->value >> (int)nbBitsOut) + symbolTT.deltaFindState]);
            }
        }