compression and decompression 10/22/20151 a.aruna, assistant professor, faculty of information...
TRANSCRIPT
COMPRESSION AND DECOMPRESSION
04/20/23 1A.Aruna, Assistant Professor, Faculty of Information Technology
IntroductionVideo and audio have much higher
storage requirements than textData transmission rates (in terms of
bandwidth requirements) for sending continuous media are considerably higher than text
Efficient compression of audio and video data, including some compression standards
COMPRESSION
Compression is a reduction in the number of bits needed to represent data.
save storage capacityspeed file transferdecrease costs for storage hardware and network bandwidth.
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
3
04/20/23 4
Multimedia Compression
Audio, image and video require vast amounts of data320x240x8bits grayscale image: 77Kb1100x900x24bits color image: 3MB640x480x24x30frames/sec: 27.6 MB/sec
Low network’s bandwidth doesn't allow for real time video transmission
Slow storage or processing devices don't allow for fast playing back
Compression reduces storage requirements
A.Aruna, Assistant Professor, Faculty of Information
Technology
04/20/23 5
Classification of Techniques
Lossless: recover the original representation.Mechanisms:
Packbits encoding(Run Length Encoding)CCITT Group 3 1DCCITT Group 3 2DCCITT Group 4Lempel – Ziv and Welch Algorithm LZW
A.Aruna, Assistant Professor, Faculty of Information Technology
Classification of Techniques
Lossy: recover a representation similar to the original onegraphics, audio, video and imagesMechanisms:
Joint Photographic Experts Group Moving Picture Experts GroupIntel DVI CCITT H.26l Video Coding AlgorithmFractals
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
6
BINARY IMAGE COMPRESSION
Used for Documents (Black & White) Continuous Tone Information
Office & Business Document Handwritten TextLine GraphicsEngineering DrawingScanning Documents
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
7
BINARY IMAGE COMPRESSION
Scanning ProcessScanline – Top to Bottom, Left to rightComposed of Various ObjectsCCD Array Sensor – B/W Dots- Memory
Eg: Faxing – 1 Page – 20 seconds
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
8
Packbits Encoding or Runlength Encoding
Simplest and earliest Data Compression Schemes
Binary Image Consecutive Repeated – Two Bytes
First Byte – No.of times Character is Repeated
Second Byte – Character itself
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
9
Packbits Encoding or Runlength Encoding
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
10
CCITT Group 3 1-D Compression
Based on Runlength Encoding Facsimile & Early document Imaging
System Large Size even after Compression Modified Runlength encoding is
Huffman Encoding
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
11
CCITT Group 3 1-D Compression
Huffman Encoding Variable Length Encoding Shorter Code – Frequently Longer code – Less Frequently
Probability of Occurrence of white and black Pixel
It is based on a coding Tree, which is constructed based on the probability of occurrences of white pixels and black pixels in the run length or bit streams
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
12
CCITT Group 3 1-D Compression
probability of occurrences of bit stream of length Rn = P(Rn)
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
13
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
14
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
15
Large Pixel Sequences
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
16
Example
16 White Pixel = 101010 - Frequently16 Black Pixel = 0000010111Quicker decoding Tree Structure to be constructed
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
17
Makeup code : length in Multiples of 64 pixels
Terminating code: length less than 64 pixels
132 white pixels is 100101011Make up code for 128 = 10010Terminating code for 4 = 1011
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
18
Coding Tree
16 white 101010 and black pixel 0000010111
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
19
1
0
1
0
1
0
CCITT Group 3 2D Compression
2-dimensional codingImages are divided into several
groups of K linesthe first line of each group is encoded
using CCITT Group 3 1D methodThe rest of lines are encoded using
some "differencial schemes"Typically compression ratio 10 ~
20
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
20
CCITT Group 3 2D Compression
The "K-factor" allows more error-free transmission
World-wide fassimile standardThe 2D scheme uses a
combination of additional codes called vertical code, pass code, and horizontal code
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
21
CCITT Group 3 2D Compression
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
22
CCITT Group 3 2D Compression
Only one pass code, i.e. 0001 and one horizontal code, i.e. 001If vertical code and horizontal code
are not applied, then the horizontal code is appied
Horizontal Code + Group 3 1D Code = 001 + markup code + terminating code
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
23
COLOR, GRAY SCALE& STILL VIDEO IMAGE COMPRESSION
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
24
http://cs.stanford.edu/people/eroberts/courses/soco/projects/data-compression/lossy/jpeg/coeff.htm
INTRODUCTION
Adds a another Dimension to image.Indicate the states
Red - ?Green?
Adds Depth to the image – Background & Dense in Nature
Presenting Information
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
25
In Physics?
Visible Light – Electromagnetic Spectrum Radiation or Radiant Energy
Frequency Ranges ??????????Radiant Energy is measured in terms
Wavelength & FrequencyRelationship??????Velocity of light c = 3 x 108 Meters
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
26
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
27
COLOR
Primary ColorComplementary ColorApproaches
AdditiveSubtrative
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
28
COLOR CHARACTERISTICS
Luminance or Brightness – Emitted or reflected from object
Hue – Color AppearancesSaturation – Color Intensity
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
29
COLOR MODELS
Chromacity ModelRGB ModelHSI ModelCMY ModelYUV or YUI Model
B/W TV or COLOR IMAGE COMPOSITION
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
30
JOINT PHOTOGRAPHIC EXPERTS GROUP COMPRESSION
JPEG – Joint ISO & CCITT Working Committee - exclusively for Still Image
Joint Committee – MPEG – Full Motion Standards
Works with colour and greyscale images Up to 24 bit colour images Suitable for many applications e.g.,
satellite, medical, general photography...
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
31
04/20/23 32
JPEG Modes of Operation
Sequential DCT: the image is encoded in one left-to-right, top-to-bottom scan
Progressive DCT: the image is encoded in multiple scans (if the transmission time is long, a rough decoded image can be reproduced)
Hierarchical: encoding at multiple resolutions
Lossless : exact reproductionA.Aruna, Assistant Professor,
Faculty of Information Technology
JPEG Standards Level
Baseline – Maintain High Compression Ratio
Special Lossless Function – No Loss of Data
Extended System – Various Encoding Variable Length Encoding Progressive Length Encoding Hierarchical Encoding
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
33
OVERVIEW OF JPEG STANDARDS
Components Baseline Sequential Codec – DCT
Coefficients, Quantization And Entropy Encoding
DCT Progressive Mode – Multiple Scans – Until Reached Picture Quality (Based on Quantization)
Predictive Lossless EncodingHierarchical Mode – Different Resolution
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
34
JPEG IMPLEMENTATION
Discrete Cosine Transformation Reduce the level in Gray Scale and
Color Image ( 2D – Amplitude & Frequency)
Reduce Series of DataRemove The redundant data ( time to
frequency Domain)
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
35
04/20/23 36A.Aruna, Assistant Professor, Faculty of Information
Technology
DCT
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
37
INPUT
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
38
140 144 147 140 140 155 179 175
144 152 140 147 140 148 167 179
152 155 136 167 163 162 152 172
168 145 156 160 152 155 136 160
162 148 156 148 140 136 147 162
147 167 140 155 155 140 136 162
136 156 123 167 162 144 140 147
148 155 136 155 152 147 147 136
OUTPUT
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
39
186 -18 15 -9 23 -9 -14 19
21 -34 26 -9 -11 11 14 7
-10 -24 -2 6 -18 3 -20 -1
-8 -5 14 -15 -8 -3 -3 8
-3 10 8 1 -11 18 18 15
4 -2 -18 8 8 -4 1 -7
9 1 -3 4 -1 -7 -1 -2
0 -8 -2 2 1 4 -6 0
Quantization
Precision of Integer – Reduce No. of bits is used to store the values
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
40
04/20/23 41
Quantization Step
Reduces the amplitude of coefficients which contribute little or nothing to 0
Discards information which is not visually significant
Quantization coefficients Q(u,v) are specified by quantization tables
A set of 4 tables are specified by JPEG
A.Aruna, Assistant Professor, Faculty of Information
Technology
04/20/23 42
Quantization Tables
for (i=0; i < 64; i++)
for (j=0; j < 64; j++) Q[i,j] = 1 + [ (1+i+j) quality]; quality = 1: best quality, lowest compressionquality = 25: poor quality, highest compression
A.Aruna, Assistant Professor, Faculty of Information
Technology
04/20/23 43
Entropy Encoding
Encodes sequences of quantized DCT coefficients into binary sequences
AC: (runlength, size) (amplitude)DC: (size, amplitude)runlength: number consecutive 0’s, up to 15
takes up to 4 bits for coding(39,4)(12) = (15,0)(15,0)(7,4)(12)
amplitude: first non-zero valuesize: number of bits to encode amplitude 0 0 0 0 0 0 476: (6,9)(476)
A.Aruna, Assistant Professor, Faculty of Information
Technology
04/20/23 44
Huffman coding
Converts each sequence into binaryFirst DC following with ACsHuffman tables are specified in JPEGEach (runlength, size) is encoded
using Huffman codingEach (amplitude) is encoded using a
variable length integer code(1,4)(12) => (11111101101100)
A.Aruna, Assistant Professor, Faculty of Information
Technology
04/20/23 45
Example of Huffman table
A.Aruna, Assistant Professor, Faculty of Information
Technology
VIDEO COMPRESSION
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
46
INTRODUCTION
Distribute the information to larger places
ApplicationVideo teleconferencing Digital Telephony
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
47
STANDARDS
P*64 (CCITT) – Video ConferencingJPEG (ISO)- Still Image MPEG (ISO) – Stored Video
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
48
Requirements for Full Motion Video Compression
Random Access – IndexingVCR Paradigm –
play,fast,forward,rewind,stop,search forward, etc.,
Audio & Video SynchronizationMultiplexing multiple compressed Audio
and Video Bit StreamsEditabilityPlayback Device Flexibility
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
49
CCITT H.261 Video Coding Algorithm(px64)
Developed in 1990’sVideophone and Video ConferencingCIF (Common Interchange File
Formats) & QCIF(Quarter CIF)Hierarchical Block Structure –
Encoding DataDCT & DPCM
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
50
AUDIO COMPRESSION
ADAPTIVE DIFFERENCIAL PULSE CODE MODULATION
04/20/23 A.Aruna, Assistant Professor, Faculty of Information
Technology
51