JPEG and MPEG Image Compression
JPEG and MPEG Image Compression
After quantization, the dc-coefficient F(0,0) is followed by the 63 ac-coefficients that are ordered in a 2D matrix
in a zig-zag fashion according to their increasing frequency.
The dc-coefficients are then encoded using predictive coding, the rationale being that average gray levels of
adjacent 8x8 blocks (dc-coefficients) tend to be similar.
The last step of the sequential JPEG compression algorithm is entropy encoding.
o Two approaches are specified by the JPEG standard.
o The baseline system uses simple Huffman coding while the extended system uses arithmetic coding
and is suitable for a wider range of applications.
Sequential JPEG decompression uses all the steps described above in the reverse order. After entropy
decoding (Huffman or arithmetic), the symbols are converted into DCT coefficients and dequantized
where again, the Q(u,v) are quantization coefficients from the quantization table that is transmitted together
with the image data.
Finally, the inverse DCT transform is performed and the image gray values are shifted back to the interval [0,
(2^b)-1].
In Progressive JPEG Compression, a sequence of scans is produced, each scan containing a coded subset
of DCT coefficients.
A buffer is needed at the output of the quantizer to store all DCT coefficients of the entire image.
These coefficients are selectively encoded.
Three algorithms are defined as part of the JPEG progressive compression standard;
o progressive spectral selection
o progressive successive approximation
o combined progressive algorithm.
In the progressive spectral selection approach, the dc-coefficients are transmitted first, followed by groups of
low frequency and higher frequency coefficients.
In the progressive successive approximation, all DCT coefficients are sent first with lower precision and their
precision increases as additional scans are transmitted.
The combined progressive algorithm uses both of the above principles together.
Sequential Lossless JPEG Compression
The lossless mode of the JPEG compression uses a simple predictive compression algorithm and Huffman
coding to encode the prediction differences.
Hierarchical JPEG Compression
Using the hierarchical JPEG mode, decoded images can be displayed either progressively or at different
resolutions.
A pyramid of images is created and each lower resolution image is used as a prediction for the next higher
resolution pyramid level.
The three main JPEG modes can be used to encode the lower-resolution images - sequential DCT,
progressive DCT, or lossless.
In addition to still image JPEG compression, motion JPEG (MJPEG) compression exists that can be applied to
real-time full-motion applications.
However, MPEG compression represents a more common standard and is described below.
I-frames are self-contained and coded using a DCT-based compression method similar to JPEG.
Thus, I-frames serve as random access frames in MPEG frame streams.
While coding the I-frames is straightforward, coding of P- and B-frames incorporates motion estimation.
For every 16x16 block of P- or B-frames, one motion vector is determined for P- and forward or backward
predicted B-frames, two motion vectors are calculated for interpolated B-frames.
The motion estimation technique is not specified in the MPEG standard, however block matching techniques
are widely used generally following the matching approaches.
After the motion vectors are estimated, differences between the predicted and actual blocks are determined
and represent the error terms which are encoded using DCT.
As usually, entropy encoding is employed as the final step.
MPEG-1 decoders are widely used in video-players for multimedia applications and on the World Wide Web.