Skip to content

zooxyt/ulz77

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ulz77 -- A LZ77 Compression Library

A one source one header LZ77 Compression Library.

Theory

The LZ series of algorithm are basically some kind of methods to represent contents with a shorter sequence of bytes (such as a reference of an index and length of the recent buffer).

More details could be found at: https://en.wikipedia.org/wiki/LZ77_and_LZ78

Specification

Buffer size: 4096 Bytes

A matched will be encoded into at least 3 bytes

8 bits     4 bits           12 bits            7 bits          1 bit
sentinel + matched length + matched position + (extra length + extra sig) 

SENTINEL + 3 + 0 means source data is a SENTINEL

Matched length  Encoded value
3               reserved for sentinel
4               1
17              14
18              15, 1 | 0(no extra)

Features

  1. LZ77 encoding and decoding
  2. Stream support
  3. File compression/decompression support

Usage

Help info will be displayed by executing the following command:

$ ulz77 --help
usage : ulz77 [-options]

  --method   <method>       Specify interface of compression library
    [stream|file]
  -c         <sourcefile>   Input file
  -o         <destfile>     Output file
  -bs        <blocksize>    Specify block size of stream

  --help                    Show help info
  --version                 Show version info

License

GPLv3

About

A LZ77 Compression Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published