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

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 Irfanview, 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. Be sure to label your figures.
  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. All source programs must be well documented.
  2. Graduate students must do all assignments individually. Undergraduate students may collaborate in groups of 2 for assignments. Only one submission with both names should be turned in from a group.
  3. Clearly label your answers, and please submit answers in the order assigned.
  4. (repeated from course syllabus) Academic Honesty: Unless explicitly stated otherwise, students are not permitted to access or compare any homework, or program-project answers with those of any other student or group past or present, alive or dead, or any Internet web site prior to submitting the assignment. Comparing answers, or getting answers off the Internet before submitting one's work is considered cheating. If you do not have time to complete an assignment, it is better to submit partial solutions than to get answers from someone else. While it is obviously difficult to enforce this policy, students who do not follow this policy should be keenly aware that in this class, they a re cheating, and if caught, will be prosecuted according to University guidelines. This applies both to the student (or group) who gets answers and the student (or group) who gives answers.
  5. (repeated from course syllabus)  Lateness Policy: Assignments are due at the beginning of class. Unexcused late assignments will be penalized up to 10% per school day (weekends do not count) up to a 2-day maximum penalty of 20%. Without prior discussion with the professor, assignments will not be accepted more than two school days late without a university approved excuse.