Help for RICE_COMP

Purpose

MIPS VICAR based application to perform RICE Adaptive Variable-length
Coding on images, an algorithm developed by Robert F. Rice of JPL and
and implemented by Frank Rabe of the Technical University in Braunschweig, 
Germany for the Mars Pathfinder Lander IMP imaging system.

References

[1] Robert F. Rice, "Some Practical Universal Noiseless Coding Techniques, 
	Part III, Module PSI14,K+," JPL Publication 91-3, November 15, 1991.
[2] Chris Shinohara, "Imager for Mars Pathfinder Flight Software Compression
	Software Interface," University of Arizona, March 1994.
[3] Justin McNeill, "Proposed Keyword Names for Compressed/Decompressed Data
        for MIPS' Use", Interoffice Memorandum 384-94-017, February 8, 1994.
[4] Planetary Science Data Dictionary Document, JPL D-7116, Revision C, 
	November 20, 1992.
Execution

The command line call of this application is as follows:

RICE_COMP  INP="uncompressed image"  OUT="compressed image" ['VERBOSE]

The input image is any VICAR image of some perfect multiple of the 
compression block size, defined by the parameter BLOCKSIZE.

RICE Compressed Image Data Record Design

The compressed image data record is shown in the table below. Adjusting the
values of segment size (VICAR parameter SEGMTSIZE) will cause the length
of this record to change.  If all compressed blocks fit within one record,
then only one record of 875 bytes is generated, packed with zeroes.
A compressed image file may contain multiple records.

                Table of Compressed Image Record Format

        Byte    Description
        -----------------------------------------------------------

        1       Starting block number in image

        2-876   Variable number of compressed image blocks totaling
                less than 875 bytes
Property Label Keywords for Compressed Images


Below is a sample of a RICE COMPRESSED property label and following this
are definitions of keywords to be used in the image labels to describe 
the data compression.

************************************************************
        ************  File ramp.cmp ************
                3 dimensional IMAGE file
                File organization is BSQ
                Pixels are in BYTE format from a SUN-SOLR host
                1 bands
                1 lines per band
                352 samples per line
                0 lines of binary header
                0 bytes of binary prefix per line
---- Property: RICE COMPRESSED ----
ENCODING_MODE='LOSSLESS'
ENCODING_TYPE='Rice Adaptive Variable-length Coding (RICE)'
ENCODING_TYPE_DESCRIPTION=(
'This Rice Adaptive Variable-length Coding (RICE) uses predictive', 
'preprocessing and an adaptive variable-length coder to assign shorter', 
'code words to data values of higher probability and longer code words', 
'to data values of lesser probability. See Robert F. Rice "Some Practical', 
'Universal Noiseless Coding Techniques, Part III, Module PSI14,K+,"', 
'JPL Publication 91-3, November 15, 1991.')
IMAGE_LINES=32
IMAGE_LINE_SAMPLES=32
IMAGE_SAMPLE_BITS=8
BLOCKS=64
BLOCK_DIMENSIONS=(4, 4)
COMPRESSION_RATE=2.7421875
COMPRESSION_RATIO=2.909090909090909
SYNCHRONIZATION_INTERVAL=1024
START_OPTION=1
NUMBER_OF_OPTIONS=7
RECORDS=1
RECORD_BYTES=352
BLOCKS				(type INTEGER)
The total number of blocks used to spatially segment the image or data 
file prior to compression Blocks are rectangular areas of input. Each 
block of data is compressed separately. 

BLOCK_DIMENSIONS		(type INTEGER array of two elements)
The dimensions of a block for compression
The line dimension of the block is the first element of BLOCK_DIMENSIONS, 
followed by the sample dimension of the block.

COMPRESSION_RATE		(type DOUBLE PRECISION)
The average number of bits needed to represent a pixel or data number (DN) 
within a compressed image

COMPRESSION_RATIO		(type DOUBLE PRECISION)
The ratio in bytes of the original, uncompressed data file length to its 
compressed form. For example, a compression ratio of 5.00 means that on 
average, for every five bytes of input data, one byte of compressed data 
was generated by data compression.
ENCODING_MODE			(type CHARACTER ARRAY)
The mode of compression is either lossless or lossy, indicating the 
preservation or loss of information in the process of compression or encoding. 
For example, if the Discrete Cosine Transform is chosen with a selected 
quantizer, the encoding mode value would be LOSSY. The valid values are LOSSY 
or LOSSLESS.

ENCODING_TYPE			(type CHARACTER ARRAY)
The type of compression or encryption used for data storage
Contents of this value should be the full, unabbreviated, non-acronym name of 
coding or compression type. Examples of encoding types include but are not 
limited to Integer Cosine Transform (ICT), Block Truncation Coding (BTC), 
Discrete Cosine Transform (DCT), Joint Photographic Experts Group (JPEG) 
Standard DCT.

ENCODING_TYPE_DESCRIPTION	(type CHARACTER ARRAY)
Textual description of encoding type, which should include a reference to a 
journal paper, published text or some other publicly available, published 
material which definitively describes the encoding type.

IMAGE_LINES			(type INTEGER)
Total number of pixels along the vertical axis of the image prior to 
compression.
IMAGE_LINE_SAMLPES		(type INTEGER)
Total number of pixels along the horizontal axis of the image prior to
compression.

IMAGE_SAMPLE_BITS		(type INTEGER)
Indicates the store number of bits, or units of binary information,
contained in a IMAGE_LINE_SAMPLES value (uncompressed image bits per
pixel).

NUMBER_OF_OPTIONS 		(type INTEGER)
RICE compressor specific variable that has valid values between 2 and 
(data precision - start_option + 1).

RECORDS				(type INTEGER)
Total number of records containing compressed image blocks.
RECORD_BYTES			(type INTEGER array of "RECORDS" elements)
A array where each element contains the total number of bytes in each
record of compressed image block data.

START_OPTION			(type INTEGER)
RICE compressor specific variable that has valid values between 0 and
the data precision of pixels.

SYNCHRONIZATION_INTERVAL	(type INTEGER)
Total number of compressed blocks between sync counters.
History

Date written: 		July 1994
Platforms: 		VICAR portable software running on 
			Sun OS 4.1.3,Sun Solaris, and the SGI.
Revisions:		Original
Traceability:		MESUR Pathfinder Capabilities by Phase, D-11518.
			J. Wright, S. Roberts, February 1994.

Cognizant MIPS Engineer

Justin McNeill

Jet Propulsion Laboratory
MS 168-414
4800 Oak Grove Drive
Pasadena, California 91109

Phone:	818-354-7975
FAX:	818-393-6962
Email:	jfm@poconos.jpl.nasa.gov
Cognizant Mars Pathfinder Engineer

Frank Rabe
Technical University Braunschweig
IDA Institut fuer Dataenvaerarbeitungsanlagen
Hans-Sommer-Strausse 66
38106 Braunschweig Germany

Phone:	49-532-391-3742
FAX:	49-531-391-4587
Email:	rabe@ida.ing.tu-bs.de

PARAMETERS:


INP

Uncompressed VICAR image to be compressed.

OUT

VICAR file of packed compressed images

SYNCINTRV

Number of compressed blocks stored between synchronization counter increments.

BLOCKSIZE

Number of pixels per block

SEGMTSIZE

Maximum number of compressed bytes per record.

FLAG

VERBOSE keyword to print details of compression to std. output Default is NONE.

See Examples:


Cognizant Programmer: