Topic "compress"

COMPRESS		    Monash Image Library		COMPRESS

These routines provide means for compressing images. The i_encode, i_update
and i_decompress routines are for bitplane arithmetic encoding.

To use these routines, a context array of unsigned chars which has a length
equal to the number of bits in each pixel must be initialised to 1 unless
more knowledge concerning the probability distribution of the data is known.
observations should be set to 2 and final should always be 0 until the last
pixel is to be encoded.

After each pixel is encoded by i_encode and stored in the file outf,
i_update must be called to adjust the context and observation variables.

To decode a file generated i_encode, i_decode should be called once for
every pixel in the original image. The number of rows and columns in the
original image should be stored in the file name so that they can be
retrieved later. Once again, after each pixel is decoded, i_update must be
called.

i_pe and i_dpe are for calculating the prediction errors of images using the
standard Lossless JPEG predictors. These prediction values are wrapped from
the range of -256 to 256 to the range of -128 to 127 by subtracting 256 from
values greater than 127, and adding 256 to values less than -128. Because
the range of the actual pixel is 0 to 256, no information is lost in this
wrapping process, as the original value can still be determined. These
routines also work upon 16 bpp images.

Related Functions

idecode bitplane arithmetic decoding. bpp, context and observations are as per iencode. The file to be decoded is inf. i_update should be called after i_decode. i_decode returns the decoded bits.
idpe inverse prediction error transform for 8 and 16 bpp images
idpe12 inverse prediction error transform for 12 bpp images
idrl loads a run length encoded image of rowsxcols
iencode bitplane arithmetic encoding. bpp is the number of bits you are encoding. bits is the actual symbol to be encoded. The context array should be bpp long, and initialised to 1's unless more information is known. observations should be set to 2. Final should always be 0 until the last symbol is reached. The result will be placed in outf. After i_encode is called, i_update should be called to modify the contexts and observation counts. i_encode returns the number of bits encoded.
igraydecode convert image using Gray decoding (to correlate bit planes)
igrayencode convert image using Gray encoding (to correlate bit planes)
ipe prediction error transform for 8 and 16 bpp images
ipe12 prediction error transform for 12 bpp images
irl saves the image using rul length encoding to outfile
iupdate update bitplane context. This should be called after i_encode and i_decode.
iwh 8x8 Walsh-Hadamard Transform (out is 16 bpp)
iwh4 4x4 Walsh-Hadamard Transform (out is 16 bpp)
iwh4inverse Inverse 4x4 Walsh-Hadamard Transform (out is 16 bpp)
iwhinverse Inverse Walsh-Hadamard Transform (out is 16 bpp)

Other Topics

index | userguide | full | arithmetic | basic | binary | blocks | colour | compress | display | docs | fft | hist | image | io | makefile | masks | memory | misc | morph | pixel | rgb | stats | transform | error | mapping