
	Copyright (C) Wickerhauser Consulting.  All Rights Reserved.
	Contains information proprietary to Wickerhauser Consulting.


		      WSQ Encoding Algorithm: Encoder 1
		      =================================

Open the input and output files
While there is input
	Determine the image size and any non-default parameters
	Test the input for WSQ compliance
	Re-allocate memory for input, transform, and output buffering
	Read the image pixels into the input/output buffer
	Convert to floating point values in the transform buffer

	Write an SOI marker to the output file
	Write a Comment with an input file identifier and a time stamp
	Write the DTT into the output file
	Write an SOF marker and the frame header parameters to the output file
	Perform the WSQ custom wavelet packet transform in place
	Determine the subband heights and widths
	Determine the variances of the ``middles'' of the subbands
	Choose an initial `quality' factor based on the desired compression
	LOOP:
	If any subbands have nonpositive bit allocations at this quality then
		Remove the nonpositively coded subbands
		Increase `quality' to take advantage of the extra bits 
		Go to LOOP
	Test the parameters for WSQ compliance
	Print the chosen parameters to the log file
	Write the DQT parameters
	Write the DHT parameters
	For all ECS blocks B
		Write the SOB header for block B, identifying its DHT
		Huffman-encode the WSQ symbols for block B using that DHT
		Write the entropy coded segment for block B
	Write an EOI marker segment
Close the input and output files


				Buffer Usage
				============

	Pixels in `bytes0[]'
		\
		wsqb2r()
		/
	Real Gray Values in `words0[]'
		\
		cbwp2()		-- transposition done in `words1[]'
		/
	Wavelet Coefficients in `words0[]'
		\
		wsqqnt()
		/
	Quantization Bin Indices in `words1[]'
		\
		wsqwsym()
		/
	WSQ symbols and literals in  `bytes0[]'
		\
		wsqwecs()
		/
	Entropy Coded Segments in `words0[]'



			   Input File Assumptions
			   ======================

Multiple files may be listed on the command line, but only one image may be
present in the input stream if this function is used as a filter.  Only one
interchange-format WSQ file will be produced, containing all the images.



			       Usage Help Page
			       ===============

Usage:  WSQ [options] [-ooutfile] [-llogfile] infile1 [ ... ]

Options:                                    (default is shown in parentheses)

 -v | -v0 | -v1 | -v2 | -v3 | -v4 :  set verbosity level.         (-v0)
   -v0: compress and log only fatal errors;
   -v1: like 0, but also logs warning messages;
   -v2: like 1, but also mentions normal events;
   -v3: like 2, but also logs parameter values (same as -v);
   -v4: like 3, but also logs WSQ subbands in ASCII.

 -d ==> debugging mode; write only messages to the log file.

 -rW,H ==> raw 8-bit grayscale input, width `W', height `H'.      (-r512,512)

 -c...text... ==> Include the text as a comment in the WSQ file.  (no comment)

 -SA,B ==> Use A (black) and B (white) for scanner calibrations.  (A=0, B=255)

 -Zr ==> Quantize to achieve a nominal r bits per pixel.          (r=0.75)

 -ooutfile ==> write output to the file `outfile.wsq'.            (stdout)

 -llogfile ==> log messages to `logfile.log'.                     (stderr)

 infile1 [...] ==> read input from these files in turn; use - to read stdin.

