PDL::Compression (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
PDL::Compression - compression utilitiesDESCRIPTION
These routines generally accept some data as aThe Rice algorithm, in particular, is designed to be identical to the
SYNOPSIS
use PDL::Compression ($b,$asize) = $a->rice_compress(); $c = $b->rice_expand($asize);
FUNCTIONS
METHODS
rice_compress
Signature: (in(n); [o]out(m); int[o]len(); lbuf(n); int blocksize)
Squishes an input
Multidimensional data are threaded over - each row is compressed separately, and the returned
Rice compression only works on integer data types --- if you have floating point data you must first quantize them.
The underlying algorithm is identical to the Rice compressor used in
The optional blocksize indicates how many samples are to be compressed as a unit; it defaults to 32.
How it works:
Rice compression is a subset of Golomb compression, and works on data sets where variation between adjacent samples is typically small compared to the dynamic range of each sample. In this implementation (originally written by Richard White and contributed to
Working on astronomical or solar image data, typical compression ratios of 2-3 are achieved.
$out = $pdl->rice_compress($blocksize); ($out, $len, $blocksize, $dim0) = $pdl->rice_compress; $new = $out->rice_expand;
rice_compress ignores the bad-value flag of the input piddles. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
rice_expand
Signature: (in(n); [o]out(m); lbuf(n); int blocksize)
Unsquishes a
($out, $len, $blocksize, $dim0) = $pdl->rice_compress; $copy = $out->rice_expand($dim0, $blocksize);
rice_expand ignores the bad-value flag of the input piddles. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.
AUTHORS
Copyright (C) 2010 Craig DeForest. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the fileThe Rice compression library is derived from the similar library in the
BUGS
- *
- Currently headers are ignored.
- *
- Currently there is only one compression algorithm.
TODO
- *
- Add object encapsulation
- *
-
Add test suite