01 Oct 2014 22:29:05 UTC
- Distribution: EBook-Tools
- Module version: v0.5.0
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- KwaliteeBus factor: 0
- License: gpl_2
- Perl: v5.10.1
- Activity24 month
- Download (708.63KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- CONSTRUCTOR AND INITIALIZATION
- BUGS AND LIMITATIONS
- LICENSE AND COPYRIGHT
EBook::Tools::LZSS - Lempel-Ziv-Storer-Szymanski compression and decompression
use EBook::Tools::LZSS; my $lzss = EBook::Tools::LZSS->new(lengthbits => 3, offsetbits => 14, windowinit => 'the man'); my $textref = $lzss->uncompress(\$data);
Instantiates a new EBook::Tools::LZSS object.
All arguments are optional, but must be identical between compression and decompression for the result to be valid.
The number of bits used to encode the length of a LZSS reference. If not specified defaults to 4 bits.
The eBookwise .IMP format typically compresses with 3 length bits.
Note that the actual length of the LZSS reference in bytes is greater than the value stored in the length bits. The actual number of bytes returned is the decoded length bits value plus
The number of bits used to encode the offset to a LZSS reference. This also determines the size of the sliding window of reference data. If not specified, it defaults to 12 bits (4096-byte window).
The eBookwise .IMP format typically compresses with 14 offset bits (16384-byte window).
A string used to initalize the sliding window. If specified, this string MUST be the same length as the window size, or the subroutine will croak. If not specified, the window will be initialized with spaces.
The first byte position in the window that will be overwritten by decoded text. If not specified, defaults to 0.
The maximum number of uncoded bytes (?). This currently isn't used for that purpose, but determines the actual length of a LZSS reference.
If set to true and the number of offset bits is greater than 8, then the offset bits will be read first in a chunk of 8 for the least significant bits, and then the remaining bits will be read and use as the most significant bits. This seems to be necessary for compatibility with Michael Dipperstein's LZSS C compression library but does not hold true for IMP e-book LZSS decompression.
If set to true, compression and uncompression will provide additional status feedback on STDOUT.
Takes a reference to a compressed data string, uncompresses the data string and returns a reference to the uncompressed string.
Compression not yet implemented.
The LZSS algorithm isn't documented in the POD.
Once compression is implemented and the algorithm is documented, this module is a good candidate for being forked off into its own project. Relying on it to keep its current name may be unwise.
Zed Pobre <email@example.com>
The design of this module was based on the C LZSS library by Michael Dipperstein, version 0.5.2, at http://michael.dipperstein.com/lzss/
Copyright 2008 Zed Pobre
Licensed to the public under the terms of the GNU GPL, version 2.