From ccae9ec8071adc973f9ec12db5bb4db927080090 Mon Sep 17 00:00:00 2001 From: Paul Cruz Date: Wed, 21 Jun 2017 17:43:21 -0700 Subject: [PATCH] added comment addressing use of bits in frame header descriptor --- tests/decodecorpus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index 2eed515fe..526ddf15b 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -314,6 +314,13 @@ static void writeFrameHeader(U32* seed, frame_t* frame, dictInfo info) pos += 4; { + /* + * fcsCode: 2-bit flag specifying how many bytes used to represent Frame_Content_Size (bits 7-6) + * singleSegment: 1-bit flag describing if data must be regenerated within a single continuous memory segment. (bit 5) + * contentChecksumFlag: 1-bit flag that is set if frame includes checksum at the end -- set to 1 below (bit 2) + * dictBits: 2-bit flag describing how many bytes Dictionary_ID uses -- set to 3 (bits 1-0) + * For more information: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_header + */ int const dictBits = info.useDict ? 3 : 0; BYTE const frameHeaderDescriptor = (BYTE) ((fcsCode << 6) | (singleSegment << 5) | (1 << 2) | dictBits); -- 2.47.2