Release Notes

Open Source Used In AsyncOS 8.8 for Cisco Web Security Appliances
90
Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL.
(This is the default setting selected by jpeg_read_header, but it is
probably NOT what you want for the first pass of progressive display!)
These methods offer successively better quality and lesser speed. However,
only the first method is available for quantizing in non-RGB color spaces.
IMPORTANT: because the different quantizer methods have very different
working-storage requirements, the library requires you to indicate which
one(s) you intend to use before you call jpeg_start_decompress(). (If we did
not require this, the max_memory_to_use setting would be a complete fiction.)
You do this by setting one or more of these three cinfo fields to TRUE:
enable_1pass_quantFixed color cube colormap
enable_external_quantExternally-supplied colormap
enable_2pass_quantTwo-pass custom colormap
All three are initialized FALSE by jpeg_read_header(). But
jpeg_start_decompress() automatically sets TRUE the one selected by the
current two_pass_quantize and colormap settings, so you only need to set the
enable flags for any other quantization methods you plan to change to later.
After setting the enable flags correctly at jpeg_start_decompress() time, you
can change to any enabled quantization method by setting two_pass_quantize
and colormap properly just before calling jpeg_start_output(). The following
special rules apply:
1. You must explicitly set cinfo.colormap to NULL when switching to 1-pass
or 2-pass mode from a different mode, or when you want the 2-pass
quantizer to be re-run to generate a new colormap.
2. To switch to an external colormap, or to change to a different external
colormap than was used on the prior pass, you must call
jpeg_new_colormap() after setting cinfo.colormap.
NOTE: if you want to use the same colormap as was used in the prior pass,
you should not do either of these things. This will save some nontrivial
switchover costs.
(These requirements exist because cinfo.colormap will always be non-NULL
after completing a prior output pass, since both the 1-pass and 2-pass
quantizers set it to point to their output colormaps. Thus you have to
do one of these two things to notify the library that something has changed.
Yup, it's a bit klugy, but it's necessary to do it this way for backwards
compatibility.)
Note that in buffered-image mode, the library generates any requested colormap
during jpeg_start_output(), not during jpeg_start_decompress().
When using two-pass quantization, jpeg_start_output() makes a pass over the
buffered image to determine the optimum color map; it therefore may take a
significant amount of time, whereas ordinarily it does little work. The
progress monitor hook is called during this pass, if defined. It is also
important to realize that if the specified target scan number is greater than
or equal to the current input scan number, jpeg_start_output() will attempt