2. Overview
โข What's Comparession ?
โข Whatโs lossless and lossy compression ?
โข Whatโs JPEG?
โข The Major Steps in JPEG Coding involve:
๏ผ Transform RGB to YIQ or YUV and subsample color.
๏ผ DCT(Discrete Cosine Transformation).
๏ผ Quantization.
๏ผ Zig-zag ordering
๏ผ DPCM on DC component
๏ผ Run-length encoding.
๏ผ Entropy coding.
3. What is Comparession ?
โข Compression is the reduction in size of data
in order to save space or transmission time.
Learn how files are compressed .
4. Whatโs lossless and lossy
compression ?
โข Lossless: The compression of a file, all original
data can be recovered when the file is
uncompressed.
โข Lossy : -The compressed data is not the
same as the original data, but a close
approximation of it.
5. What is JPEG?
โข "Joint Photographic Expert Group" -- an
international standard in 1992.
โข Works with colour and greyscale images, Many
applications e.g., satellite, medical, ..
11. Quantization:
โข The quantization step is the main source for loss in JPEG
compression
โข Encoder: Each value in the current block is divided by 16
and rounded down to create the quantised block.
โข Round(DCT/Q)
68.5 21.5
-47.5 9.5
16 11
12 12
Q
4 2
-4 1
4 2
-4 1
QDCT
12. Quantization:
โข The quantization step is the main source for loss in JPEG
compression.
โข Decoder: Each value in the quantised block is multiplied
by quntize block.
4 2
-4 1
QDCT
16 11
12 12*
64 22
-48 12
Q-1
15. Zig-Zag Scan
โข Why? to group low frequency coefficients in top of vector and high
frequency coefficients at the bottom
โ26, โ3, 0, โ3, โ2, โ6, 2, โ4, 1, โ4, 1, 1, 5, 1, 2, โ1, 1, โ1, 2, 0, 0, 0,
0, 0, โ1, โ1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EOB
16. โข The 1x64 vectors have a lot of zeros in them, more so towards the end
of the vector.
โข Higher up entries in the vector capture higher frequency (DCT) components
which tend to be capture less of the content.
โข Could have been as a result of using a quantization table
โข Encode a series of 0s as a (skip,value) pair, where skip is the number of
zeros and value is the next non-zero component.
โข Send (0,0) as end-of-block sentinel value.
. . .
1x64
0 0 0 0 0 1 1 0 0 0 0 0
5,1
0 0
7,2
0 . . .2
RLEon AC Components
Run-length encode:
โ26, โ3, 0, โ3, โ2, โ6, 2, โ4, 1, โ4, {2 x 1}, 5, 1, 2, โ1, 1, โ1, 2, {5 x
0} , โ1, โ1,
17. โข Is based on the frequency of occurance of data item(pixel in image).
โข The principle is to use a lower number of bits to encode the data occurs more
frequently.
H(x)= ๐=1
๐
๐ฟ๐๐ฅ๐
๐๐ฅ๐=log 2 xi
๐ฟ number of bit for each character.
๐๐ฅ๐ entropy for each character.
Huffman Coding
18. Example
Symbol Xi sorting Xi Symol Code number ofbit
______ __ ______ _____ _____ ___________
A 0.3 0.3 A 00 2
B 0.2 0.23 C 01 2
C 0.23 0.2 B 11 2
D 0.07 0.15 E 010 3
E 0.15 0.07 D 0110 4
F 0.05 0.05 F 1110 4
H(x)= ๐=1
๐
๐ฟ๐๐ฅ๐
=2log 2 0.3 + 2log 2 0.23 + 2log 2 0.2 + 3log 2 0.15 +
4log 2 0.07 + 4log 2 0.05= -0.21