<< Chapter < Page Chapter >> Page >
This module introduces practical entropy coding techniques, such as Huffman Coding, Run-length Coding (RLC) and Arithmetic Coding.

In the module of Use of Laplacian PDFs in Image Compression we have assumed that ideal entropy coding has been used in order to calculate the bitrates for the coded data. In practise we must use real codes and we shall now see how this affects the compression performance.

There are three main techniques for achieving entropy coding:

  • Huffman Coding - one of the simplest variable length coding schemes.
  • Run-length Coding (RLC) - very useful for binary data containing long runs of ones of zeros.
  • Arithmetic Coding - a relatively new variable length coding scheme that can combine the best features ofHuffman and run-length coding, and also adapt to data with non-stationary statistics.
We shall concentrate on the Huffman and RLC methods for simplicity. Interested readers may find out more aboutArithmetic Coding in chapters 12 and 13 of the JPEG Book.

First we consider the change in compression performance if simple Huffman Coding is used to code the subimages of the4-level Haar transform.

The calculation of entropy in this equation from our discussion of entropy assumed that each message with probability p i could be represented by a word of length i 2 logbase --> p i bits. Huffman codes require the i to be integers and assume that the p i are adjusted to become:

p i ^ 2 i
where the i are integers, chosen subject to the constraint that i p i ^ 1 (to guarantee that sufficient uniquely decodable code words are available) and such that the mean Huffman word length(Huffman entropy), H ^ i p i i , is minimised.

We can use the probability histograms which generated the entropy plots in figures of level 1 energies , level 2 energies , level 3 energies and level 4 energies to calculate the Huffman entropies H ^ for each subimage and compare these with the true entropies to see the loss in performance caused by using realHuffman codes.

An algorithm for finding the optimum codesizes i is recommended in the JPEG specification [ the JPEG Book , Appendix A, Annex K.2, fig K.1]; and a Mathlab M-file toimplement it is given in M-file code .

Comparison of entropies (columns 1, 3, 5) and Huffman coded bit rates (columns 2, 4, 6) for the original (columns 1 and2) and transformed (columns 3 to 6) Lenna images. In columns 5 and 6, the zero amplitude state is run-length encoded toproduce many states with probabilities<0.5.
Numerical results used in the figure - entropies and bit rates of subimages for qstep=15
Column: 1 2 3 4 5 6 -
0.0264 0.0265 0.0264 0.0266
0.0220 0.0222 0.0221 0.0221 Level 4
0.0186 0.0187 0.0185 0.0186
0.0171 0.0172 0.0171 0.0173 -
0.0706 0.0713 0.0701 0.0705
0.0556 0.0561 0.0557 0.0560 Level 3
3.7106 3.7676 0.0476 0.0482 0.0466 0.0471 -
0.1872 0.1897 0.1785 0.1796
0.1389 0.1413 0.1340 0.1353 Level 2
0.1096 0.1170 0.1038 0.1048 -
0.4269 0.4566 0.3739 0.3762
0.2886 0.3634 0.2691 0.2702 Level 1
0.2012 0.3143 0.1819 0.1828 -
Totals: 3.7106 3.7676 1.6103 1.8425 1.4977 1.5071

shows the results of applying this algorithm to the probability histograms and lists the same results numerically for ease of analysis. Columns 1 and 2 compare theideal entropy with the mean word length or bit rate from using a Huffman code (the Huffman entropy) for the case of theuntransformed image where the original pels are quantized with Q step 15 . We see that the increase in bit rate from using the real code is: 3.7676 3.7106 1 1.5 % But when we do the same for the 4-level transformed subimages, we get columns 3 and 4. Here we see thatreal Huffman codes require an increase in bit rate of: 1.8425 1.6103 1 14.4 % Comparing the results for each subimage in columns 3 and 4, wesee that most of the increase in bit rate arises in the three level-1 subimages at the bottom of the columns. This is becauseeach of the probability histograms for these subimages (see figure ) contain one probability that is greater than 0.5. Huffman codes cannot allocate a word length ofless than 1 bit to a given event, and so they start to lose efficiency rapidly when 2 logbase --> p i becomes less than 1, ie when p i 0.5 .

Questions & Answers

A golfer on a fairway is 70 m away from the green, which sits below the level of the fairway by 20 m. If the golfer hits the ball at an angle of 40° with an initial speed of 20 m/s, how close to the green does she come?
Aislinn Reply
cm
tijani
what is titration
John Reply
what is physics
Siyaka Reply
A mouse of mass 200 g falls 100 m down a vertical mine shaft and lands at the bottom with a speed of 8.0 m/s. During its fall, how much work is done on the mouse by air resistance
Jude Reply
Can you compute that for me. Ty
Jude
what is the dimension formula of energy?
David Reply
what is viscosity?
David
what is inorganic
emma Reply
what is chemistry
Youesf Reply
what is inorganic
emma
Chemistry is a branch of science that deals with the study of matter,it composition,it structure and the changes it undergoes
Adjei
please, I'm a physics student and I need help in physics
Adjanou
chemistry could also be understood like the sexual attraction/repulsion of the male and female elements. the reaction varies depending on the energy differences of each given gender. + masculine -female.
Pedro
A ball is thrown straight up.it passes a 2.0m high window 7.50 m off the ground on it path up and takes 1.30 s to go past the window.what was the ball initial velocity
Krampah Reply
2. A sled plus passenger with total mass 50 kg is pulled 20 m across the snow (0.20) at constant velocity by a force directed 25° above the horizontal. Calculate (a) the work of the applied force, (b) the work of friction, and (c) the total work.
Sahid Reply
you have been hired as an espert witness in a court case involving an automobile accident. the accident involved car A of mass 1500kg which crashed into stationary car B of mass 1100kg. the driver of car A applied his brakes 15 m before he skidded and crashed into car B. after the collision, car A s
Samuel Reply
can someone explain to me, an ignorant high school student, why the trend of the graph doesn't follow the fact that the higher frequency a sound wave is, the more power it is, hence, making me think the phons output would follow this general trend?
Joseph Reply
Nevermind i just realied that the graph is the phons output for a person with normal hearing and not just the phons output of the sound waves power, I should read the entire thing next time
Joseph
Follow up question, does anyone know where I can find a graph that accuretly depicts the actual relative "power" output of sound over its frequency instead of just humans hearing
Joseph
"Generation of electrical energy from sound energy | IEEE Conference Publication | IEEE Xplore" ***ieeexplore.ieee.org/document/7150687?reload=true
Ryan
what's motion
Maurice Reply
what are the types of wave
Maurice
answer
Magreth
progressive wave
Magreth
hello friend how are you
Muhammad Reply
fine, how about you?
Mohammed
hi
Mujahid
A string is 3.00 m long with a mass of 5.00 g. The string is held taut with a tension of 500.00 N applied to the string. A pulse is sent down the string. How long does it take the pulse to travel the 3.00 m of the string?
yasuo Reply
Who can show me the full solution in this problem?
Reofrir Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Pdf generation test course. OpenStax CNX. Dec 16, 2009 Download for free at http://legacy.cnx.org/content/col10278/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Pdf generation test course' conversation and receive update notifications?

Ask