NAME
Data::BitStream::Code::Delta - A Role implementing Elias Delta codes
VERSION
version 0.01
DESCRIPTION
A role written for Data::BitStream that provides get and set methods for the Elias Delta codes. The role applies to a stream object.
METHODS
Provided Object Methods
- put_delta($value)
- put_delta(@values)
-
Insert one or more values as Delta codes. Returns 1.
- get_delta()
- get_delta($count)
-
Decode one or more Delta codes from the stream. If count is omitted, one value will be read. If count is negative, values will be read until the end of the stream is reached. In scalar context it returns the last code read; in array context it returns an array of all codes read.
Required Methods
- read
- write
- get_gamma
- put_gamma
- maxbits
-
These methods are required for the role.
SEE ALSO
- Peter Elias, "Universal codeword sets and representations of the integers", IEEE Trans. Information Theory 21(2), pp. 194-203, Mar 1975.
- Peter Fenwick, "Punctured Elias Codes for variable-length coding of the integers", Technical Report 137, Department of Computer Science, University of Auckland, December 1996
AUTHORS
Dana Jacobsen <dana@acm.org>
COPYRIGHT
Copyright 2011 by Dana Jacobsen <dana@acm.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.