SlideShare a Scribd company logo
1 of 25
Data CompressionData Compression
01/27/15 BY =VIKAS SINGH BHADOURIA
Why Data Compression?Why Data Compression?
Make optimal use of limited storage
space
Save time and help to optimize resources
 If compression and decompression are done in I/O processor, less time is
required to move data to or from storage subsystem, freeing I/O bus for
other work
 In sending data over communication line: less time to transmit and less
storage to host
01/27/15 BY =VIKAS SINGH BHADOURIA
Data Compression- EntropyData Compression- Entropy
Entropy is the measure of information content
in a message.
 Messages with higher entropy carry more information than
messages with lower entropy.
How to determine the entropy
 Find the probability p(x) of symbol x in the message
 The entropy H(x) of the symbol x is:
H(x) = - p(x) • log2p(x)
The average entropy over the entire message is
the sum of the entropy of all n symbols in the
message
01/27/15 BY =VIKAS SINGH BHADOURIA
Data Compression MethodsData Compression Methods
Data compression is about storing and sending
a smaller number of bits.
There’re two major categories for methods to
compress data: lossless and lossy methods
01/27/15 BY =VIKAS SINGH BHADOURIA
Lossless Compression MethodsLossless Compression Methods
In lossless methods, original data and the data
after compression and decompression are
exactly the same.
Redundant data is removed in compression and
added during decompression.
Lossless methods are used when we can’t
afford to lose any data: legal and medical
documents, computer programs.
01/27/15 BY =VIKAS SINGH BHADOURIA
Run-length encodingRun-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.
01/27/15 BY =VIKAS SINGH BHADOURIA
Huffman CodingHuffman 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:
a. Make a leaf node for each code symbol
Add the generation probability of each symbol to the leaf node
a. 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
a. If there is only one node left, the code construction is completed. If
not, go back to (2)
01/27/15 BY =VIKAS SINGH BHADOURIA
Huffman CodingHuffman Coding
 Example
01/27/15 BY =VIKAS SINGH BHADOURIA
Huffman CodingHuffman Coding
 Encoding
 Decoding
01/27/15 BY =VIKAS SINGH BHADOURIA
Lempel Ziv EncodingLempel 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.
01/27/15 BY =VIKAS SINGH BHADOURIA
Lempel Ziv CompressionLempel Ziv Compression
Have 2 phases:
 Building an indexed dictionary
 Compressing a string of symbols
• Algorithm:
 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
01/27/15 BY =VIKAS SINGH BHADOURIA
Lempel Ziv CompressionLempel Ziv Compression
 Compression
example:
01/27/15 BY =VIKAS SINGH BHADOURIA
Audio EncodingAudio Encoding
Predictive encoding
 Only the differences
01/27/15 BY =VIKAS SINGH BHADOURIA
Lempel Ziv DecompressionLempel Ziv Decompression
 It’s just the inverse
of compression process
01/27/15 BY =VIKAS SINGH BHADOURIA
Lossy Compression MethodsLossy Compression Methods
Used for compressing images and video files
(our eyes cannot distinguish subtle changes, so
lossy data is acceptable).
These methods are cheaper, less time and
space.
Several methods:
 JPEG: compress pictures and graphics
 MPEG: compress video
 MP3: compress audio
01/27/15 BY =VIKAS SINGH BHADOURIA
JPEG EncodingJPEG 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
compression methods.
01/27/15 BY =VIKAS SINGH BHADOURIA
JPEG Encoding- DCTJPEG 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
01/27/15 BY =VIKAS SINGH BHADOURIA
Quantization & CompressionQuantization & 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.
01/27/15 BY =VIKAS SINGH BHADOURIA
JPEG EncodingJPEG Encoding
01/27/15 BY =VIKAS SINGH BHADOURIA
MPEG EncodingMPEG 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.
01/27/15 BY =VIKAS SINGH BHADOURIA
MPEG EncodingMPEG Encoding
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.
01/27/15 BY =VIKAS SINGH BHADOURIA
Audio CompressionAudio Compression
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
01/27/15 BY =VIKAS SINGH BHADOURIA
Audio EncodingAudio Encoding
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.
01/27/15 BY =VIKAS SINGH BHADOURIA
ReferencesReferences
http://www.csie.kuas.edu.tw/course/cs/english/ch-1
CS157B-Lecture 19 by Professor Lee
http://cs.sjsu.edu/~lee/cs157b/cs157b.html
“The essentials of computer organization
and architecture” by Linda Null and Julia
Nobur.
01/27/15 BY =VIKAS SINGH BHADOURIA
Data CompressionData Compression
QUESTION?
01/27/15 BY =VIKAS SINGH BHADOURIA

More Related Content

What's hot (20)

Image compression models
Image compression modelsImage compression models
Image compression models
 
Data compression
Data compression Data compression
Data compression
 
Data compression
Data compressionData compression
Data compression
 
Multimedia:Multimedia compression
Multimedia:Multimedia compression Multimedia:Multimedia compression
Multimedia:Multimedia compression
 
Image compression
Image compression Image compression
Image compression
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Predictive coding
Predictive codingPredictive coding
Predictive coding
 
Data compression
Data compressionData compression
Data compression
 
Video compression
Video compressionVideo compression
Video compression
 
Fundamentals and image compression models
Fundamentals and image compression modelsFundamentals and image compression models
Fundamentals and image compression models
 
Transform coding
Transform codingTransform coding
Transform coding
 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Image compression
Image compressionImage compression
Image compression
 
Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
 
Run length encoding
Run length encodingRun length encoding
Run length encoding
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram Processing
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Audio and Video Compression
Audio and Video CompressionAudio and Video Compression
Audio and Video Compression
 

Similar to Data compression

2019188026 Data Compression (1) (1).pdf
2019188026 Data Compression  (1) (1).pdf2019188026 Data Compression  (1) (1).pdf
2019188026 Data Compression (1) (1).pdfAbinayaC11
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compressionmurugan hari
 
4 data compression
4 data compression4 data compression
4 data compressionRejin Thomas
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmchezhiyan chezhiyan
 
10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdfPUSHKAR ARYA
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.pptAllamJayaPrakash
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.pptAllamJayaPrakash
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...Helan4
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and videosangusajjan
 
Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compressionanithabalaprabhu
 

Similar to Data compression (20)

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
 
Mpeg 2
Mpeg 2Mpeg 2
Mpeg 2
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
 
4 data compression
4 data compression4 data compression
4 data compression
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithm
 
Data compression
Data compressionData compression
Data compression
 
Compression
CompressionCompression
Compression
 
Presentation on Image Compression
Presentation on Image Compression Presentation on Image Compression
Presentation on Image Compression
 
lecture on data compression
lecture on data compressionlecture on data compression
lecture on data compression
 
10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
Introduction Data Compression/ Data compression, modelling and coding,Image C...
Introduction Data Compression/ Data compression, modelling and coding,Image C...Introduction Data Compression/ Data compression, modelling and coding,Image C...
Introduction Data Compression/ Data compression, modelling and coding,Image C...
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
 
ch15.ppt
ch15.pptch15.ppt
ch15.ppt
 
ch15.ppt
ch15.pptch15.ppt
ch15.ppt
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and video
 
2
22
2
 
Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compression
 

More from VIKAS SINGH BHADOURIA

Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notesVIKAS SINGH BHADOURIA
 
Speed detection-of-moving-vehicle-using-speed-cameras
Speed detection-of-moving-vehicle-using-speed-camerasSpeed detection-of-moving-vehicle-using-speed-cameras
Speed detection-of-moving-vehicle-using-speed-camerasVIKAS SINGH BHADOURIA
 
Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360VIKAS SINGH BHADOURIA
 
Fingerprint based physical access control vehicle immobilizer
Fingerprint based physical access control vehicle immobilizer Fingerprint based physical access control vehicle immobilizer
Fingerprint based physical access control vehicle immobilizer VIKAS SINGH BHADOURIA
 
Full report on light peak technology
Full report on light peak technologyFull report on light peak technology
Full report on light peak technologyVIKAS SINGH BHADOURIA
 

More from VIKAS SINGH BHADOURIA (20)

Virtualization
VirtualizationVirtualization
Virtualization
 
Wireless Hacking
Wireless HackingWireless Hacking
Wireless Hacking
 
EDGE DETECTION
EDGE DETECTIONEDGE DETECTION
EDGE DETECTION
 
TCP /IP
TCP /IPTCP /IP
TCP /IP
 
Complete course on wireless
Complete course on wirelessComplete course on wireless
Complete course on wireless
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
 
Network Security
Network  SecurityNetwork  Security
Network Security
 
Improve your communication skills
Improve your communication skillsImprove your communication skills
Improve your communication skills
 
Infrared spectroscopy
Infrared spectroscopy   Infrared spectroscopy
Infrared spectroscopy
 
Speed detection-of-moving-vehicle-using-speed-cameras
Speed detection-of-moving-vehicle-using-speed-camerasSpeed detection-of-moving-vehicle-using-speed-cameras
Speed detection-of-moving-vehicle-using-speed-cameras
 
Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360Next generation graphics programming on xbox 360
Next generation graphics programming on xbox 360
 
Fingerprint based physical access control vehicle immobilizer
Fingerprint based physical access control vehicle immobilizer Fingerprint based physical access control vehicle immobilizer
Fingerprint based physical access control vehicle immobilizer
 
Intelligent agents
Intelligent agentsIntelligent agents
Intelligent agents
 
Interactive voice-response-system
Interactive voice-response-systemInteractive voice-response-system
Interactive voice-response-system
 
Brain computer-interface-ppt
Brain computer-interface-pptBrain computer-interface-ppt
Brain computer-interface-ppt
 
Trees
TreesTrees
Trees
 
Introduction to parallel computing
Introduction to parallel computingIntroduction to parallel computing
Introduction to parallel computing
 
Bluetooth mobileip
Bluetooth mobileipBluetooth mobileip
Bluetooth mobileip
 
Parallel computing persentation
Parallel computing persentationParallel computing persentation
Parallel computing persentation
 
Full report on light peak technology
Full report on light peak technologyFull report on light peak technology
Full report on light peak technology
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
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
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

Data compression

  • 1. Data CompressionData Compression 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 2. Why Data Compression?Why Data Compression? Make optimal use of limited storage space Save time and help to optimize resources  If compression and decompression are done in I/O processor, less time is required to move data to or from storage subsystem, freeing I/O bus for other work  In sending data over communication line: less time to transmit and less storage to host 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 3. Data Compression- EntropyData Compression- Entropy Entropy is the measure of information content in a message.  Messages with higher entropy carry more information than messages with lower entropy. How to determine the entropy  Find the probability p(x) of symbol x in the message  The entropy H(x) of the symbol x is: H(x) = - p(x) • log2p(x) The average entropy over the entire message is the sum of the entropy of all n symbols in the message 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 4. Data Compression MethodsData Compression Methods Data compression is about storing and sending a smaller number of bits. There’re two major categories for methods to compress data: lossless and lossy methods 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 5. Lossless Compression MethodsLossless Compression Methods In lossless methods, original data and the data after compression and decompression are exactly the same. Redundant data is removed in compression and added during decompression. Lossless methods are used when we can’t afford to lose any data: legal and medical documents, computer programs. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 6. Run-length encodingRun-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. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 7. Huffman CodingHuffman 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: a. Make a leaf node for each code symbol Add the generation probability of each symbol to the leaf node a. 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 a. If there is only one node left, the code construction is completed. If not, go back to (2) 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 8. Huffman CodingHuffman Coding  Example 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 9. Huffman CodingHuffman Coding  Encoding  Decoding 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 10. Lempel Ziv EncodingLempel 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. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 11. Lempel Ziv CompressionLempel Ziv Compression Have 2 phases:  Building an indexed dictionary  Compressing a string of symbols • Algorithm:  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 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 12. Lempel Ziv CompressionLempel Ziv Compression  Compression example: 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 13. Audio EncodingAudio Encoding Predictive encoding  Only the differences 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 14. Lempel Ziv DecompressionLempel Ziv Decompression  It’s just the inverse of compression process 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 15. Lossy Compression MethodsLossy Compression Methods Used for compressing images and video files (our eyes cannot distinguish subtle changes, so lossy data is acceptable). These methods are cheaper, less time and space. Several methods:  JPEG: compress pictures and graphics  MPEG: compress video  MP3: compress audio 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 16. JPEG EncodingJPEG 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 compression methods. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 17. JPEG Encoding- DCTJPEG 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 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 18. Quantization & CompressionQuantization & 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. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 19. JPEG EncodingJPEG Encoding 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 20. MPEG EncodingMPEG 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. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 21. MPEG EncodingMPEG Encoding 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. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 22. Audio CompressionAudio Compression 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 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 23. Audio EncodingAudio Encoding 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. 01/27/15 BY =VIKAS SINGH BHADOURIA
  • 24. ReferencesReferences http://www.csie.kuas.edu.tw/course/cs/english/ch-1 CS157B-Lecture 19 by Professor Lee http://cs.sjsu.edu/~lee/cs157b/cs157b.html “The essentials of computer organization and architecture” by Linda Null and Julia Nobur. 01/27/15 BY =VIKAS SINGH BHADOURIA