]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added comment addressing use of bits in frame header descriptor
authorPaul Cruz <paulcruz74@fb.com>
Thu, 22 Jun 2017 00:43:21 +0000 (17:43 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Thu, 22 Jun 2017 00:43:21 +0000 (17:43 -0700)
tests/decodecorpus.c

index 2eed515fe2add0af98b9e08b4c13a635bff1f354..526ddf15b8d200e9b0db05325ebd3cbcd5453a60 100644 (file)
@@ -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);