utl::BWTencoder Class Reference
[Data Compression]

BWT-based coder. More...

#include <BWTencoder.h>

Inheritance diagram for utl::BWTencoder:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 BWTencoder (uint_t mode, Stream *stream, bool owner=true, uint_t blockSize=K(256))
 Constructor.
virtual uint_t decode (byte_t *block, uint_t num)
 Decode data from the associated stream.
virtual uint_t encode (const byte_t *block, uint_t num)
 Encode data to the associated stream.
void start (uint_t mode, Stream *stream, bool owner=true, uint_t blockSize=K(256))
 Initialize for encoding or decoding.

Protected Member Functions

virtual void clear ()
 Revert to initial state.
virtual void finishEncoding ()
 Perform any necessary clean-up when encoding is finished.


Detailed Description

BWT-based coder.

BWTencoder is a block-sorting, lossless data compressor based on the Burrows-Wheeler Transform (BWT). bzip2 by Julian Seward is currently the most popular compressor based on the BWT. I have stolen some ideas (and even code!) from bzip2, and I've made it clear (with code comments) where I've done so. In fact, I have to admit that this implementation contains no original ideas or insights of my own. My goal here isn't research - I leave that to those who are best-suited for it. I've tried to provide a solid implementation that is:

I think I've achieved these goals. I'll leave it to you to decide if this implementation is a good choice for your application. The best I can do is be honest about the strengths and weaknesses.

Attributes

Advantages

Disadvantages

Research Papers

   M. Burrows and D. J. Wheeler
   "A block-sorting lossless data compression algorithm"
   SRC Research Report 124

Links

Author:
Adam McKee

Definition at line 76 of file BWTencoder.h.


Constructor & Destructor Documentation

utl::BWTencoder::BWTencoder ( uint_t  mode,
Stream stream,
bool  owner = true,
uint_t  blockSize = K(256) 
) [inline]

Constructor.

Parameters:
mode io_rd to encode, io_wr to decode (see io_t)
stream (optional) associated stream
owner (optional : true) owner flag for stream
blockSize (optional : 256 KB) block size

Definition at line 87 of file BWTencoder.h.

References utl::init().


Member Function Documentation

virtual uint_t utl::BWTencoder::decode ( byte_t block,
uint_t  num 
) [virtual]

Decode data from the associated stream.

Returns:
number of bytes decoded
Parameters:
block block to decode into
num size of block

Implements utl::Encoder.

virtual uint_t utl::BWTencoder::encode ( const byte_t block,
uint_t  num 
) [virtual]

Encode data to the associated stream.

Returns:
number of bytes encoded
Parameters:
block block to encode
num size of block

Implements utl::Encoder.

void utl::BWTencoder::start ( uint_t  mode,
Stream stream,
bool  owner = true,
uint_t  blockSize = K(256) 
)

Initialize for encoding or decoding.

Parameters:
mode io_rd to encode, io_wr to decode (see io_t)
stream (optional) associated stream
owner (optional : true) owner flag for stream
blockSize (optional : 256 KB) block size

virtual void utl::BWTencoder::clear (  )  [protected, virtual]

Revert to initial state.

Reimplemented from utl::Encoder.

virtual void utl::BWTencoder::finishEncoding (  )  [protected, virtual]

Perform any necessary clean-up when encoding is finished.

Reimplemented from utl::Encoder.


The documentation for this class was generated from the following file:

Generated on Tue May 26 16:53:23 2009 for libUTL++ by  doxygen 1.5.6