DESCRIPTION
-----------
This archive contains a simple and readable ANSI C implementation of
Arithmetic coding and decoding.  This implementation is not intended to be
the best, fastest, smallest, or any other performance related adjective.

More information on Arithmetic encoding may be found at:
http://michael.dipperstein.com/arithmetic
http://www.datacompression.info/ArithmeticCoding.shtml

FILES
-----
arcode.c        - Library of Arithmetic encoding and decoding routines.
arcode.h        - Header containing prototypes for library functions.
bitfile.c       - Library to allow bitwise reading and writing of files.
bitfile.h       - Header for bitfile library.
COPYING         - Rules for copying and distributing LGPL software
getopt.c        - LGPL version of getopt source from GNU project
getopt.h        - LGPL version of getopt headers from GNU project
LICENSE         - GNU Lesser General Public License
Makefile        - makefile for this project (assumes gcc compiler and GNU make)
README          - this file
sample.c        - Demonstration of how to use Arithmetic library functions

BUILDING
--------
To build these files with GNU make and gcc:
1. Windows users should define the environment variable OS to be Windows or
   Windows_NT.  This is often already done.
2. Enter the command "make" from the command line.

The executable will be named sample (or sample.exe).

USAGE
-----
Usage: sample <options>

options:
  -c : Encode input file to output file.
  -d : Decode input file to output file.
  -i <filename> : Name of input file.
  -o <filename> : Name of output file.
  -a : Use adaptive model instead of static.
  -h|?  : Print out command line options.

-a      Compress/decompress using the adaptive model.  Data compressed using
        the adaptive model must be decompressed using the adaptive model.

-c      Generate a probability range list for the specified input file
        (see -i) and use arithmetic coding compresses the file to the
        specified output file (see -o).

-d      Decompresses the specified input file (see -i) writing the results to
        the specified output file (see -o).  Only files compressed by this
        program may be decompressed.

-i <filename>   The name of the input file.  There is no valid usage of this
                program without a specified input file.

-o <filename>   The name of the output file.  If no file is specified, stdout
                will be used.  NOTE: Sending compressed output to stdout may
                produce undesirable results.

HISTORY
-------
04/01/04  - Initial Release
08/13/04  - Added support for adaptive encoding
06/21/05  - Corrected BitFileGetBits/PutBits error that accessed an extra
            byte when given an integral number of bytes.
01/11/06  - Uses BitFileGetBitsIntBit and FilePutBitsInt for reading and
            writing the header.
            - This makes the code a little cleaner, but the new header is not
              compatible with the old header.


TODO
----
- Add support for higher order models.
- Provide dynamic link library (DLL) example.

AUTHOR
------
Michael Dipperstein (mdipper@alumni.engr.ucsb.edu)
