Home | History | Annotate | Download | only in educational_decoder

Lines Matching defs:literals

332 /// working down to lower more technical levels such as blocks, literals, and
351 // Decode the literals section of a block
353 u8 **const literals);
359 // Execute the decoded sequences on the literals block
361 const u8 *const literals,
366 // Copies literals and returns the total literal length that was copied
671 // Part 1: decode the literals block
672 u8 *literals = NULL;
673 const size_t literals_size = decode_literals(ctx, in, &literals);
680 // Part 3: combine literals and sequence commands to generate output
681 execute_sequences(ctx, out, literals, literals_size, sequences,
683 free(literals);
688 /******* LITERALS DECODING ****************************************************/
689 static size_t decode_literals_simple(istream_t *const in, u8 **const literals,
694 u8 **const literals,
702 u8 **const literals) {
703 // "Literals can be stored uncompressed or compressed using Huffman prefix
709 // Header is in charge of describing how literals are packed. It's a
723 // Raw or RLE literals block
724 return decode_literals_simple(in, literals, block_type,
727 // Huffman compressed literals
728 return decode_literals_compressed(ctx, in, literals, block_type,
733 /// Decodes literals blocks in raw or RLE form
734 static size_t decode_literals_simple(istream_t *const in, u8 **const literals,
764 *literals = malloc(size);
765 if (!*literals) {
771 // "Raw_Literals_Block - Literals are stored uncompressed."
773 memcpy(*literals, read_ptr, size);
777 // "RLE_Literals_Block - Literals consist of a single byte value repeated N times."
779 memset(*literals, read_ptr[0], size);
789 /// Decodes Huffman compressed literals
792 u8 **const literals,
831 *literals = malloc(regenerated_size);
832 if (!*literals) {
836 ostream_t lit_stream = IO_make_ostream(*literals, regenerated_size);
931 /******* END LITERALS DECODING ************************************************/
972 /// https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets
1052 // There are 3 symbol types : literals lengths, offsets and match lengths.
1075 // Literals lengths
1235 const u8 *const literals,
1239 istream_t litstream = IO_make_istream(literals, literals_len);
1260 // Copy any leftover literals
1272 // If the sequence asks for more literals than are left, the
1281 // Copy literals to output
1300 // literals length is 0. In this case, repeated offsets are
1459 // blocks. They are stored in following order : Huffman tables for literals,
1461 // literals lengths. It's finally followed by 3 offset values, populating