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
Ad

More Related Content

What's hot (20)

Data compression
Data compressionData compression
Data compression
Abhishek Grover
 
Data compression
Data compressionData compression
Data compression
VIKAS SINGH BHADOURIA
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
Pratik Pradhan
 
Presentation of Lossy compression
Presentation of Lossy compressionPresentation of Lossy compression
Presentation of Lossy compression
Omar Ghazi
 
Image compression
Image compression Image compression
Image compression
GARIMA SHAKYA
 
Video compression
Video compressionVideo compression
Video compression
DarkNight14
 
Audio compression
Audio compressionAudio compression
Audio compression
Miled Othmen
 
Data compression
Data  compressionData  compression
Data compression
Ashutosh Kawadkar
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
Shivangi Saxena
 
Transform coding
Transform codingTransform coding
Transform coding
Nancy K
 
Multimedia compression
Multimedia compressionMultimedia compression
Multimedia compression
pradeepa velmurugan
 
Multimedia synchronization
Multimedia synchronizationMultimedia synchronization
Multimedia synchronization
I World Tech
 
Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
Tata Consultancy Services
 
Image Sampling and Quantization.pptx
Image Sampling and Quantization.pptxImage Sampling and Quantization.pptx
Image Sampling and Quantization.pptx
RUBIN (A) JEBIN
 
Image compression
Image compressionImage compression
Image compression
Bassam Kanber
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
Kalyan Acharjya
 
Image compression .
Image compression .Image compression .
Image compression .
Payal Vishwakarma
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
Hossain Md Shakhawat
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
Mazin Alwaaly
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
Poonam Seth
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
Pratik Pradhan
 
Presentation of Lossy compression
Presentation of Lossy compressionPresentation of Lossy compression
Presentation of Lossy compression
Omar Ghazi
 
Image compression
Image compression Image compression
Image compression
GARIMA SHAKYA
 
Video compression
Video compressionVideo compression
Video compression
DarkNight14
 
Audio compression
Audio compressionAudio compression
Audio compression
Miled Othmen
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
Shivangi Saxena
 
Transform coding
Transform codingTransform coding
Transform coding
Nancy K
 
Multimedia synchronization
Multimedia synchronizationMultimedia synchronization
Multimedia synchronization
I World Tech
 
Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
Tata Consultancy Services
 
Image Sampling and Quantization.pptx
Image Sampling and Quantization.pptxImage Sampling and Quantization.pptx
Image Sampling and Quantization.pptx
RUBIN (A) JEBIN
 
Image compression
Image compressionImage compression
Image compression
Bassam Kanber
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
Kalyan Acharjya
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
Mazin Alwaaly
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
Poonam Seth
 

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
murugan hari
 
Data Compression
Data CompressionData Compression
Data Compression
Shubham Bammi
 
Data compression
Data compressionData compression
Data compression
Sherif Abdelfattah
 
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
 
Unit 3 Image Compression and Segmentation.pptx
Unit 3  Image Compression and Segmentation.pptxUnit 3  Image Compression and Segmentation.pptx
Unit 3 Image Compression and Segmentation.pptx
AmrutaSakhare1
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and video
sangusajjan
 
Image compression
Image compressionImage compression
Image compression
Shiva Krishna Chandra Shekar
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
AllamJayaPrakash
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
AllamJayaPrakash
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniques
Deep Bhatt
 
data compression technique
data compression techniquedata compression technique
data compression technique
CHINMOY PAUL
 
Jpeg
JpegJpeg
Jpeg
Rashmi R Upadhya
 
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 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
 
Unit 3 Image Compression and Segmentation.pptx
Unit 3  Image Compression and Segmentation.pptxUnit 3  Image Compression and Segmentation.pptx
Unit 3 Image Compression and Segmentation.pptx
AmrutaSakhare1
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and video
sangusajjan
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
AllamJayaPrakash
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
AllamJayaPrakash
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniques
Deep Bhatt
 
data compression technique
data compression techniquedata compression technique
data compression technique
CHINMOY PAUL
 
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
 
Ad

Recently uploaded (20)

Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Ad

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.