Download presentation
Presentation is loading. Please wait.
1
4C8 Image Compression
2
Lossy Compression Effective bit rate = 8 bits/pixel
Effective bit rate = 1 bit/pixel (approx)
3
Transform Coding In the last set of slides we showed that transforming the image into a difference image reduces the entropy of image. G(x,y) = I(x,y) – I(x-1,y)
4
Transform Coding This is because entropy is greatest when uniform
Histogram of the original image Histogram of the difference image
5
Signal Energy
6
Lossy Transform Coding
Lossless Lossy Lossless Lossless
7
Energy Compaction with Xforms
8
The Haar Xform LoLo Hi-Lo Lo-Hi Hi-Hi
10
Implementation Details
When calculating the haar transform for the image the mid gray value is typical. Colour Images are processed by treating each colour channel as separate gray scale images. If YUV colourspace is used subsampling of the U and V channels is probable.
11
Quantisation After we create the image we quantise the transform coefficients. Step size is shown by perceptual evaluation We can assign different step sizes to the different bands. We can use different step sizes for the different colour channels. We will consider a uniform step size, Qstep, for each band for now.
12
Entropy Qstep = 15
13
Entropy Calculating the overall entropy is trickier
Qstep = 15 Calculating the overall entropy is trickier Each coefficient in a band represents 4 pixel locations in the original image. So bits/pixel = (bits/coefficient)/4 So the entropy of the transformed and quantised lenna is
14
Mistake in Fig. 5 of handout
Red Dashed Line is the Histogram. Blue bars represent the “entropies” (ie. - p * log2(p) ) and not vice versa
15
Multilevel Haar Xform
16
Calculating the Entropy for Level 2 of the transform
One Level 1 coefficient represents 4 pixels One level 2 coefficient represents 16 pixels Bands Entropy/Coeff Entropy/pixel Level 2 LoLo 5.58 0.34 LoHi 2.22 0.14 HiLo 2.99 0.19 HiHi 1.75 0.11 Level 1 1.15 0.29 1.70 0.43 0.80 Total Entropy = 1.70 bits/pixel Qstep = 15
17
Multilevel Haar Xform
18
Calculating the Entropy for Level 3 of the transform
One Level 1 coefficient represents 4 pixels One level 2 coefficient represents 16 pixels One level 3 coefficient represents 64 pixels Qstep = 15
19
Calculating the Entropy for Level 3 of the transform
One Level 1 coefficient represents 4 pixels One level 2 coefficient represents 16 pixels One level 3 coefficient represents 64 pixels Bands Entropy/Coeff Entropy/pixel Level 3 LoLo 6.42 0.10 LoHi 3.55 0.06 HiLo 4.52 0.07 HiHi 3.05 0.05 Level 2 2.22 0.14 2.99 0.19 1.75 0.11 Level 1 1.15 0.29 1.70 0.43 0.80 Total Entropy = 1.62 bits/pixel Qstep = 15
20
Multilevel Haar Xform Qstep = 15
21
Measuring Performance
Compression Efficiency - Entropy Reconstruction Quality – Subjective Analysis Haar Transform Quantisation Quantisation
22
Reconstruction Qstep = 15
23
Reconstruction Qstep = 30
24
Reconstruction Qstep = 30
Original Quantised Haar Transform + Quantisation
25
Laplacian Pdfs
26
GOAL – estimate a theoretical value for the entropy of one of the subbands
So we can estimate x0 for the band by finding the standard deviation of the coefficient values.
27
x1 = 0, x2 = Q/2 x1 = (k-1/2)Q, x2 = (k-1/2)Q
28
See Handout for Missing Steps Here
29
Measured Entropy is less than what we would expect for a laplacian pdf
Measured Entropy is less than what we would expect for a laplacian pdf. This is because the actual decay of the histogram is greater than an exponential decay.
30
Practical Entropy Coding
31
Huffman Coding
32
Practical Results
33
Remember the ideal codelength So if pk = 0.8, then
The code is inefficient because level 0 as a probability >>0.5 (0.8 approx) Remember the ideal codelength So if pk = 0.8, then However, the minimum code length we can use for a symbol is 1 bit. Therefore, we need to find a new way of coding level 0 – use run length coding
34
RLC
35
RLC coding to create “events”
13 -5 1 -1 Define max run of zeros as 8, and we are coding runs of 1, 2, 4 and 8 zeros Here we have 4 non-zero “events” 1 x Run-of-4-Zeros event 2 x Run-of-2 zeros event 1x Run-of-8-zeros event 1 x Run-of-1-zero event
36
Practical Results
38
Synchronisation Say we have a source with symbols A, B and C. Say we wish to encode the message ABBCCBCABAA using the following code table Symbol Code A B 10 C 11 The Coded message is therefore Q. What is the decoded message if the 6th bit in the stream is corrupted? Ie. We receive
39
Synchronisation 010100111101101000 The decoded stream is ABBACCACABA
Symbol Code A B 10 C 11 The decoded stream is ABBACCACABA The problem is that 1 bit error causes subsequent symbols to be decoded incorrectly as well. The stream is said to have lost synchronisation. A solution is to periodically insert synchronisation symbols into the stream (eg. One at the start of each row). This limits how far errors can propagate.
40
Summary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.