Skip to content

Commit 60ae6de

Browse files
committed
minor code doc update
1 parent daf8e8f commit 60ae6de

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/compress/zstd_compress.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7196,8 +7196,8 @@ size_t convertSequences_noRepcodes(
71967196
__m256i vadd = _mm256_add_epi32(vin, addition);
71977197

71987198
/* Check for long length */
7199-
__m256i cmp = _mm256_cmpgt_epi32(vadd, limit); // 0xFFFFFFFF for element > 65535
7200-
int cmp_res = _mm256_movemask_epi8(cmp);
7199+
__m256i ll_cmp = _mm256_cmpgt_epi32(vadd, limit); /* 0xFFFFFFFF for element > 65535 */
7200+
int ll_res = _mm256_movemask_epi8(ll_cmp);
72017201

72027202
/* Shuffle bytes so each half gives us the 8 bytes we need */
72037203
__m256i vshf = _mm256_shuffle_epi8(vadd, mask);
@@ -7228,7 +7228,7 @@ size_t convertSequences_noRepcodes(
72287228
* indices for lengths correspond to bits [4..7], [8..11], [20..23], [24..27]
72297229
* => combined mask = 0x0FF00FF0
72307230
*/
7231-
if (UNLIKELY((cmp_res & 0x0FF00FF0) != 0)) {
7231+
if (UNLIKELY((ll_res & 0x0FF00FF0) != 0)) {
72327232
/* long length detected: let's figure out which one*/
72337233
if (inSeqs[i].matchLength > 65535+MINMATCH) {
72347234
assert(longLen == 0);
@@ -7251,12 +7251,12 @@ size_t convertSequences_noRepcodes(
72517251

72527252
/* Handle leftover if @nbSequences is odd */
72537253
if (i < nbSequences) {
7254-
/* Fallback: process last sequence */
7254+
/* process last sequence */
72557255
assert(i == nbSequences - 1);
72567256
dstSeqs[i].offBase = OFFSET_TO_OFFBASE(inSeqs[i].offset);
7257-
/* note: doesn't work if one length is > 65535 */
72587257
dstSeqs[i].litLength = (U16)inSeqs[i].litLength;
72597258
dstSeqs[i].mlBase = (U16)(inSeqs[i].matchLength - MINMATCH);
7259+
/* check (unlikely) long lengths > 65535 */
72607260
if (UNLIKELY(inSeqs[i].matchLength > 65535+MINMATCH)) {
72617261
assert(longLen == 0);
72627262
longLen = i + 1;

lib/zstd.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,15 +1696,16 @@ ZSTD_compressSequences(ZSTD_CCtx* cctx,
16961696
* - Not compatible with frame checksum, which must be disabled
16971697
* - If any block is incompressible, will fail and return an error
16981698
* - @litSize must be == sum of all @.litLength fields in @inSeqs. Any discrepancy will generate an error.
1699-
* - the buffer @literals must have a size @litCapacity which is larger than @litSize by at least 8 bytes.
1699+
* - @litBufCapacity is the size of the underlying buffer into which literals are written, starting at address @literals.
1700+
* @litBufCapacity must be at least 8 bytes larger than @litSize.
17001701
* - @decompressedSize must be correct, and correspond to the sum of all Sequences. Any discrepancy will generate an error.
17011702
* @return : final compressed size, or a ZSTD error code.
17021703
*/
17031704
ZSTDLIB_STATIC_API size_t
17041705
ZSTD_compressSequencesAndLiterals(ZSTD_CCtx* cctx,
17051706
void* dst, size_t dstCapacity,
17061707
const ZSTD_Sequence* inSeqs, size_t nbSequences,
1707-
const void* literals, size_t litSize, size_t litCapacity,
1708+
const void* literals, size_t litSize, size_t litBufCapacity,
17081709
size_t decompressedSize);
17091710

17101711

0 commit comments

Comments
 (0)