Lines Matching +full:5 +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)
43 5, 4, 2, 1,
54 * Returns true if we should use ncount=-1 else we should
73 BYTE wksp[FSE_NCOUNTBOUND]; in ZSTD_NCountCost()
113 DEBUGLOG(5, "Repeat FSE_CTable has maxSymbolValue %u < %u", in ZSTD_fseBitCost()
124 DEBUGLOG(5, "Repeat FSE_CTable has Prob[%u] == 0", s); in ZSTD_fseBitCost()
135 * norm must be valid for every symbol with non-zero probability in count.
140 unsigned const shift = 8 - accuracyLog; in ZSTD_crossEntropyCost()
145 unsigned const normAcc = (norm[s] != -1) ? (unsigned)norm[s] : 1; in ZSTD_crossEntropyCost()
168 * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol. in ZSTD_selectEncodingType()
171 DEBUGLOG(5, "Selected set_basic"); in ZSTD_selectEncodingType()
174 DEBUGLOG(5, "Selected set_rle"); in ZSTD_selectEncodingType()
180 size_t const mult = 10 - strategy; in ZSTD_selectEncodingType()
182 …Seq_min = (((size_t)1 << defaultNormLog) * mult) >> baseLog; /* 28-36 for offset, 56-72 for lengt… in ZSTD_selectEncodingType()
183 assert(defaultNormLog >= 5 && defaultNormLog <= 6); /* xx_DEFAULTNORMLOG */ in ZSTD_selectEncodingType()
187 DEBUGLOG(5, "Selected set_repeat"); in ZSTD_selectEncodingType()
191 || (mostFrequent < (nbSeq >> (defaultNormLog-1))) ) { in ZSTD_selectEncodingType()
192 DEBUGLOG(5, "Selected set_basic"); in ZSTD_selectEncodingType()
215 DEBUGLOG(5, "Estimated bit costs: basic=%u\trepeat=%u\tcompressed=%u", in ZSTD_selectEncodingType()
218 DEBUGLOG(5, "Selected set_basic"); in ZSTD_selectEncodingType()
224 DEBUGLOG(5, "Selected set_repeat"); in ZSTD_selectEncodingType()
230 DEBUGLOG(5, "Selected set_compressed"); in ZSTD_selectEncodingType()
244 const BYTE* codeTable, size_t nbSeq, in ZSTD_buildCTable()
249 BYTE* op = (BYTE*)dst; in ZSTD_buildCTable()
250 const BYTE* const oend = op + dstCapacity; in ZSTD_buildCTable()
255 FORWARD_IF_ERROR(FSE_buildCTable_rle(nextCTable, (BYTE)max), ""); in ZSTD_buildCTable()
263 …defaultNormLog, entropyWorkspace, entropyWorkspaceSize), ""); /* note : could be pre-calculated */ in ZSTD_buildCTable()
269 if (count[codeTable[nbSeq-1]] > 1) { in ZSTD_buildCTable()
270 count[codeTable[nbSeq-1]]--; in ZSTD_buildCTable()
271 nbSeq_1--; in ZSTD_buildCTable()
276 …FORWARD_IF_ERROR(FSE_normalizeCount(wksp->norm, tableLog, count, nbSeq_1, max, ZSTD_useLowProbCoun… in ZSTD_buildCTable()
277 …{ size_t const NCountSize = FSE_writeNCount(op, oend - op, wksp->norm, max, tableLog); /* over… in ZSTD_buildCTable()
279 …ORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, wksp->norm, max, tableLog, wksp->wksp, sizeof(wks… in ZSTD_buildCTable()
290 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences_body()
291 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences_body()
292 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences_body()
304 (int)(blockStream.endPtr - blockStream.startPtr), in ZSTD_encodeSequences_body()
308 FSE_initCState2(&stateMatchLength, CTable_MatchLength, mlCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
309 FSE_initCState2(&stateOffsetBits, CTable_OffsetBits, ofCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
310 FSE_initCState2(&stateLitLength, CTable_LitLength, llCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
311 BIT_addBits(&blockStream, sequences[nbSeq-1].litLength, LL_bits[llCodeTable[nbSeq-1]]); in ZSTD_encodeSequences_body()
313 BIT_addBits(&blockStream, sequences[nbSeq-1].matchLength, ML_bits[mlCodeTable[nbSeq-1]]); in ZSTD_encodeSequences_body()
316 U32 const ofBits = ofCodeTable[nbSeq-1]; in ZSTD_encodeSequences_body()
317 unsigned const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); in ZSTD_encodeSequences_body()
319 BIT_addBits(&blockStream, sequences[nbSeq-1].offset, extraBits); in ZSTD_encodeSequences_body()
322 BIT_addBits(&blockStream, sequences[nbSeq-1].offset >> extraBits, in ZSTD_encodeSequences_body()
323 ofBits - extraBits); in ZSTD_encodeSequences_body()
325 BIT_addBits(&blockStream, sequences[nbSeq-1].offset, ofCodeTable[nbSeq-1]); in ZSTD_encodeSequences_body()
330 for (n=nbSeq-2 ; n<nbSeq ; n--) { /* intentional underflow */ in ZSTD_encodeSequences_body()
331 BYTE const llCode = llCodeTable[n]; in ZSTD_encodeSequences_body()
332 BYTE const ofCode = ofCodeTable[n]; in ZSTD_encodeSequences_body()
333 BYTE const mlCode = mlCodeTable[n]; in ZSTD_encodeSequences_body()
337 DEBUGLOG(6, "encoding: litlen:%2u - matchlen:%2u - offCode:%7u", in ZSTD_encodeSequences_body()
347 if (MEM_32bits() || (ofBits+mlBits+llBits >= 64-7-(LLFSELog+MLFSELog+OffFSELog))) in ZSTD_encodeSequences_body()
354 unsigned const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); in ZSTD_encodeSequences_body()
360 ofBits - extraBits); /* 31 */ in ZSTD_encodeSequences_body()
365 DEBUGLOG(7, "remaining space : %i", (int)(blockStream.endPtr - blockStream.ptr)); in ZSTD_encodeSequences_body()
384 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences_default()
385 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences_default()
386 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences_default()
402 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences_bmi2()
403 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences_bmi2()
404 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences_bmi2()
418 FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, in ZSTD_encodeSequences()
419 FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, in ZSTD_encodeSequences()
420 FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, in ZSTD_encodeSequences()
423 DEBUGLOG(5, "ZSTD_encodeSequences: dstCapacity = %u", (unsigned)dstCapacity); in ZSTD_encodeSequences()