[comp.sys.next] JPEG Compression

madler@piglet.caltech.edu (Mark Adler) (11/15/90)

>> The author is treating the "compression" like a dirty word.
>> Compression need not decrease the quality of the image any.  It depends
>> on the type of compression.

Yes it depends, and to get the compression ratios we're talking about, you
certainly do not get back the original image bit-for-bit.  The C-Cube
chip has a user-selectable (approximate) compression ratio, and the higher
you set that ratio, the worse the image gets on decompression.  I have
played with the "A" version of the chip and I find that ratios of 20 or
so do not degrade the image very noticably.  (Which is quite impressive
if you think about it.)  This assumes that the image is a "typical natural
scene" without too much high-frequency stuff that a viewer might focus
on (like text).  The B version should be about the same---it simply
conforms to the pretty much finished JPEG compression standard.

JPEG compression uses every trick in the book (well not wavelets or
fractals) to get those ratios.  It breaks the image into 16x16 blocks
and does a discrete-cosine-transform on them.  This moves the high
frequency stuff to the lower right corner of the box.  Then the
information in the box is quantized (this is where information is lost)
and run-length encoded.

This process is done separately on the Y, U, and V channels of the
color image where Y is the luminance and U and V are the color-difference
signals.  U and V have half the resolution of the Y, so there is some
more information lost there in the conversion from RGB.

As a final note, JPEG is a standard for still images.  There is MPEG in
the works for moving pictures which compresses in the temporal direction
and gets even higher ratios.  It is similar to JPEG for the first frome,
but subsequent frames (about 10 or so) are changes from the first frame
with 16x16 blocks moving around.  This scheme still has problems, and a
tenatative standard may emerge in about a year.  It will be longer before
you see this in chips (there are some chips out now from LSI Logic, but
they're just to speed up the experimentation).

And there are other schemes, like wavelets and fractals, and who knows
what else is around the corner ...

Mark Adler
madler@piglet.caltech.edu