Course: CIS451/651  Data Compression in Multimedia
Professor: Paul D. Amer
Semester: Spring 2009
Title:  Homework - Chapter 11 - Differential Encoding
Due Date:

Tasks

Read Chapter 11. Omit Section 11.5.
  1. (4 pts) Write a well-documented program or find existing software to count the frequency of each pixel value in an ".img" image file.  Run this program on sinan.img and earth.img
  2. (4 pts) Differential encoding
  3. (3 pts) (submit) Use xv, GIMP or other software to view and print copies of sinan.img and sinan.diff.img (and earth.img and earth.diff.img.) To view an ".img" image, use Sayood's program "convpgm.c" to produce a well-known format ".pgm" file, and then view/print the ".pgm" file. Take some time to understand why the difference images look like they do.
  4. (4 pts Extra Credit for all students) Use Sayood's huff_enc program to compute a huffman code for both sinan.img and sinan.diff.img. Save the two code files separately. huff_enc generates a fixed length code file of 1280 bytes. The format of the code file is 256 4-byte "codes" followed by 256 1-byte "lengths". The first length tells how many least significant bits of the first 4-byte code are the Huffman code for a pixel value (or pixel difference value for a difference image) of 0. The second length tells how many least significant bits of the second 4-byte code are the Huffman code for the pixel value of 1, and so on. What are the Huffman codes for both sinan.img and sinan.diff.img for the pixel values and pixel difference values, respectively, of: 126,127,128,129,130 and 253,254,255,0,1,2,3,4,5,6? Looking at the two code files, argue whether the generated Huffman codes are consistent with the histograms you produced in parts 1 and 2 above.

Notes

  1. Students may work individually or in groups of 2.   Students in different groups may NOT compare answers prior to submitting their work.  See the syllabus for a full statement of the lateness and academic honesty policies.
  2. All source programs must be well documented.