Multimedia Systems Multimedia Systems Image III Image III (Image Compression, JPEG) (Image Compression, JPEG) Course Presentation Course Presentation (Image Compression, JPEG) (Image Compression, JPEG) Mahdi Amiri April 2013 Sharif University of Technology
35
Embed
Lec09, Image III (Compression, JPEG), v1.06.pptce.sharif.edu/courses/91-92/2/ce342-1/resources/root/Lectures/Lec0… · Block splitting and DCT Page 7 Multimedia Systems, MahdiAmiri,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Color space transformation: RGB to YCbCrThe representation of the colors in the image is converted from RGB to Y′CBCR, consisting of one luma component (Y'),
representing brightness, and two chroma components, (Cb and Cr), representing color. This step is sometimes skipped.
Chroma subsamplingThe resolution of the chroma data is reduced, usually by a factor of 2. This reflects the fact that the eye is less sensitive to fine color
details than to fine brightness details.
Block splitting and DCT
Multimedia Systems, Mahdi Amiri, Image IIIPage 7
Block splitting and DCTThe image is split into blocks of 8×8 pixels. For each block, each of the Y, Cb, and Cr data undergoes a discrete cosine transform
(DCT). A DCT is similar to a Fourier transform in the sense that it produces a kind of spatial frequency spectrum.
QuantizationThe amplitudes of the frequency components are quantized. Human vision is much more sensitive to small variations in color or
brightness over large areas than to the strength of high-frequency brightness variations. Therefore, the magnitudes of the high-
frequency components are stored with a lower accuracy than the low-frequency components. The quality setting of the encoder (for
example 50 or 95 on a scale of 0–100 in the Independent JPEG Group's library) affects to what extent the resolution of each
frequency component is reduced. If an excessively low quality setting is used, the high-frequency components are discarded
altogether.
Entropy CodingThe resulting data for all 8×8 blocks is further compressed with a lossless algorithm, a variant of Huffman encoding.
JPEGColor Space TransformationColor Space Transformation
RGB to YCbCr conversion concept:
The human eye is less sensitive to fine color (chrominance)
details than to fine brightness (luminance) details.
Analog TVAnalog TV
Multimedia Systems, Mahdi Amiri, Image IIIPage 11
Digital TVDigital TV
CbCb = B = B –– YY
Cr = R Cr = R -- YY
JPEG, Chroma SubsamplingSubsamplingSubsampling in in YCbCrYCbCr
Multimedia Systems, Mahdi Amiri, Image IIIPage 12
JPEGBlock Splitting and DCTBlock Splitting and DCT
Block splitting
The image is split into blocks of 8×8 pixels.
Later we discuss why this is done.
Discrete Cosine Transform (DCT)
Multimedia Systems, Mahdi Amiri, Image IIIPage 13
Discrete Cosine Transform (DCT)
Each 8×8 block of each component (Y, Cb, Cr) is
converted to a frequency-domain representation, using
a normalized, two-dimensional type-II discrete cosine
transform (DCT).
JPEG, DCTCenter Around ZeroCenter Around Zero
Multimedia Systems, Mahdi Amiri, Image IIIPage 14
The The 88××8 8 subsub--image shown image shown
in in 88--bit grayscalebit grayscale
JPEG, DCTFourier CoefficientsFourier Coefficients
Multimedia Systems, Mahdi Amiri, Image IIIPage 15
squaresquare--wave synthesized using Fourier cosine coefficients and sine coefficientswave synthesized using Fourier cosine coefficients and sine coefficients
DCTBasis FunctionsBasis Functions
The DCT transforms an 8×8 block of
input values to a linear combination
of these 64 patterns. The patterns are
referred to as the two-dimensional
DCT basis functions, and the output
Multimedia Systems, Mahdi Amiri, Image IIIPage 16
DCT basis functions, and the output
values are referred to as transform coefficients. The horizontal index is u
and the vertical index is v.
The The 88××8 8
subsub--imageimage
JPEG, DCTIllustration of DCTIllustration of DCT
Multimedia Systems, Mahdi Amiri, Image IIIPage 17
JPEG, DCTDCT CoefficientsDCT Coefficients
DC coefficient ( Top-left corner, has large magnitude )
AC coefficients ( Other 63 coefficients )
DCT aggregates most of the signal in one corner
Larger values in the top-left corner
Multimedia Systems, Mahdi Amiri, Image IIIPage 18
DCT coefficient for our sample block (rounded to the nearest two digits beyond the decimal point)DCT coefficient for our sample block (rounded to the nearest two digits beyond the decimal point)
JPEGDCT Coefficients, ExampleDCT Coefficients, Example
Multimedia Systems, Mahdi Amiri, Image IIIPage 19
The result of taking the DCT. The numbers in red are the The result of taking the DCT. The numbers in red are the
coefficients that fall below the specified threshold of coefficients that fall below the specified threshold of 1010..
JPEG, DCTHistograms of DCT CoefficientsHistograms of DCT Coefficients
Histograms of DCT Histograms of DCT
Coefficients of image Coefficients of image
‘‘lenalena’ using blocks of ’ using blocks of
88××8 8 pixelspixels
Multimedia Systems, Mahdi Amiri, Image IIIPage 20
JPEG, QuantizationConceptConcept
The human eye is good at seeing small
differences in brightness over a relatively large
area, but not so good at distinguishing the exact
strength of a high frequency brightness variation.