Initial implementation of trellis quantization

A new pass type trellis_pass is added. It defines a pass where trellis
quantization is done in the quantize_trellis() function.
Trellis quantization can be enabled by setting use_moz_defaults to 2 or
by using the -trellis option in cjpeg
Note that trellis does currently not work with scan optimization. Scan
optimization is disabled when trellis is enabled.
Add option to use flat quantization table

Set cinfo->use_flat_quant_tbl to TRUE to use flat quantization table or
-flat option in cjpeg
Add option to control lambda parameter from command line

-lambda1 and -lambda2 command line parameters are added to cjpeg to
control trellis quantization
Add parameters to cjpeg to tune for different metrics

-tune-psnr, -tune-ssim and -tune-hvs-psnr are added to cjpeg to control
the trellis quantization process and optimize output for PSNR, SSIM and
HVS-PSNR distortion metrics
Add option to use lambda weighting table

Different lambda values may be used for each frequency in DCT domain.
The weighting table is currently not configurable but can be
enabled/disabled with cinfo-> use_lambda_weight_tbl
Enable combination of trellis quantization and scan optimization
Add option to disable trellis quantization
Update trellis quantization to support progressive coding mode

Trellis quantization is modified:
- to work on the configurable spectral range Ss to Se
- to optionally optimize runs of EOBs
- to optionally split optimization between 2 spectral ranges
In trellis quantization passes Huffman table code optimization is
modified such as to generable a valid code length for each possible
symbol by resetting frequency counters to 1 instead of 0
Add option to perform multiple trellis quantization iterations

Multiple trellis iterations may improve coding performance as Huffman
tables are updated with each iteration. In practice the benefit appears
to be very minimal
Add option to tune for MS-SSIM

Added -tune-ms-ssim option to cjpeg to tune for multiscale SSIM metric
Add optimization of quantization matrix

Optimizes quantization matrix by minimizing reconstruction error based
on quantized coefficients.
Feature is controlled by cinfo->trellis_q_opt; disabled by default.
Fix issue when trellis is disabled

master->pass_number_scan_opt_base needs to be set to appropriate value
when trellis is disabled
Update trellis optimization parameters

Slightly improved parameters are provided when optimizing for SSIM
metric
Fix issue with quantization matrix optimization

Update quantization matrix in trellis loop
Modify trellis parameter defaults

Modify trellis parameters to optimize for PSNR-HVS by default
Revert type change

Revert type of use_moz_defaults to boolean
Remove outdated and incorrect comment
Improve cjpeg help text

List options related to trellis quantization in cjpeg help text
Fix issue with trellis and no scan opt

Disabling scan optimization with trellis enabled was leading to
incorrect results
Update copyright headers/statements