Course: CIS451/651 Data
Compression in Multimedia
Professor: Paul D. Amer
Semester: Spring 2009
Title: Homework - Chapters 8 and 9 - Lossy
mathematical preliminaries and Scalar Quantization
Due Date:
Tasks
Read Chapter 8 with emphasis on Sections 8.3 and 8.6.1. Omit Section 8.5.
Read Chapter 9 with emphasis on Sections 9.1-9.4, 9.6. Omit Section 9.7.
- (11 pts) Midrise
vs. Midtread Quantizers
- Recall two scalar quantizers evaluated in class for encoding an analog
source generating values over the domain [-4.0, +4.0].
The midrise quantizer
defined 8 equal sized intervals; the midtread quantizer defined 7 equal intervals. For this question, only consider the versions that used the interval midpoints as the reconstructed values. In class,
evaluation of these two quantizers assumed the
source input was uniform.
- Now suppose the
source is non-uniform as follows. Assume 1/2 of the generated values are expected to be exactly 0, and the other 1/2 are uniform over the full domain [-4.0, +4.0]. Hence for the midrise quantizer, the interval [0,1) is expected to contain 9/16 of the values; and for the midtread quantizer, the interval [-4/7, +4/7) is expected to contain 8/14 of the values.
Compare/contrast the midrise and midtread quantizers for this nonuniform input. That is,
- (1pt each) compute the entropy of the system for each quantizer
- (2pts each) graph each quantizer's squared error for the full domain
- (2pts each) compute each quantizer’s expected mean squared error
- (1 pt) argue which, if either, quantizer is better?
- (10 pts) Chapter 8: Projects and Problems:
1(a) [1(b) is not required]
- Perform modifications to two images:
sena.img and
earth.img.
You will need to write a simple program
in the language of your choice. For both reconstructions for both images, compute
the new pixel values "without wraparound". That is, when
adding 10 to any pixel in the domain [246-255], the resultant pixel would
be 255. When subtracting 10 from any pixel in the domain [0-9], the
resultant pixel would be 0.
- (submit) a copy of your well-commented program.
- (submit) Using Sayood's program distimg.c, calculate the SNR and other metrics for each of the four reconstruction. What do you observe about the metrics for the two reconstructions of the same starting image?
- (submit) For both sena and earth, view and print out
the original and the two modified images. Note: to view a .img file, use Sayood's program convpgm.c to convert from .img to .pgm, and
then use the unix program xv (or other
available image software such as GIMP) to view and print the .pgm image file.
- (submit) In your opinion, does one
reconstructed image more closely match the original? What does your opinion say about SNR and the other metrics?
- (6 pts) Image Scalar Quantization
- (submit) Use Sayood's programs uqimg_enc.c and uqimg_dec.c to reproduce the scalar-quantized 1bpp, 2bpp and 3bpp images of
sena.img
as shown in
Figure 9.7 and earth.img.
For both sena and earth, print 4 figures as done in Figure 9.7.
- (submit) Use Sayood's program distimg.c, and make a table comparing the SNR and PSNR of the 1, 2, and 3 bit images you produced.
- (Extra Credit 4 pts) Specify a scalar quantizer that inputs values
over the domain [0,127.5) and outputs the value rounded to the nearest integer represented as a 7-bit unsigned integer.
For example, an input of 65.83 results in an output of 1000010; an input of 65.306
results in an output of 1000001.
Assuming the input is uniformly distributed, compute the mean squared error.
Provide a figure to help clarify your mean squared error computation.
- (Extra Credit 4 pts) Specify a scalar quantizer that resides inside a digital scale capable of weighing objects over the domain [0-300) pounds in 1/2 pound increments. Assume the scale truncates not rounds (a feature that customers like!) Assuming the input is uniformly distributed, (note: for human beings, this assumption is invalid.) compute the mean squared error.
Provide a figure to help clarify your mean squared error computation.
Notes
- For all tasks where you
write a program, submit well-commented source listings of your code.
- Students may work
individually or in groups of 2. Students in different
groups may NOT compare answers prior to submitting their work.
Only one submission should be turned in from each group. See the
course syllabus for a full statement of the lateness and academic honesty
policies.