DSP-based Bin Width Calculator for ADV601LC

The main difference  between  the  new DSP-based binwidth   calculator
(BWC) and  the  previous version    is  its reliance  on  the  subband
statistics instead of the feedback to achieve the required bit rate.

How It Works

In a nutshell, the job of the bin  width calculator is compute the set
of bin widths which satisfies two criteria at the same time:

-- Make ADV601LC  produce the compressed image  with as little visible
distortion as possible.

-- Make ADV601LC produce the compressed image of the required size/bit
rate, or at least as close to the required as possible.

To  achieve the first objective, the  BWC has the  ability to generate
various bin width sets for different quality levels.  In each of those
sets the distribution of distortions among the subbands fits the Human
Visual Model.

To achieve the  second objective, the BWC estimates  as best as it can
the resulting bit rate based on bin  width set (or quantization steps)
and the statistics set (subband energies).

The statistics part is important because even with a  fixed set of bin
widths  the resulting  bit  rate can  vary a  lot  from  one image  to
another. Indeed,  in quiet (low contrast and  few details)  images the
values in the subbands are small,  which means that the quantizer will
produce small values and lots of zeros. As a result, the bit rate will
be lower.  The opposite happens  in busy (high contrast, many details)
images: large  values  in the  subbands produce  large  values in  the
quantizer thus  requiring more  bits in   the Huffman  and Run  Length
coders. The statistics collected  from ADV601LC allows BWC to estimate
how busy the image  is and produce  more accurate estimates of the bit
rates. What remains is to find the bin width set whose estimate is the
closest to  the one requested by the  user. This is   done by a simple
binary search on the quality factor.

System Requirments

The program has been tested on AD2181 fixed point DSP processor.
