Transcript Chapter 1

SWE 423: Multimedia Systems
Chapter 7: Data Compression (4)
Outline
• JPEG
–
–
–
–
–
Introduction
JPEG Requirements
JPEG Modes and Procedure
JPEG 2000
JPEG LS
Introduction
• JPEG (Joint Photographic Experts Group) is the result of a
joint project between ISO and CCITT
– ISO (International Organization for Standardization)
• Founded in 1947
• An international standard-setting body composed of representatives from
national standards bodies.
– CCITT (Comité Consultatif International Téléphonique et
Télégraphique)
• i.e. International Telegraph and Telephone Consultative Committee
• Since 1992 onwards known as ITU-T (International Telecommunication
Union - ITU Telecommunication Standardization Sector)
– Under UN
• Developed many standards
– Group 3 and Group 4 protocols for sending faxes.
– V.34 and V.90 standards for sending and receiving data from full duplex fax
modems
• JPEG became an ISO standard in 1992.
Introduction
• JPEG applies to color and gray-scaled still images.
– Motion JPEG handles video sequences through a fast
coding and decoding of still images.
• Currently, implementations of parts of JPEG are
available as s/w only packages or using special
hardware support.
– Most products support the absolutely necessary
algorithms.
– The commercially available JPEG includes the base
mode with certain processing restrictions
JPEG Requirements
• These were put to ensure widespread distribution and
application of JPEG.
– Independence from image size
– Applicability to any image aspect ratio and any pixel aspect
ratio
– Independence of the color space and the number of colors
used
– Unlimited complexity of image content
– Currency regarding the compression factor and image
quality
– Platform independence of software solutions and major
complexity reductions for h/w solutions
– Support for sequential and progressive decoding
– Support for lossless hierarchical coding with different
resolutions
JPEG Modes
JPEG Modes
• JPEG defines four modes
– Lossy sequential DCT-based mode
• Must be supported by every JPEG decoder
– Expanded lossy DCT-based mode
• Provides a set of enhancements for the base mode
– Lossless mode
• Low compression ratio and perfect reconstruction of images
– Hierarchical mode
• Accommodates images of different resolutions by using
algorithms defined for the other three modes
JPEG: Image Preparation
• JPEG specifies a general image model that
can describe most commonly used still
image representations
• The mapping between coded color values
and the colors they represent is not coded
– Which requirements the above two properties
satisfy?
• An image consists of at least one and at
most N = 255 components or planes
JPEG: Image Preparation
• An image consists of at least one and at
most N = 255 components or planes
– Planes: RGB, YIQ, YUV
• Gray-scale images will consist of ......
• RGB color images will consist of ...
• YUV color images will consist of ...
JPEG: Image Preparation
JPEG: Image Preparation
• Each pixel is represented by p bits
–
–
–
–
Values in the range of ....
Lossy modes of JPEG use p = 8 or 12 bits/pixel
Lossless modes can use 2 to 12 bits/pixel.
Applications must conform to the standards
above (if needed, it must transform the image to
conform to the above)
JPEG: Image Preparation
• Compressed data includes values of X (maximum of all Xi’s)
and Y (maximum of all Yi’s) as well as factors Hi and Vi for
each plane representing the relative horizontal and vertical
resolutions with respect to the minimal horizontal and vertical
resolutions.
– Hi and Vi are integers ranging between 1 and 4
– Example: 512  512 image consisting of 3 planes with the following
factors:
• Plane 0: H0 = 4 and V0 = 1
• Plane 1: H1 = 2 and V1 = 2
• Plane 2: H2 = 1 and V2 = 1
leads to ....
• The image is divided into data units.
– Lossless mode: 1 pixel = 1 data unit
– Lossy mode: 8  8 pixels = 1 data unit (block)
• Consequence of DCT which always transforms connected blocks.
JPEG: Image Preparation
• Within each component, the data units are
processed from left to right, as shown below
(non-interleaved data ordering).
JPEG: Image Preparation
• Interleaved processing order of data units of
different components
JPEG: Lossy Sequential DCT Mode
JPEG: Lossy Sequential DCT Mode
• After image preparation, the uncompressed image samples are
grouped into data units of 8  8 pixels.
– The order is defined by the MCUs
• Each sample is encoded using p=8bit.
• Each pixel is an integer between 0 and 255
• Image processing is carried out as follows
– DCT-based transformation coding is carried out
• Pixel values are shifted into (-128, 127) interval
– A forward DCT (FDCT) is applied to each transformed pixel value
– For later reconstruction, the decoder uses the IDCT
– Note that if the FDCT and IDCT computations were exact, it would be
possible to reproduce the original 64 pixel values exactly. In practice,
precision is limited, and therefore, the technique is lossy.
• JPEG does not specify a standard precision. Therefore, two different decoders
may yield different images as output of the same compressed data.
JPEG: Lossy Sequential DCT Mode
• Image processing is followed by the
quantization of all DCT coefficients
– Lossy process.
– Specific frequencies can be given more
importance than others
– Tables are used for the quantization and
dequantization
• Must use the same tables for both processes
– Image quality may decrease due to quantization
JPEG: Lossy Sequential DCT Mode
JPEG: Lossy Sequential DCT Mode
• Quantization is followed by Entropy Encoding
(using Huffman Coding only)
– DC coefficients are encoded by subtracting the DC
coefficient of the previous data unit
• Since changes are little in DC values of neighboring data units,
the differences are stored instead of the values
– Huffman coding is chosen because it is free (not
patented)
– However, coding tables must be provided by the
application (one for DC and one for AC coefficients)
– AC-Coefficients are processed using the zig-zag
sequence
JPEG: Lossy Sequential DCT Mode
JPEG: Lossy Sequential DCT Mode
JPEG: Expanded Lossy DCT Mode
• Image preparation here differs from that of lossy
sequential using p = 12 instead of p = 8 bits per
pixel.
• The image processing step is analogue to that of
lossy sequential.
– JPEG also provides progressive coding, in addition to
sequential coding, where the first decoding run
produces a rough unsharp image that is refined during
successive runs.
– Arithmetic entropy coding can be used in addition to
Huffman coding in expanded lossy DCT-based mode.
JPEG: Expanded Lossy DCT Mode
JPEG: Lossless Mode
• Use predictive technique (as explained
earlier)
• One of eight
predictors is
selected.
JPEG: Hierarchical Mode
• The main feature here is the encoding of an image at different
resolutions.
– i.e. the compressed image contains images at several resolutions
• The process is done as follows
– The prepared image is reduced by a factor of 2n and compressed
– The original image is then reduced by a factor of 2n – 1 vertically and
horizontally. The previously compressed image is subtracted from this one
and the result is once again compressed
– This process repeats until the image with full resolution is compressed
• Can use both lossy DCT-based techniques or lossless compression
techniques
• Computationally intensive and requires considerable storage space.
• The advantage of this mode is that applications working with lower
resolution do not need to first decode the whole image and then reduce
the resolution.
JPEG 2000
• Features
– Provide better rate distortion tradeoff and subjective
image quality at low bitrates (e.g. for PDA devices)
– Provide lossless and lossy compression in a single
bitstream (e.g. different parts of the image gets coded
differently)
• Region of Interest Coding
– Allow image resolutions greater than 64k  64k
• It can handle 232 – 1.
– Provide a single decompression architecture
JPEG 2000
• Features (Cont.)
– Provide improved error-resilience for
transmission in noisy environments (e.g. wireless
networks)
– Provide scalable progressive transmission from
low to high bitrates without knowing the target
bitrate apriori
– Provide better performance on computergenerated imagery
– Provide metadata to be stored along with image
data
JPEG 2000
• Operates in two coding modes
– DCT-based
– Wavelet-based
• Embedded Block Coding with Optimized
Truncation (EBCOT), designed by Taubman
– Partition each subband (LL, LH, HL, HH) produced by the
Wavelet transform into small blocks (Code Blocks)
– Each block is encoded independent of other blocks
JPEG LS
• Specifically aimed at lossless encoding
• Part of a larger ISO effort aimed at better compression of
medical images
– Actually it is the current ISO/ITU standard for Lossless or “Near
Lossless” encoding
• Advantage of JPEG LS over 2000 is that it is based on a
low-complexity algorithm: Low Complexity Lossless
Compression for Images LoCo-I proposed by HP
• Exploits “Context Modeling”: taking advantage of the
structure in the input source
– Conditional probabilities of what pixel values follow from each
other in the image
JPEG LS
• LoCo-I consists of
– Prediction: predicting the value of the next
sample x using a causal template
– Context Determination: Determining the
context in which x occurs
– Residual Coding: Entropy coding of the
prediction residual conditioned by the context.
• When the residual is quantized, near-lossless
encoding is achieved where the reconstructed image
is far from the original image