SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
MULTIMEDIA
COMMUNICATIONS
Image Compression-JPEG
BY: Dr. KAPIL GUPTA
Associate Professor
MMEC, MMU, Mullana
2
Digitized pictures
• The amount of memory required to store and
display digitized picture ranged from 307kbytes
through to 2.4Mbytes .
• This would result in unacceptably long delays in
most interactive applications that involve low bit
rate networks.
• The most widely adopted standard relating to the
compression of digitized pictures has been
developed by an international standards body
known as the “Joint Photography Experts Group”
JPEG.
JPEG
• JPEG is defined in the International Standard IS 10918.
• The standard defines a range of different compression
modes, each of which is intended for use in a particular
application domain.
• Lossy Sequential Mode/Baseline Mode is intended for
the compression of both monochromatic and color
digitized pictures/images as used in multimedia
communication applications.
• There are five main stages associated with this mode:
image/block preparation, forward DCT, quantization,
entropy encoding, and frame building.
4
JPEG Encoder schematic
5
Image/Block Preparation
• Once the source image format has been selected
and prepared, the set of values in each matrix are
compressed separately using the DCT.
• Before performing DCT, a second step known as
“ Block preparation” carried out.
• It would be too time consuming to compute the
DCT of the total matrix in a single step so each
matrix is first divided into set of smaller 8 × 8
sub-matrics as a block.
• These are then fed sequentially to the DCT which
transform each block separately.
6
7
Forward DCT
• Each pixel value is quantized using 8 bits which
produces a value in the range 0 to 255 for the
intensity/luminance values-R,G,B or Y - and a
value in the range -128 to +127 for the two
chrominance values-Cb and Cr
• All the values are first centered around zero by
subtracting 128
• The input 2-D matrix is represented by :P[x,y]
and the transformed matrix by F[i, j]
• The DCT of each 8x8 block of values is computed using
the expression:
• Where C(i) and C(j) =1/√2 for i, j=0
= 1 for all other value of i and j ;
and x, y, i and j all vary from 0 through 7.
We can deduce a number of points by considering the
expression above:
1. All 64 values in the input matrix, P[x,y] contribute to each
entry in the transformed matrix, F[i,j].
2. for i=j=0, the two cosine terms are both 0. It is the
mean of all 64 values in the matrix and is known
as the DC coefficient.
3. All other locations of the transformed matrix have
a frequency coefficient associated with them-they
are known as AC coefficient.
4. For j=0, only horizontal frequency coefficient
are present which increase in frequency for i=1-7.
5. For i=0, only vertical frequency coefficient are
present which increase in frequency for j=1-7.
6. In all other locations in the transformed matrix,
both horizontal and vertical frequency coefficient
are present to varying degrees.
10
DCT computation features.
11
Quantization
The human eye responds primarily to the DC
coefficient and the lower spatial frequency
coefficients.
• If the magnitude of a higher frequency coefficient
is below a certain threshold, the eye will not
detect it.
• This property is exploited in the Quantization
phase by dropping-in practice, setting to zero-
those spatial frequency coefficients in the
transformed matrix whose amplitudes are less
than a defined threshold value.
12
Quantization
• The quantization process aims to reduce the size
of the DC and AC coefficients so that less
bandwidth is required for their transmission.
• A division operation is performed using the
defined threshold value as the divisor.
• If the resulting quotient is zero, the coefficient is
less than the threshold value.
• while if it is non-zero, this indicates the number
of times the coefficient is greater than the
threshold rather than the absolute value.
• The quantization table with the threshold value to
be used with a particular DCT coefficient in the
corresponding position in the matrix.
• The choice of threshold values is a compromise
between the level of compression that is required
and the resulting amount of information loss that is
acceptable.
• The JPEG standard includes two default
quantization table values-one for use with the
luminance coefficients and the other for use with
the two sets of chrominance coefficients.
14
Example computation of a set of quantized DCT
coefficients.
15
• An example set of threshold values is given in the
quantization table, together with a set of DCT
coefficient and their corresponding quantized values.
it can conclude a number of points:
• The computation of the quantized coefficients
involves rounding the quotients to the nearest integer
value.
• The threshold values used, increase in magnitude
with increasing spatial frequency.
• The DC coefficient in the transformed matrix is
largest.
• Many of the higher-frequency coefficients are zero.
16
• Entropy Encoding
The entropy encoding stage comprises four steps: vectoring,
differential encoding, run-length encoding, and Huffman
encoding
• Vectoring
The o/p of the quantization stage is a 2-D matrix of values. We
must first represent the values in the form of a single- dimension
vector as vectoring.
• Zig-zag scan
- the DC coefficient and lower-frequency AC coefficients-both
horizontal and vertical-are scanned first.
- All the higher-frequency coefficients are in a sequential order so
making his form of representation more suitable for compression.
17
Vectoring using a zig-zag scan:
(a) principle (b) vector
18
• Differential encoding applied to the DC
coefficient only.
• the first element in each transformed block is the
DC coefficient which is a measure of the average
color/luminance/chrominance associated with the
corresponding 8x8 block of pixel values.
• the DC coefficient varies only slowly from one
block to the next
• the most efficient type of compression is
differential encoding since this encodes only the
difference between each pair of values.
• for example, if the sequence of DC coefficients in
consecutive quantized blocks-one per block –was:
12, 13, 11, 11, 10, …
19
• the corresponding difference values would be :
12, 1, -2, 0, -1, …
• the first difference value always being encoded
relative to zero. the difference values are then
encoded in the form (SSS,value)
• the SSS field indicates the number of bits needed to
encode the value
• the value field the actual bits that represent the value.
20
• The number of bits required to encode each value
is determined by its magnitude.
• a positive value is then encoded using the
unsigned binary form and a negative value by the
complement of this.
22
Run-length encoding
• The remaining 63 values in the vector are the AC
coefficients. These coefficients are encoded in the
form of a string of pairs of values.
• Each pair is made up of (skip, value) where skip
is the number of zeros in the run and value the
next non-zero coefficient.
• Previous Figure would be encoded as:
(0,6) (0,7)(0,3)(0,3) (0,3) (0,2)(0,2)(0,2)(0,2)(0,0)
• Final pair (0,0) indicates the end of the string for
this block and that all the remaining coefficients
in the block are zero
23
Huffman encoding
• Significant levels of compression can be obtained
by replacing long string of binary digits by a
string of much shorter codewords.
• The length of each codeword being a function of
its relative frequency of occurrence .
• A table of codewords is used with the set of
codewords pre-computed using the huffman
coding algorithm.
• The same approach is used to encode the output
of both the differential and run-length encoders.
24
Frame building
• The compressed version of a printed picture- is
stored in the memory of a computer ready for
either integrating with other media if necessary or
accessing from a remote computer.
• The JPEG standard, also includes a definition of
the structure of the total bit stream relating to a
particular image/picture. This is known as frame.
• The frame builder is to encapsulate all the
information relating to an encoded image/picture
in this format.
25
JPEG encoder output bit stream format
• The role of the frame builder is to encapsulate all
the information relating to an encoded
image/picture in this format.
• The frame header contains a number of fields that
include:
1. the overall width and height of the image in
pixels.
2. the number and type of components that are
used to represent the image (CLUT,R/G/B,
Y/Cb/Cr);
3. the digitization format used.
• A frame consists of a number of components each
of which is known as a scan.
• These are also preceded by a header which contains
fields that include:
• The identity of the components (R/G/B) etc.
• The number of bits used to digitize each component;
• The quantization table of values that have been used to
encode each component.
• Each scan comprises one or more segments each of
which can contain a group of 8x8 blocks preceded by a
header.
• This contains the Huffman table of values that have
been used to encode each block in the segment should
the default table not be used.
• Each complete frame contains all the information
necessary to enable the JPEG decoder to identify each
field in a received frame and then perform the
corresponding decoding operation.
28
JPEG decoding
• A JPEG decoder is made up of a number of stages
which are simply the corresponding decoder sections of
those used in the encoder.
• On receipt of the encoded bitstream the frame decoder
first identifies the control information and tables within
the various headers.
• It then load the content of each table into the related
table and passes the control information to the image
builder.
• The huffman decoder decompressed the compressed
bitstream by using preloaded table of codewords.
• The two decompressed streams containing the DC and
AC coefficients of each block are then passed to the
differential and run-length decoders respectively.
• The resulting matrix of values is then dequantized using
either the default or the preloaded values in the
quantization table.
• Each resulting block of 8x8 spatial frequency
coefficients is passed to the inverse DCT which
transforms them back into their spatial form.
• The image builder then reconstructs the original image
from these blocks using the control information passed
to it by the frame decoder.
• Compression ratio is 20:1 for the pictures whose
content is relatively simple-that is, have relatively few
color transitions.
• For more complicated picture the compression ratio is
10:1.
Reference
• Fred Halsall “ Multimedia Communications
Applications, Networks, Protocols and
Standards”

Weitere ähnliche Inhalte

Was ist angesagt?

video compression techique
video compression techiquevideo compression techique
video compression techique
Ashish Kumar
 
Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression technique
Priyanka Pachori
 

Was ist angesagt? (20)

MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standard
 
Image compression .
Image compression .Image compression .
Image compression .
 
Lossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image ProcessingLossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image Processing
 
Data compression
Data compressionData compression
Data compression
 
MPEG-1 Part 2 Video Encoding
MPEG-1 Part 2 Video EncodingMPEG-1 Part 2 Video Encoding
MPEG-1 Part 2 Video Encoding
 
Bit plane coding
Bit plane codingBit plane coding
Bit plane coding
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Chapter 10 - Multimedia Over Atm
Chapter 10 - Multimedia Over AtmChapter 10 - Multimedia Over Atm
Chapter 10 - Multimedia Over Atm
 
Data compression
Data compressionData compression
Data compression
 
video compression techique
video compression techiquevideo compression techique
video compression techique
 
Chapter 3 - Multimedia System Design
Chapter 3 - Multimedia System DesignChapter 3 - Multimedia System Design
Chapter 3 - Multimedia System Design
 
Video compression
Video compressionVideo compression
Video compression
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
H263.ppt
H263.pptH263.ppt
H263.ppt
 
Compression
CompressionCompression
Compression
 
Image compression models
Image compression modelsImage compression models
Image compression models
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression models
 
Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression technique
 
Subband Coding
Subband CodingSubband Coding
Subband Coding
 
Audio and Video Compression
Audio and Video CompressionAudio and Video Compression
Audio and Video Compression
 

Ähnlich wie Multimedia communication jpeg

CyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdfCyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdf
MohammadAzreeYahaya
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
Zaabir Ali
 

Ähnlich wie Multimedia communication jpeg (20)

Jpeg
JpegJpeg
Jpeg
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
 
Image compression Algorithms
Image compression AlgorithmsImage compression Algorithms
Image compression Algorithms
 
JPEG
JPEGJPEG
JPEG
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)
 
SOC Application Studies: Image Compression
SOC Application Studies: Image CompressionSOC Application Studies: Image Compression
SOC Application Studies: Image Compression
 
Jpeg standards
Jpeg   standardsJpeg   standards
Jpeg standards
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction system
 
Pipelined Architecture of 2D-DCT, Quantization and ZigZag Process for JPEG Im...
Pipelined Architecture of 2D-DCT, Quantization and ZigZag Process for JPEG Im...Pipelined Architecture of 2D-DCT, Quantization and ZigZag Process for JPEG Im...
Pipelined Architecture of 2D-DCT, Quantization and ZigZag Process for JPEG Im...
 
Mmclass4
Mmclass4Mmclass4
Mmclass4
 
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
PIPELINED ARCHITECTURE OF 2D-DCT, QUANTIZATION AND ZIGZAG PROCESS FOR JPEG IM...
 
MDCT audio coding with pulse vector quantizers
MDCT audio coding with pulse vector quantizersMDCT audio coding with pulse vector quantizers
MDCT audio coding with pulse vector quantizers
 
Data compression
Data compressionData compression
Data compression
 
B070306010
B070306010B070306010
B070306010
 
CyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdfCyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdf
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
 
I3602061067
I3602061067I3602061067
I3602061067
 
FPGA based JPEG Encoder
FPGA based JPEG EncoderFPGA based JPEG Encoder
FPGA based JPEG Encoder
 
Gsm Soft Viterbi Code
Gsm Soft Viterbi CodeGsm Soft Viterbi Code
Gsm Soft Viterbi Code
 

Mehr von Dr. Kapil Gupta (7)

Research Methodology & IPR-I
Research Methodology & IPR-IResearch Methodology & IPR-I
Research Methodology & IPR-I
 
Research Methodology & IPR-II
Research Methodology & IPR-IIResearch Methodology & IPR-II
Research Methodology & IPR-II
 
Current mirror-A constant current circuit
Current mirror-A constant current circuitCurrent mirror-A constant current circuit
Current mirror-A constant current circuit
 
RSA Algoritmn
RSA AlgoritmnRSA Algoritmn
RSA Algoritmn
 
Sampling theorem
Sampling theorem Sampling theorem
Sampling theorem
 
Symmetric Encryption Techniques
Symmetric Encryption Techniques Symmetric Encryption Techniques
Symmetric Encryption Techniques
 
Chapter 1 Introduction of Cryptography and Network security
Chapter 1 Introduction of Cryptography and Network security Chapter 1 Introduction of Cryptography and Network security
Chapter 1 Introduction of Cryptography and Network security
 

Kürzlich hochgeladen

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 

Kürzlich hochgeladen (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 

Multimedia communication jpeg

  • 1. MULTIMEDIA COMMUNICATIONS Image Compression-JPEG BY: Dr. KAPIL GUPTA Associate Professor MMEC, MMU, Mullana
  • 2. 2 Digitized pictures • The amount of memory required to store and display digitized picture ranged from 307kbytes through to 2.4Mbytes . • This would result in unacceptably long delays in most interactive applications that involve low bit rate networks. • The most widely adopted standard relating to the compression of digitized pictures has been developed by an international standards body known as the “Joint Photography Experts Group” JPEG.
  • 3. JPEG • JPEG is defined in the International Standard IS 10918. • The standard defines a range of different compression modes, each of which is intended for use in a particular application domain. • Lossy Sequential Mode/Baseline Mode is intended for the compression of both monochromatic and color digitized pictures/images as used in multimedia communication applications. • There are five main stages associated with this mode: image/block preparation, forward DCT, quantization, entropy encoding, and frame building.
  • 5. 5 Image/Block Preparation • Once the source image format has been selected and prepared, the set of values in each matrix are compressed separately using the DCT. • Before performing DCT, a second step known as “ Block preparation” carried out. • It would be too time consuming to compute the DCT of the total matrix in a single step so each matrix is first divided into set of smaller 8 × 8 sub-matrics as a block. • These are then fed sequentially to the DCT which transform each block separately.
  • 6. 6
  • 7. 7 Forward DCT • Each pixel value is quantized using 8 bits which produces a value in the range 0 to 255 for the intensity/luminance values-R,G,B or Y - and a value in the range -128 to +127 for the two chrominance values-Cb and Cr • All the values are first centered around zero by subtracting 128 • The input 2-D matrix is represented by :P[x,y] and the transformed matrix by F[i, j]
  • 8. • The DCT of each 8x8 block of values is computed using the expression: • Where C(i) and C(j) =1/√2 for i, j=0 = 1 for all other value of i and j ; and x, y, i and j all vary from 0 through 7. We can deduce a number of points by considering the expression above: 1. All 64 values in the input matrix, P[x,y] contribute to each entry in the transformed matrix, F[i,j].
  • 9. 2. for i=j=0, the two cosine terms are both 0. It is the mean of all 64 values in the matrix and is known as the DC coefficient. 3. All other locations of the transformed matrix have a frequency coefficient associated with them-they are known as AC coefficient. 4. For j=0, only horizontal frequency coefficient are present which increase in frequency for i=1-7. 5. For i=0, only vertical frequency coefficient are present which increase in frequency for j=1-7. 6. In all other locations in the transformed matrix, both horizontal and vertical frequency coefficient are present to varying degrees.
  • 11. 11 Quantization The human eye responds primarily to the DC coefficient and the lower spatial frequency coefficients. • If the magnitude of a higher frequency coefficient is below a certain threshold, the eye will not detect it. • This property is exploited in the Quantization phase by dropping-in practice, setting to zero- those spatial frequency coefficients in the transformed matrix whose amplitudes are less than a defined threshold value.
  • 12. 12 Quantization • The quantization process aims to reduce the size of the DC and AC coefficients so that less bandwidth is required for their transmission. • A division operation is performed using the defined threshold value as the divisor. • If the resulting quotient is zero, the coefficient is less than the threshold value. • while if it is non-zero, this indicates the number of times the coefficient is greater than the threshold rather than the absolute value.
  • 13. • The quantization table with the threshold value to be used with a particular DCT coefficient in the corresponding position in the matrix. • The choice of threshold values is a compromise between the level of compression that is required and the resulting amount of information loss that is acceptable. • The JPEG standard includes two default quantization table values-one for use with the luminance coefficients and the other for use with the two sets of chrominance coefficients.
  • 14. 14 Example computation of a set of quantized DCT coefficients.
  • 15. 15 • An example set of threshold values is given in the quantization table, together with a set of DCT coefficient and their corresponding quantized values. it can conclude a number of points: • The computation of the quantized coefficients involves rounding the quotients to the nearest integer value. • The threshold values used, increase in magnitude with increasing spatial frequency. • The DC coefficient in the transformed matrix is largest. • Many of the higher-frequency coefficients are zero.
  • 16. 16 • Entropy Encoding The entropy encoding stage comprises four steps: vectoring, differential encoding, run-length encoding, and Huffman encoding • Vectoring The o/p of the quantization stage is a 2-D matrix of values. We must first represent the values in the form of a single- dimension vector as vectoring. • Zig-zag scan - the DC coefficient and lower-frequency AC coefficients-both horizontal and vertical-are scanned first. - All the higher-frequency coefficients are in a sequential order so making his form of representation more suitable for compression.
  • 17. 17 Vectoring using a zig-zag scan: (a) principle (b) vector
  • 18. 18 • Differential encoding applied to the DC coefficient only. • the first element in each transformed block is the DC coefficient which is a measure of the average color/luminance/chrominance associated with the corresponding 8x8 block of pixel values. • the DC coefficient varies only slowly from one block to the next • the most efficient type of compression is differential encoding since this encodes only the difference between each pair of values. • for example, if the sequence of DC coefficients in consecutive quantized blocks-one per block –was: 12, 13, 11, 11, 10, …
  • 19. 19 • the corresponding difference values would be : 12, 1, -2, 0, -1, … • the first difference value always being encoded relative to zero. the difference values are then encoded in the form (SSS,value) • the SSS field indicates the number of bits needed to encode the value • the value field the actual bits that represent the value.
  • 20. 20
  • 21. • The number of bits required to encode each value is determined by its magnitude. • a positive value is then encoded using the unsigned binary form and a negative value by the complement of this.
  • 22. 22 Run-length encoding • The remaining 63 values in the vector are the AC coefficients. These coefficients are encoded in the form of a string of pairs of values. • Each pair is made up of (skip, value) where skip is the number of zeros in the run and value the next non-zero coefficient. • Previous Figure would be encoded as: (0,6) (0,7)(0,3)(0,3) (0,3) (0,2)(0,2)(0,2)(0,2)(0,0) • Final pair (0,0) indicates the end of the string for this block and that all the remaining coefficients in the block are zero
  • 23. 23 Huffman encoding • Significant levels of compression can be obtained by replacing long string of binary digits by a string of much shorter codewords. • The length of each codeword being a function of its relative frequency of occurrence . • A table of codewords is used with the set of codewords pre-computed using the huffman coding algorithm. • The same approach is used to encode the output of both the differential and run-length encoders.
  • 24. 24 Frame building • The compressed version of a printed picture- is stored in the memory of a computer ready for either integrating with other media if necessary or accessing from a remote computer. • The JPEG standard, also includes a definition of the structure of the total bit stream relating to a particular image/picture. This is known as frame. • The frame builder is to encapsulate all the information relating to an encoded image/picture in this format.
  • 25. 25 JPEG encoder output bit stream format
  • 26. • The role of the frame builder is to encapsulate all the information relating to an encoded image/picture in this format. • The frame header contains a number of fields that include: 1. the overall width and height of the image in pixels. 2. the number and type of components that are used to represent the image (CLUT,R/G/B, Y/Cb/Cr); 3. the digitization format used. • A frame consists of a number of components each of which is known as a scan.
  • 27. • These are also preceded by a header which contains fields that include: • The identity of the components (R/G/B) etc. • The number of bits used to digitize each component; • The quantization table of values that have been used to encode each component. • Each scan comprises one or more segments each of which can contain a group of 8x8 blocks preceded by a header. • This contains the Huffman table of values that have been used to encode each block in the segment should the default table not be used. • Each complete frame contains all the information necessary to enable the JPEG decoder to identify each field in a received frame and then perform the corresponding decoding operation.
  • 29. • A JPEG decoder is made up of a number of stages which are simply the corresponding decoder sections of those used in the encoder. • On receipt of the encoded bitstream the frame decoder first identifies the control information and tables within the various headers. • It then load the content of each table into the related table and passes the control information to the image builder. • The huffman decoder decompressed the compressed bitstream by using preloaded table of codewords. • The two decompressed streams containing the DC and AC coefficients of each block are then passed to the differential and run-length decoders respectively.
  • 30. • The resulting matrix of values is then dequantized using either the default or the preloaded values in the quantization table. • Each resulting block of 8x8 spatial frequency coefficients is passed to the inverse DCT which transforms them back into their spatial form. • The image builder then reconstructs the original image from these blocks using the control information passed to it by the frame decoder. • Compression ratio is 20:1 for the pictures whose content is relatively simple-that is, have relatively few color transitions. • For more complicated picture the compression ratio is 10:1.
  • 31. Reference • Fred Halsall “ Multimedia Communications Applications, Networks, Protocols and Standards”