Skip to content

Perl package to manage bit streams, including a variety of integer coding methods

License

Notifications You must be signed in to change notification settings

danaj/BitStream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data-BitStream version 0.06
===========================

A Mouse/Moose class providing read/write access to bit streams.  This includes
many integer coding methods as well as straightforward ways to implement new
codes.

Bit streams are often used in data compression and in embedded products where
memory is at a premium.  While this Perl implementation may not be appropriate
for many of these applications (speed and Perl), it can be very useful for
prototyping and experimenting with different codes.

The Data::BitStream::XS module is also available, and is a near drop-in
replacement for this module, though it does not use Mouse/Moose.  The
Data::BitStream module will internally use the XS module if it is found, giving
a lot of the performance benefit without any other changes necessary.


SYNOPSIS

  use Data::BitStream;
  my $stream = Data::BitStream->new;
  $stream->put_gamma($_) for (1 .. 20);
  $stream->rewind_for_read;
  my @values = $stream->get_gamma(-1);

See the POD module documentation for examples and more information on all the
methods included.  There are also examples and benchmarks in the examples
directory in the distribution, including a functional lossless image codec.


INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install


DEPENDENCIES

This module requires these other modules and libraries:

  Test::More
  Mouse

It works identically with Moose instead of Mouse, but it's almost 2x slower.
Here are instructions and benchmarks for using Moo:
  https://gist.github.com/1259851
It shows how Mouse and Moose are completely interchangable, but Moo requires
incompatible changes to the module source.

I have tested this using perl versions 5.6.2, 5.8.0, 5.8.9, 5.10.1, 5.12.4,
5.14.1, and 5.15.2.

It works with Perl 5.6.2, with a caveat.  On 32-bit O/S, 64-bit Perl can have
broken arithmetic (two unequal 64-bit numbers will compare as equal).  We force
maxbits to 32 if it looks like it won't work with 64.


COPYRIGHT AND LICENCE

Copyright (C) 2011-2012 by Dana Jacobsen <[email protected]>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.1 or,
at your option, any later version of Perl 5 you may have available.

About

Perl package to manage bit streams, including a variety of integer coding methods

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages