Release Notes
Open Source Used In AsyncOS 8.8 for Cisco Web Security Appliances
92
"create" and "destroy" operations, but that isn't the real purpose of the
feature. Rather, reuse of an object provides support for abbreviated JPEG
datastreams. Object reuse can also simplify processing a series of images in
a single input or output file. This section explains these features.
A JPEG file normally contains several hundred bytes worth of quantization
and Huffman tables. In a situation where many images will be stored or
transmitted with identical tables, this may represent an annoying overhead.
The JPEG standard therefore permits tables to be omitted. The standard
defines three classes of JPEG datastreams:
* "Interchange" datastreams contain an image and all tables needed to decode
the image. These are the usual kind of JPEG file.
* "Abbreviated image" datastreams contain an image, but are missing some or
all of the tables needed to decode that image.
* "Abbreviated table specification" (henceforth "tables-only") datastreams
contain only table specifications.
To decode an abbreviated image, it is necessary to load the missing table(s)
into the decoder beforehand. This can be accomplished by reading a separate
tables-only file. A variant scheme uses a series of images in which the first
image is an interchange (complete) datastream, while subsequent ones are
abbreviated and rely on the tables loaded by the first image. It is assumed
that once the decoder has read a table, it will remember that table until a
new definition for the same table number is encountered.
It is the application designer's responsibility to figure out how to associate
the correct tables with an abbreviated image. While abbreviated datastreams
can be useful in a closed environment, their use is strongly discouraged in
any situation where data exchange with other applications might be needed.
Caveat designer.
The JPEG library provides support for reading and writing any combination of
tables-only datastreams and abbreviated images. In both compression and
decompression objects, a quantization or Huffman table will be retained for
the lifetime of the object, unless it is overwritten by a new table definition.
To create abbreviated image datastreams, it is only necessary to tell the
compressor not to emit some or all of the tables it is using. Each
quantization and Huffman table struct contains a boolean field "sent_table",
which normally is initialized to FALSE. For each table used by the image, the
header-writing process emits the table and sets sent_table = TRUE unless it is
already TRUE. (In normal usage, this prevents outputting the same table
definition multiple times, as would otherwise occur because the chroma
components typically share tables.) Thus, setting this field to TRUE before
calling jpeg_start_compress() will prevent the table from being written at
all.
If you want to create a "pure" abbreviated image file containing no tables,