SlideShare a Scribd company logo
FUNDAMENTALS OF COMPRESSION

By,
PRAVEEN.M.K,
M.tech,
Digital communication and networking,
Kalasalingam University.
What is Compression?
• Reduce the size of data.
• Also, Compression is a way to reduce the number of bits in a
frame but retaining its meaning.

• Advantages:
» Reduce storage needed
» Reduce transmission cost/latency/bandwidth.

.
Data Compression Methods
Lossless compression
• Lossless compression is a class of data compression that
allows the original data to be perfectly reconstructed from
the compressed data.
• Redundant data is removed in compression and added
during decompression.
• Most lossless compression programs do two things in
sequence: the first step generates a statistical model for the
input data, and the second step uses this model to map input
data to bit sequences in such a way that "probable" (e.g.
frequently encountered) data will produce shorter output
than "improbable" data.
Method 1:Run-length encoding
• Simplest method of compression.
• How: replace consecutive repeating occurrences of a symbol
by 1 occurrence of the symbol itself, then followed by the
number of occurrences.

• The method can be more efficient if the data uses only 2
symbols (0s and 1s) in bit patterns and 1 symbol is more
frequent than another.
Method 2:Huffman Coding
 Assign fewer bits to symbols that occur more frequently and
more bits to symbols appear less often.
 There’s no unique Huffman code and every Huffman code has
the same average code length.
 Algorithm:
①

②

③

Make a leaf node for each code symbol
Add the generation probability of each symbol to the leaf node
Take the two leaf nodes with the smallest probability and connect them into
a new node
Add 1 or 0 to each of the two branches
The probability of the new node is the sum of the probabilities of the
two connecting nodes
If there is only one node left, the code construction is completed. If not, go
back to (2)
Huffman Algorithm:
• For example,
How the encoding and decoding process
takes place?
• Encoding:

• Decoding:
Method 3:Lempel Ziv Encoding
• It is dictionary-based encoding
• Basic idea:
 Create a dictionary(a table) of strings used during
communication.
 If both sender and receiver have a copy of the
dictionary, then previously-encountered strings can be
substituted by their index in the dictionary.
Contd...,
 This compression has 2 phases:
 Building an indexed dictionary
 Compressing a string of symbols

• Algorithm for lempel ziv encoding:
 Extract the smallest substring that cannot be found in the
remaining uncompressed string.
 Store that substring in the dictionary as a new entry and
assign it an index value
 Substring is replaced with the index found in the
dictionary
 Insert the index and the last character of the substring
into the compressed string
Lempel Ziv Compression
• Compression
example,
Lossy Compression
• Lossy compression is the converse of lossless data
compression.
• It is Used for compressing images and video files.
• Methods of lossy compression:
 JPEG: compress pictures and graphics
 MPEG:compress video
 MP3: compress audio
Method 1:JPEG Encoding
• Used to compress pictures and graphics.
• In JPEG, a grayscale picture is divided into 8x8 pixel
blocks to decrease the number of calculations.
• Basic idea:
 Change the picture into a linear (vector) sets of numbers that
reveals the redundancies.
 The redundancies is then removed by one of lossless.
JPEG Encoding- DCT
• DCT: Discrete Concise Transform
• DCT transforms the 64 values in 8x8 pixel block in a way that
the relative relationships between pixels are kept but the
redundancies are revealed.
• Example:
A gradient grayscale
Quantization & Compression
 Quantization:
 After T table is created, the values are quantized to
reduce the number of bits needed for encoding.
 Quantization divides the number of bits by a constant,
then drops the fraction. This is done to optimize the
number of bits and the number of 0s for each particular
application.

• Compression:
 Quantized values are read from the table and redundant
0s are removed.
 To cluster the 0s together, the table is read diagonally in
an zigzag fashion. The reason is if the table doesn’t have
fine changes, the bottom right corner of the table is all 0s.
 JPEG usually uses lossless run-length encoding at the
compression phase.
JPEG Encoding
Method 2:MPEG Encoding
• Used to compress video.
• Basic idea:
 Each video is a rapid sequence of a set of frames. Each
frame is a spatial combination of pixels, or a picture.
 Compressing video =
spatially compressing each frame
+
temporally compressing a set of frames.
Types of MPEG compression
• Spatial Compression
 Each frame is spatially compressed by JPEG.

• Temporal Compression
 Redundant frames are removed.
 For example, in a static scene in which someone is talking, most
frames are the same except for the segment around the speaker’s
lips, which changes from one frame to the next.
Method 3:Audio(or)Mp3 Encoding
• Used for speech or music
 Speech: compress a 64 kHz digitized signal
 Music: compress a 1.411 MHz signal

• Two categories of techniques:
 Predictive encoding
 Perceptual encoding
Categories:
 Predictive Encoding
 Only the differences between samples are encoded, not
the whole sample values.
 Several standards: GSM (13 kbps), G.729 (8 kbps), and
G.723.3 (6.4 or 5.3 kbps)

• Perceptual Encoding: MP3
 CD-quality audio needs at least 1.411 Mbps and cannot
be sent over the Internet without compression.
 MP3 (MPEG audio layer 3) uses perceptual encoding
technique to compress audio.
Fundamentals of Data compression

More Related Content

What's hot

Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)
Project Student
 
data compression.
data compression.data compression.
data compression.
hasan sarker
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
lalithambiga kamaraj
 
JPEG
JPEGJPEG
Image Compression
Image CompressionImage Compression
Image Compression
Paramjeet Singh Jamwal
 
Video Compression
Video CompressionVideo Compression
Video Compression
Shreyash Patel
 
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
priyadharshini murugan
 
digital image processing
digital image processingdigital image processing
digital image processing
Abinaya B
 
Image compression
Image compressionImage compression
Image compression
Abdelrahman Almassry
 
Multimedia compression
Multimedia compressionMultimedia compression
Multimedia compression
pradeepa velmurugan
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
Aishwarya K. M.
 
Unit 1
Unit 1Unit 1
Unit 1
swapnasalil
 
Data compression introduction
Data compression introductionData compression introduction
Data compression introductionRahul Khanwani
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compression
rafikrokon
 
Image compression .
Image compression .Image compression .
Image compression .
Payal Vishwakarma
 
Predictive coding
Predictive codingPredictive coding
Predictive coding
p_ayal
 
Audio compression
Audio compressionAudio compression
Audio compression
priyanka pandey
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
Mazin Alwaaly
 

What's hot (20)

Data compression
Data compressionData compression
Data compression
 
Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)
 
data compression.
data compression.data compression.
data compression.
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
 
Audio compression
Audio compressionAudio compression
Audio compression
 
JPEG
JPEGJPEG
JPEG
 
Image Compression
Image CompressionImage Compression
Image Compression
 
Video Compression
Video CompressionVideo Compression
Video 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
 
digital image processing
digital image processingdigital image processing
digital image processing
 
Image compression
Image compressionImage compression
Image compression
 
Multimedia compression
Multimedia compressionMultimedia compression
Multimedia compression
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Unit 1
Unit 1Unit 1
Unit 1
 
Data compression introduction
Data compression introductionData compression introduction
Data compression introduction
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compression
 
Image compression .
Image compression .Image compression .
Image compression .
 
Predictive coding
Predictive codingPredictive coding
Predictive coding
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 

Similar to Fundamentals of Data compression

image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
murugan hari
 
Data Compression
Data CompressionData Compression
Data Compression
Shubham Bammi
 
2019188026 Data Compression (1) (1).pdf
2019188026 Data Compression  (1) (1).pdf2019188026 Data Compression  (1) (1).pdf
2019188026 Data Compression (1) (1).pdf
AbinayaC11
 
Data compression
Data compressionData compression
Data compression
Chaitanya Belhekar
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and videosangusajjan
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
AllamJayaPrakash
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
AllamJayaPrakash
 
Jpeg
JpegJpeg
Image compression
Image compression Image compression
Image compression
GARIMA SHAKYA
 
Teknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptxTeknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptx
zulhelmanz
 
Source coding
Source codingSource coding
Source coding
MOHIT KUMAR
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
HarisMasood20
 
Lossless image compression.(1)
Lossless image compression.(1)Lossless image compression.(1)
Lossless image compression.(1)
MohnishSatidasani
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
Mathankumar S
 
2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt
2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt
2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt
ReinertYosua
 
Introduction to data compression.pptx
Introduction to data compression.pptxIntroduction to data compression.pptx
Introduction to data compression.pptx
jesna40
 
image compression Tech. 31.pptx
image compression Tech. 31.pptximage compression Tech. 31.pptx
image compression Tech. 31.pptx
BharatiPatelPhDStude
 
10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf
PUSHKAR ARYA
 
lecture on data compression
lecture on data compressionlecture on data compression
lecture on data compression
Dr Rajiv Srivastava
 

Similar to Fundamentals of Data compression (20)

image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
 
Data Compression
Data CompressionData Compression
Data Compression
 
2019188026 Data Compression (1) (1).pdf
2019188026 Data Compression  (1) (1).pdf2019188026 Data Compression  (1) (1).pdf
2019188026 Data Compression (1) (1).pdf
 
Data compression
Data compressionData compression
Data compression
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and video
 
Image compression
Image compressionImage compression
Image compression
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
Jpeg
JpegJpeg
Jpeg
 
Image compression
Image compression Image compression
Image compression
 
Teknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptxTeknik Pengkodean (2).pptx
Teknik Pengkodean (2).pptx
 
Source coding
Source codingSource coding
Source coding
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
 
Lossless image compression.(1)
Lossless image compression.(1)Lossless image compression.(1)
Lossless image compression.(1)
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt
2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt
2019010413470100000524_Sesi10_Multimedia Data Compression II.ppt
 
Introduction to data compression.pptx
Introduction to data compression.pptxIntroduction to data compression.pptx
Introduction to data compression.pptx
 
image compression Tech. 31.pptx
image compression Tech. 31.pptximage compression Tech. 31.pptx
image compression Tech. 31.pptx
 
10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf
 
lecture on data compression
lecture on data compressionlecture on data compression
lecture on data compression
 

Recently uploaded

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 

Recently uploaded (20)

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 

Fundamentals of Data compression

  • 1. FUNDAMENTALS OF COMPRESSION By, PRAVEEN.M.K, M.tech, Digital communication and networking, Kalasalingam University.
  • 2. What is Compression? • Reduce the size of data. • Also, Compression is a way to reduce the number of bits in a frame but retaining its meaning. • Advantages: » Reduce storage needed » Reduce transmission cost/latency/bandwidth. .
  • 4. Lossless compression • Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data. • Redundant data is removed in compression and added during decompression. • Most lossless compression programs do two things in sequence: the first step generates a statistical model for the input data, and the second step uses this model to map input data to bit sequences in such a way that "probable" (e.g. frequently encountered) data will produce shorter output than "improbable" data.
  • 5. Method 1:Run-length encoding • Simplest method of compression. • How: replace consecutive repeating occurrences of a symbol by 1 occurrence of the symbol itself, then followed by the number of occurrences. • The method can be more efficient if the data uses only 2 symbols (0s and 1s) in bit patterns and 1 symbol is more frequent than another.
  • 6. Method 2:Huffman Coding  Assign fewer bits to symbols that occur more frequently and more bits to symbols appear less often.  There’s no unique Huffman code and every Huffman code has the same average code length.  Algorithm: ① ② ③ Make a leaf node for each code symbol Add the generation probability of each symbol to the leaf node Take the two leaf nodes with the smallest probability and connect them into a new node Add 1 or 0 to each of the two branches The probability of the new node is the sum of the probabilities of the two connecting nodes If there is only one node left, the code construction is completed. If not, go back to (2)
  • 8. How the encoding and decoding process takes place? • Encoding: • Decoding:
  • 9. Method 3:Lempel Ziv Encoding • It is dictionary-based encoding • Basic idea:  Create a dictionary(a table) of strings used during communication.  If both sender and receiver have a copy of the dictionary, then previously-encountered strings can be substituted by their index in the dictionary.
  • 10. Contd...,  This compression has 2 phases:  Building an indexed dictionary  Compressing a string of symbols • Algorithm for lempel ziv encoding:  Extract the smallest substring that cannot be found in the remaining uncompressed string.  Store that substring in the dictionary as a new entry and assign it an index value  Substring is replaced with the index found in the dictionary  Insert the index and the last character of the substring into the compressed string
  • 11. Lempel Ziv Compression • Compression example,
  • 12. Lossy Compression • Lossy compression is the converse of lossless data compression. • It is Used for compressing images and video files. • Methods of lossy compression:  JPEG: compress pictures and graphics  MPEG:compress video  MP3: compress audio
  • 13. Method 1:JPEG Encoding • Used to compress pictures and graphics. • In JPEG, a grayscale picture is divided into 8x8 pixel blocks to decrease the number of calculations. • Basic idea:  Change the picture into a linear (vector) sets of numbers that reveals the redundancies.  The redundancies is then removed by one of lossless.
  • 14. JPEG Encoding- DCT • DCT: Discrete Concise Transform • DCT transforms the 64 values in 8x8 pixel block in a way that the relative relationships between pixels are kept but the redundancies are revealed. • Example: A gradient grayscale
  • 15. Quantization & Compression  Quantization:  After T table is created, the values are quantized to reduce the number of bits needed for encoding.  Quantization divides the number of bits by a constant, then drops the fraction. This is done to optimize the number of bits and the number of 0s for each particular application. • Compression:  Quantized values are read from the table and redundant 0s are removed.  To cluster the 0s together, the table is read diagonally in an zigzag fashion. The reason is if the table doesn’t have fine changes, the bottom right corner of the table is all 0s.  JPEG usually uses lossless run-length encoding at the compression phase.
  • 17. Method 2:MPEG Encoding • Used to compress video. • Basic idea:  Each video is a rapid sequence of a set of frames. Each frame is a spatial combination of pixels, or a picture.  Compressing video = spatially compressing each frame + temporally compressing a set of frames.
  • 18. Types of MPEG compression • Spatial Compression  Each frame is spatially compressed by JPEG. • Temporal Compression  Redundant frames are removed.  For example, in a static scene in which someone is talking, most frames are the same except for the segment around the speaker’s lips, which changes from one frame to the next.
  • 19. Method 3:Audio(or)Mp3 Encoding • Used for speech or music  Speech: compress a 64 kHz digitized signal  Music: compress a 1.411 MHz signal • Two categories of techniques:  Predictive encoding  Perceptual encoding
  • 20. Categories:  Predictive Encoding  Only the differences between samples are encoded, not the whole sample values.  Several standards: GSM (13 kbps), G.729 (8 kbps), and G.723.3 (6.4 or 5.3 kbps) • Perceptual Encoding: MP3  CD-quality audio needs at least 1.411 Mbps and cannot be sent over the Internet without compression.  MP3 (MPEG audio layer 3) uses perceptual encoding technique to compress audio.