Documente Academic
Documente Profesional
Documente Cultură
Introduction
Compression is a way to reduce the number of
bits in a frame but retaining its meaning.
Decreases space, time to transmit, and cost
Technique is to identify redundancy and to
eliminate it
If a file contains only capital letters, we may
encode all the 26 alphabets using 5-bit
numbers instead of 8-bit ASCII code
Introduction
If the file had n-characters, then the savings
= (8n-5n)/8n => 37.5%
Lossy Compression
where the aim is to obtain the best possible fidelity for a
given bit-rate or minimizing the bit-rate to achieve a
given fidelity measure. Video and audio compression
techniques are most suited to this form of compression.
Broad Classification
Entropy Coding (statistical)
lossless; independent of data characteristics
e.g. RLE, Huffman, LZW, Arithmetic coding
Source Coding
lossy; may consider semantics of the data
depends on characteristics of the data
e.g. DCT, DPCM, ADPCM, color model transform
Compression methods
Run-length Coding
Entropy Coding
Huffman Coding
Arithmetic Coding
DPCM
Prediction
Source Coding
DM
FFT
Transformation
DCT
Bit Position
Layered Coding
Sub-sampling
Sub-band Coding
Vector Quantization
JPEG
MPEG
Hybrid Coding
H.261
DV1 RTV, DV1 PLV
Source Coding
Channel Coding
Decoding
x-y
+
x-y
+
x
-
Prediction
Prediction
Past
Values (C)
Past
Values (C)
Encoder
Decoder
Differential/Predictive Encoding
Encoding the difference between actual value and a
prediction of that value
How they work?
When consecutive change little
Suited for audio and video
Predictive Coding
Number of Techniques
Differential Pulse Code Modulation (DPCM)
Delta Modulation (DM)
Adaptive Pulse Code Modulation (APCM)
fn an k f n k
k 1
en f n fn
when t = 1, we get ...
Usually, t is between 2 and 4 (in this case it is called a linear predictor
We might need to have a truncating or rounding operation following
the prediction computation
f 1 f f
n
n2
2 n 1
e f f
n
+
-
DPCM
Encoder
Previous
Sample
Difference
+
DPCM
Decoder
difference
+
Previous
Sample
Sample
~
1 ~
fn
f n 1 f n 2
2
e f f
n
255 en
e~n Q[en ] 16 *
256 8
16
f (n)
n
f (n) 156,157,158,158,156,156,154,154,155
f (n) 156,1,1,0,1,0,1,0,1
DPCM decoding
The difference is added to the previous
sample to obtain the value of the current
sample.
Delta Modulation
Modification of DPCM
Uses only 1 bit to encode difference.
Sets 1 if the difference increases
Sets 0 if the difference decreases
Delta Modulation
DM (Delta Modulation) is a simplified
version of DPCM that is used as a quick
analog-to-digital converter.
JPEG - Quantization
The DCT output matrix is quantized to reduce the precision of the
coefficients.
This increases the compression DCT(0, 0) is known as the DC
coefficient which represents the basic colour, i.e., wave-length, of the
image block
The other DCT coefficients are known as AC coefficients which
represent the frequency components of the data block.
AC coefficients further away from the DC coefficient can be dropped
to reduce the data size
JPEG baseline algorithm defines a set of quantization tables
Each element q in the table, known as quantum is used in the
following formula to calculate the quantized coefficients Q:
Vector Quantization
Divide the data stream into blocks or vectors
One or two dimensional blocks
Use codebooks
Find the closest symbol in codebook for a
given sample
Transmit the reference to that symbol
Codebook present at sender/receiver
When no exact match, could send the error
Lossy or lossless
Vector Quantization
Two Dimensional Voronoi Diagram
Vector Quantization
Source Image
..
..
Training Vector
Index (j)
1
2
3
16,384
x16384(1) x16384(16)
Vector Quantization
Training Vector
Index (j)
1
2
3
16,384
x16384(1) x16384(16)
Codebook Design
Codebook Table
Vector Quantization
New Image (Index Table)
i1
i5
i39
i10
i45
i45
i200
i12
i54
i256
i96
i78
i256
i54
i5
i9
Codebook Table
.(1)
Intro
Compression Formula
Amount of compression:
Codebook size is K, input vector of dimension L
In order to inform the decoder of which code vector is selected, we
need to use log 2 K bits.
E.g. need 8 bits to represent 256 code vectors.
Summary
For Audio and Vedio compression , we use
the technique of Differential /Predictive
Coding with quantization.
For an Image compression, we can use DCT
methode with quantization.
Question..?
Submitted by,
Nikheesh
Fifth Semester MCA
CCSIT,CU Campus