SlideShare uma empresa Scribd logo
1 de 24
Data CompressionData Compression
09eskit02109eskit021
ARVIND KHILERIARVIND KHILERI
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
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
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
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.
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.
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)
Huffman CodingHuffman Coding
 Example
Huffman CodingHuffman Coding
 Encoding
 Decoding
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.
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
Lempel Ziv CompressionLempel Ziv Compression
 Compression
example:
Lempel Ziv DecompressionLempel Ziv Decompression
 It’s just the inverse
of compression process
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
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.
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
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.
JPEG EncodingJPEG Encoding
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.
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.
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
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.
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.
Data CompressionData Compression
QUESTION?

Mais conteúdo relacionado

Mais procurados

Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compression
anithabalaprabhu
 

Mais procurados (20)

data compression technique
data compression techniquedata compression technique
data compression technique
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniques
 
lecture on data compression
lecture on data compressionlecture on data compression
lecture on data compression
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Compression
CompressionCompression
Compression
 
Multimedia compression
Multimedia compressionMultimedia compression
Multimedia compression
 
Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)Data Compression (Lossy and Lossless)
Data Compression (Lossy and Lossless)
 
Audio compression
Audio compressionAudio compression
Audio compression
 
data compression.
data compression.data compression.
data compression.
 
Data compression
Data compressionData compression
Data compression
 
Compression: Video Compression (MPEG and others)
Compression: Video Compression (MPEG and others)Compression: Video Compression (MPEG and others)
Compression: Video Compression (MPEG and others)
 
JPEG
JPEGJPEG
JPEG
 
Mpeg video compression
Mpeg video compressionMpeg video compression
Mpeg video compression
 
Comparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless CompressionComparison between Lossy and Lossless Compression
Comparison between Lossy and Lossless Compression
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Video Compression
Video CompressionVideo Compression
Video Compression
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standard
 
Dictionary Based Compression
Dictionary Based CompressionDictionary Based Compression
Dictionary Based Compression
 

Destaque

Data compression introduction
Data compression introductionData compression introduction
Data compression introduction
Rahul Khanwani
 
Cjb0912010 lz algorithms
Cjb0912010 lz algorithmsCjb0912010 lz algorithms
Cjb0912010 lz algorithms
RAJAN ST
 
Data Compression Project Presentation
Data Compression Project PresentationData Compression Project Presentation
Data Compression Project Presentation
Myuran Kanga, MS, MBA
 
TEST EXECUTION AND REPORTING
TEST EXECUTION AND REPORTINGTEST EXECUTION AND REPORTING
TEST EXECUTION AND REPORTING
suhasreddy1
 
Wireless sensor network security issues
Wireless sensor network security issuesWireless sensor network security issues
Wireless sensor network security issues
Maha Saad
 
Text compression in LZW and Flate
Text compression in LZW and FlateText compression in LZW and Flate
Text compression in LZW and Flate
Subeer Rangra
 
Physical database design(database)
Physical database design(database)Physical database design(database)
Physical database design(database)
welcometofacebook
 

Destaque (20)

Data compression introduction
Data compression introductionData compression introduction
Data compression introduction
 
Vaxd brought to you by the Back Pain Institute of Dallas
Vaxd brought to you by the Back Pain Institute of DallasVaxd brought to you by the Back Pain Institute of Dallas
Vaxd brought to you by the Back Pain Institute of Dallas
 
Computer software 2
Computer software 2Computer software 2
Computer software 2
 
Sindrome de Compresion Vertebral, Medular y Radicular
Sindrome de Compresion Vertebral, Medular y RadicularSindrome de Compresion Vertebral, Medular y Radicular
Sindrome de Compresion Vertebral, Medular y Radicular
 
Cjb0912010 lz algorithms
Cjb0912010 lz algorithmsCjb0912010 lz algorithms
Cjb0912010 lz algorithms
 
Data Compression Project Presentation
Data Compression Project PresentationData Compression Project Presentation
Data Compression Project Presentation
 
2013 OHSUG - Clinical Data Warehouse Implementation
2013 OHSUG - Clinical Data Warehouse Implementation2013 OHSUG - Clinical Data Warehouse Implementation
2013 OHSUG - Clinical Data Warehouse Implementation
 
Source coding
Source codingSource coding
Source coding
 
B) Computer Basics
B) Computer BasicsB) Computer Basics
B) Computer Basics
 
TEST EXECUTION AND REPORTING
TEST EXECUTION AND REPORTINGTEST EXECUTION AND REPORTING
TEST EXECUTION AND REPORTING
 
Lzw compression
Lzw compressionLzw compression
Lzw compression
 
Test Life Cycle - Manual Testing Concept.
Test Life Cycle - Manual Testing Concept.Test Life Cycle - Manual Testing Concept.
Test Life Cycle - Manual Testing Concept.
 
Datacube
DatacubeDatacube
Datacube
 
An introduction of cloud storage
An introduction of cloud storage An introduction of cloud storage
An introduction of cloud storage
 
Wireless sensor network security issues
Wireless sensor network security issuesWireless sensor network security issues
Wireless sensor network security issues
 
Text compression in LZW and Flate
Text compression in LZW and FlateText compression in LZW and Flate
Text compression in LZW and Flate
 
Appraisal (Self Assessment, Peer Assessment, 360 Degree Feedback)
Appraisal (Self Assessment, Peer Assessment, 360 Degree Feedback)Appraisal (Self Assessment, Peer Assessment, 360 Degree Feedback)
Appraisal (Self Assessment, Peer Assessment, 360 Degree Feedback)
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
 
Cloud storage slides
Cloud storage slidesCloud storage slides
Cloud storage slides
 
Physical database design(database)
Physical database design(database)Physical database design(database)
Physical database design(database)
 

Semelhante a 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
sangusajjan
 
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
 
10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf
PUSHKAR ARYA
 
A research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreA research paper_on_lossless_data_compre
A research paper_on_lossless_data_compre
Luisa Francisco
 

Semelhante a 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
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt111111111111111111111111111111111789.ppt
111111111111111111111111111111111789.ppt
 
Lec5 Compression
Lec5 CompressionLec5 Compression
Lec5 Compression
 
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...
 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
 
Compression of digital voice and video
Compression of digital voice and videoCompression of digital voice and video
Compression of digital voice and video
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
Text compression
Text compressionText compression
Text compression
 
Lossless image compression.(1)
Lossless image compression.(1)Lossless image compression.(1)
Lossless image compression.(1)
 
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...
 
Image compression
Image compressionImage compression
Image compression
 
Image compression and jpeg
Image compression and jpegImage compression and jpeg
Image compression and jpeg
 
10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf10lecture10datacompression-171023182241.pdf
10lecture10datacompression-171023182241.pdf
 
Lecture 6 -_presentation_layer
Lecture 6 -_presentation_layerLecture 6 -_presentation_layer
Lecture 6 -_presentation_layer
 
A research paper_on_lossless_data_compre
A research paper_on_lossless_data_compreA research paper_on_lossless_data_compre
A research paper_on_lossless_data_compre
 
Arithmetic Coding
Arithmetic CodingArithmetic Coding
Arithmetic Coding
 
Pbl1
Pbl1Pbl1
Pbl1
 
Image compression
Image compression Image compression
Image compression
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Data compression

  • 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
  • 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
  • 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
  • 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.
  • 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.
  • 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)
  • 9. Huffman CodingHuffman Coding  Encoding  Decoding
  • 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.
  • 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
  • 12. Lempel Ziv CompressionLempel Ziv Compression  Compression example:
  • 13. Lempel Ziv DecompressionLempel Ziv Decompression  It’s just the inverse of compression process
  • 14. 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
  • 15. 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.
  • 16. 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
  • 17. 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.
  • 19. 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.
  • 20. 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.
  • 21. 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
  • 22. 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.
  • 23. 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.