SlideShare a Scribd company logo
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”

More Related Content

PPTX
IMAGE SEGMENTATION.
PPTX
Image compression in digital image processing
PPTX
Image compression .
PPTX
digital image processing
PPT
Image segmentation
PPT
Enhancement in frequency domain
PPTX
Smoothing Filters in Spatial Domain
PPSX
Image Processing: Spatial filters
IMAGE SEGMENTATION.
Image compression in digital image processing
Image compression .
digital image processing
Image segmentation
Enhancement in frequency domain
Smoothing Filters in Spatial Domain
Image Processing: Spatial filters

What's hot (20)

ODP
image compression ppt
PPTX
Image compression
PPTX
Bit plane coding
PDF
Lecture 4 Relationship between pixels
PPTX
Module 31
PPTX
Image Sampling and Quantization.pptx
PPTX
Image restoration and degradation model
PDF
Image segmentation
PDF
Digital Image Processing - Image Compression
PPTX
Region based segmentation
PPTX
Image enhancement techniques
PPTX
Fundamentals and image compression models
PPTX
Video signal-ppt
PPT
Data Redundacy
PPTX
Audio compression
PPTX
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
PPT
Data compression
PPT
Interpixel redundancy
PPTX
Color Models.pptx
image compression ppt
Image compression
Bit plane coding
Lecture 4 Relationship between pixels
Module 31
Image Sampling and Quantization.pptx
Image restoration and degradation model
Image segmentation
Digital Image Processing - Image Compression
Region based segmentation
Image enhancement techniques
Fundamentals and image compression models
Video signal-ppt
Data Redundacy
Audio compression
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
Data compression
Interpixel redundancy
Color Models.pptx
Ad

Similar to Multimedia communication jpeg (20)

PPTX
JPEG and MPEG Compression in Digital Image Processing.pptx
PPTX
PPT
Multimedia image compression standards
PPTX
JPEG Image Compression
PPTX
PPTX
Jpeg compression
PDF
Compression: Images (JPEG)
PPT
Compression
PPT
Compression
PPT
Mmclass4
PDF
CMOS Image Sensor Design_h20_10_jpeg.pdf
PPTX
Jpeg standards
PPT
image processing for jpeg presentati.ppt
DOC
image compression in data compression
PDF
W13JPEGCompression techinques detail.pdf
PDF
CyberSec_JPEGcompressionForensics.pdf
PPT
Why Image compression is Necessary?
PPT
jpg image processing nagham salim_as.ppt
PDF
Video Compression Basics
PDF
Pipelined Architecture of 2D-DCT, Quantization and ZigZag Process for JPEG Im...
JPEG and MPEG Compression in Digital Image Processing.pptx
Multimedia image compression standards
JPEG Image Compression
Jpeg compression
Compression: Images (JPEG)
Compression
Compression
Mmclass4
CMOS Image Sensor Design_h20_10_jpeg.pdf
Jpeg standards
image processing for jpeg presentati.ppt
image compression in data compression
W13JPEGCompression techinques detail.pdf
CyberSec_JPEGcompressionForensics.pdf
Why Image compression is Necessary?
jpg image processing nagham salim_as.ppt
Video Compression Basics
Pipelined Architecture of 2D-DCT, Quantization and ZigZag Process for JPEG Im...
Ad

More from Dr. Kapil Gupta (7)

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

Recently uploaded (20)

PPTX
additive manufacturing of ss316l using mig welding
PPTX
web development for engineering and engineering
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Sustainable Sites - Green Building Construction
DOCX
573137875-Attendance-Management-System-original
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
composite construction of structures.pdf
PDF
Well-logging-methods_new................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
PPT on Performance Review to get promotions
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
additive manufacturing of ss316l using mig welding
web development for engineering and engineering
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Sustainable Sites - Green Building Construction
573137875-Attendance-Management-System-original
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
composite construction of structures.pdf
Well-logging-methods_new................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
CYBER-CRIMES AND SECURITY A guide to understanding
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Lesson 3_Tessellation.pptx finite Mathematics
Embodied AI: Ushering in the Next Era of Intelligent Systems
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT on Performance Review to get promotions
CH1 Production IntroductoryConcepts.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Foundation to blockchain - A guide to Blockchain Tech

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”