• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/openzfs/module/zstd/lib/

Lines Matching refs:symbol

901                      if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression instead.
939 if return == 1, srcData is a single byte symbol * srcSize times. Use RLE compression.
950 1. count symbol occurrence from source[] into table count[] (see hist.h)
1020 FSE_count() will return the number of occurrence of the most frequent symbol.
1021 This can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility.
1035 It is 0 if there is a single symbol within distribution.
1786 /**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */
1798 /**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */
1813 * FSE symbol compression API
1828 static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);
1837 So the first symbol you will encode is the last you will decode, like a LIFO stack.
1854 FSE_encodeByte(&bitStream, &state, symbol);
1877 * FSE symbol decompression API
1909 You can then decode your data, symbol after symbol.
1912 unsigned char symbol = FSE_decodeSymbol(&DState, &DStream);
1930 After each decoded symbol, check if DStream is fully consumed using this simple test :
1969 * Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)
1970 * uses the smallest state value possible, saving the cost of this symbol */
1971 MEM_STATIC void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
1974 { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
1982 MEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, unsigned symbol)
1984 FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
1999 * Approximate maximum cost of a symbol, in bits.
2000 * Fractional get rounded up (i.e : a symbol with a normalized frequency of 3 gives the same result as a frequency of 2)
2010 * Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits)
2041 unsigned char symbol;
2057 return DInfo.symbol;
2072 BYTE const symbol = DInfo.symbol;
2076 return symbol;
2080 unsafe, only works if no symbol has a probability > 50% */
2085 BYTE const symbol = DInfo.symbol;
2089 return symbol;
2117 * Maximum symbol value authorized.
2314 size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */
2322 size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */
2323 size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */
2335 * 1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within "fse.h")
2393 * Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX
2461 size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* single-symbol decoder */
2463 size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* double-symbol decoder */
2469 size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< single-symbol decoder */
2470 size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /**< single-symbol decoder */
2477 size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); /**< automatic selection of sing or double symbol decoder, based on DTable */
2673 /* get last non-null symbol weight (implied, total must be 2^n) */
2844 tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s;
2860 tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s;
2870 FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);
2871 U32 const nextState = symbolNext[symbol]++;
2896 cell->symbol = symbolValue;
2922 dinfo[s].symbol = (BYTE)s;
5251 * in order to inline them, and remove their symbol from the public list.
5278 but also want to avoid symbol collisions with another library which also includes xxHash,
5280 you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library
5284 regular symbol name will be automatically translated by this header.
7353 * symbol is required for external callers */
7451 * Updates *maxSymbolValuePtr with actual largest symbol value detected.
7452 * @return : count of the most frequent symbol (which isn't identified).
7454 * note : if return == srcSize, there is only one symbol.
7497 * @return : count of the most frequent symbol.
7567 /* For explanations on how to distribute symbol values over the table :
7568 * http://fastcompression.blogspot.fr/2014/02/fse-distributing-symbol-values.html */
7574 /* symbol start positions */
7578 if (normalizedCounter[u-1]==-1) { /* Low proba symbol */
7589 U32 symbol;
7590 for (symbol=0; symbol<=maxSymbolValue; symbol++) {
7592 int const freq = normalizedCounter[symbol];
7594 tableSymbol[position] = (FSE_FUNCTION_TYPE)symbol;
7606 tableU16[cumul[s]++] = (U16) (tableSize+u); /* TableU16 : sorted by symbol order; gives next state value */
7635 #if 0 /* debug : symbol costs */
7637 { U32 symbol;
7638 for (symbol=0; symbol<=maxSymbolValue; symbol++) {
7640 symbol, normalizedCounter[symbol],
7641 FSE_getMaxNbBits(symbolTT, symbol),
7642 (double)FSE_bitCost(symbolTT, tableLog, symbol, 8) / 256);
7685 unsigned symbol = 0;
7698 while ((symbol < alphabetSize) && (remaining>1)) { /* stops at 1 */
7700 unsigned start = symbol;
7701 while ((symbol < alphabetSize) && !normalizedCounter[symbol]) symbol++;
7702 if (symbol == alphabetSize) break; /* incorrect distribution */
7703 while (symbol >= start+24) {
7713 while (symbol >= start+3) {
7718 bitStream += (symbol-start) << bitCount;
7729 { int count = normalizedCounter[symbol++];
7754 assert(symbol <= alphabetSize);
7812 if (minBits > tableLog) tableLog = minBits; /* Need a minimum to safely represent all symbol values */
8009 /* fake FSE_CTable, for rle input (always same symbol) */
8130 /* Scan input and build symbol stats */
8132 if (maxCount == srcSize) return 1; /* only a single symbol in src : rle */
8133 if (maxCount == 1) return 0; /* each symbol present maximum once => not compressible */
8445 /* Scan input and build symbol stats */
8447 if (maxCount == wtSize) return 1; /* only a single symbol in src : rle */
8448 if (maxCount == 1) return 0; /* each symbol present maximum once => not compressible */
8521 /* get symbol weights */
8556 /* assign value within rank, symbol order */
8594 while (huffNode[n].nbBits == maxNbBits) n--; /* n end at index of smallest symbol using < maxNbBits */
8603 /* Get pos of last (smallest) symbol per rank */
8624 /* only triggered when no more rank 1 symbol left => find closest one (note : there is necessarily at least one !) */
8632 if (rankLast[nBitsToDecrease] == 0) /* special case, reached largest symbol */
8641 if (rankLast[1] == noSymbol) { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0 (using maxNbBits) */
8768 tree[huffNode[n].byte].nbBits = huffNode[n].nbBits; /* push nbBits per symbol, symbol order */
8770 tree[n].val = valPerRank[tree[n].nbBits]++; /* assign value within rank, symbol order */
8808 HUF_encodeSymbol(BIT_CStream_t* bitCPtr, U32 symbol, const HUF_CElt* CTable)
8810 BIT_addBitsFast(bitCPtr, CTable[symbol].val, CTable[symbol].nbBits);
9035 /* Scan input and build symbol stats */
9037 if (largest == srcSize) { *ostart = ((const BYTE*)src)[0]; return 1; } /* single symbol, rle */
11375 * table described by norm. The max symbol support by norm is assumed >= max.
11376 * norm must be valid for every symbol with non-zero probability in count.
11409 * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol.
11745 * Stores symbol compression modes for a super-block in {ll, ol, ml}Type, and
11808 /* Scan input and build symbol stats */
11869 * Stores symbol compression modes and fse table to fseMetadata.
12137 * symbol compression modes for the super-block.
12458 * For example, it would recount literal distribution and symbol codes everytime.
20360 * does not include price of literalLength symbol */
20385 * cost of literalLength symbol */
21463 /* single-symbol decoding */
21465 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1; /* single-symbol decoding */
21810 typedef struct { BYTE symbol; BYTE weight; } sortedSymbol_t;
21840 const U32 symbol = sortedSymbols[s].symbol;
21848 MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
21872 const U16 symbol = sortedList[s].symbol;
21878 if (targetLog-nbBits >= minBits) { /* enough room for a second symbol */
21886 nbBitsBaseline, symbol);
21889 MEM_writeLE16(&(DElt.sequence), symbol);
21964 sortedSymbol[r].symbol = (BYTE)s;
22027 /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
24561 * generate FSE decoding table for one symbol (ll, ml or off)
26471 * note : symbol not declared but exposed for fullbench */
26757 * generate FSE decoding table for one symbol (ll, ml or off)
26812 U32 const symbol = tableDecode[u].baseValue;
26813 U32 const nextState = symbolNext[symbol]++;
26816 assert(nbAdditionalBits[symbol] < 255);
26817 tableDecode[u].nbAdditionalBits = (BYTE)nbAdditionalBits[symbol];
26818 tableDecode[u].baseValue = baseValue[symbol];
26838 { U32 const symbol = *(const BYTE*)src;
26839 U32 const baseline = baseValue[symbol];
26840 U32 const nbBits = nbAdditionalBits[symbol];
26904 RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */