Lines Matching +full:256 +full:- +full:byte
5 * This source code is licensed under both the BSD-style license (found in the
8 * You may select, at your option, one of the above-listed licenses.
11 /*-*************************************
17 * -log2(x / 256) lookup table for x in [0, 256).
19 * Else: Return floor(-log2(x / 256) * 256)
21 static unsigned const kInverseProbabilityLog256[256] = {
32 279, 276, 273, 270, 267, 264, 261, 258, 256, 253, 250, 247,
54 * Returns true if we should use ncount=-1 else we should
73 BYTE wksp[FSE_NCOUNTBOUND]; in ZSTD_NCountCost()
91 unsigned norm = (unsigned)((256 * count[s]) / total); in ZSTD_entropyCost()
137 * norm must be valid for every symbol with non-zero probability in count.
142 unsigned const shift = 8 - accuracyLog; in ZSTD_crossEntropyCost()
147 unsigned const normAcc = (norm[s] != -1) ? (unsigned)norm[s] : 1; in ZSTD_crossEntropyCost()
150 assert(norm256 < 256); in ZSTD_crossEntropyCost()
170 * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol. in ZSTD_selectEncodingType()
182 size_t const mult = 10 - strategy; in ZSTD_selectEncodingType()
184 …Seq_min = (((size_t)1 << defaultNormLog) * mult) >> baseLog; /* 28-36 for offset, 56-72 for lengt… in ZSTD_selectEncodingType()
193 || (mostFrequent < (nbSeq >> (defaultNormLog-1))) ) { in ZSTD_selectEncodingType()
246 const BYTE* codeTable, size_t nbSeq, in ZSTD_buildCTable()
251 BYTE* op = (BYTE*)dst; in ZSTD_buildCTable()
252 const BYTE* const oend = op + dstCapacity; in ZSTD_buildCTable()
257 FORWARD_IF_ERROR(FSE_buildCTable_rle(nextCTable, (BYTE)max), ""); in ZSTD_buildCTable()
265 …defaultNormLog, entropyWorkspace, entropyWorkspaceSize), ""); /* note : could be pre-calculated */ in ZSTD_buildCTable()
271 if (count[codeTable[nbSeq-1]] > 1) { in ZSTD_buildCTable()
272 count[codeTable[nbSeq-1]]--; in ZSTD_buildCTable()
273 nbSeq_1--; in ZSTD_buildCTable()
278 …FORWARD_IF_ERROR(FSE_normalizeCount(wksp->norm, tableLog, count, nbSeq_1, max, ZSTD_useLowProbCoun… in ZSTD_buildCTable()
280 …{ size_t const NCountSize = FSE_writeNCount(op, (size_t)(oend - op), wksp->norm, max, tableLog);… in ZSTD_buildCTable()
282 …ORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, wksp->norm, max, tableLog, wksp->wksp, sizeof(wks… in ZSTD_buildCTable()
293 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences_body()
294 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences_body()
295 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences_body()
307 (int)(blockStream.endPtr - blockStream.startPtr), in ZSTD_encodeSequences_body()
311 FSE_initCState2(&stateMatchLength, CTable_MatchLength, mlCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
312 FSE_initCState2(&stateOffsetBits, CTable_OffsetBits, ofCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
313 FSE_initCState2(&stateLitLength, CTable_LitLength, llCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
314 BIT_addBits(&blockStream, sequences[nbSeq-1].litLength, LL_bits[llCodeTable[nbSeq-1]]); in ZSTD_encodeSequences_body()
316 BIT_addBits(&blockStream, sequences[nbSeq-1].mlBase, ML_bits[mlCodeTable[nbSeq-1]]); in ZSTD_encodeSequences_body()
319 U32 const ofBits = ofCodeTable[nbSeq-1]; in ZSTD_encodeSequences_body()
320 unsigned const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); in ZSTD_encodeSequences_body()
322 BIT_addBits(&blockStream, sequences[nbSeq-1].offBase, extraBits); in ZSTD_encodeSequences_body()
325 BIT_addBits(&blockStream, sequences[nbSeq-1].offBase >> extraBits, in ZSTD_encodeSequences_body()
326 ofBits - extraBits); in ZSTD_encodeSequences_body()
328 BIT_addBits(&blockStream, sequences[nbSeq-1].offBase, ofCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
333 for (n=nbSeq-2 ; n<nbSeq ; n--) { /* intentional underflow */ in ZSTD_encodeSequences_body()
334 BYTE const llCode = llCodeTable[n]; in ZSTD_encodeSequences_body()
335 BYTE const ofCode = ofCodeTable[n]; in ZSTD_encodeSequences_body()
336 BYTE const mlCode = mlCodeTable[n]; in ZSTD_encodeSequences_body()
340 DEBUGLOG(6, "encoding: litlen:%2u - matchlen:%2u - offCode:%7u", in ZSTD_encodeSequences_body()
350 if (MEM_32bits() || (ofBits+mlBits+llBits >= 64-7-(LLFSELog+MLFSELog+OffFSELog))) in ZSTD_encodeSequences_body()
357 unsigned const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); in ZSTD_encodeSequences_body()
363 ofBits - extraBits); /* 31 */ in ZSTD_encodeSequences_body()
368 DEBUGLOG(7, "remaining space : %i", (int)(blockStream.endPtr - blockStream.ptr)); in ZSTD_encodeSequences_body()
387 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences_default()
388 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences_default()
389 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences_default()
405 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences_bmi2()
406 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences_bmi2()
407 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences_bmi2()
421 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences()
422 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences()
423 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences()