package decompress
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=aa2e842dc009bcddcbb5c0791f5dbeee2bda5a104ecc7681aa37ac42537e3121
sha512=58e2529fa93f4f671ffd0a69c3542e835868f8c72db9c62b48d207c31f3585101d4d314f7e5922b273c86609b00c87343987b03b568d3e69749d2c7f7fa4089b
doc/decompress.de/De/Lz77/index.html
Module De.Lz77Source
The type for input sources. With a `Manual source the client must provide input with src. With `String or `Channel source the client can safely discard `Await case (with assert false).
The type for states.
literals s is frequencies of lengths and literals emitted by s since it was created.
distances s is frequencies of distances emitted by s since it was created.
src s i j l provides s with l bytes to read, starting at j in i. This byte range is read by calls to compress with s until `Await is returned. To signal the end of input call the function with l = 0.
compress s is:
`Awaitifshas a`Manualinput source and awits for more input. The client must usesrcto provide it.`Flushifsfilled completely the shared-queueq(given instate).Queue.junk_exnorQueue.pop_exncan be used to give some free cells tocompress.`Endifscompressed all input. Given shared-queueqis possibly not empty.
state src ~w ~q is an state that inputs from src and that outputs to q.
Window.
The client can constrain lookup operation by a window. Small window enforces compress to emit small distances. However, large window allows compress to go furthermore to recognize a pattern which can be expensive.
Level.
Lz77 has mainly 2 levels:
0where we only copy inputs to outpus, we don't do a lookupn(to9) with a certain configuration of the lookup. The higher the level, the longer it may take to find a pattern.
The 0 can be useful to only pack an input into a format such as DEFLATE - as an already compressed document such as a video or an image. Otherwise, 4 as the level is pretty common.