CS 558a - Advanced Computer Networking
Project 1

Due: See class webpage.

1. Experiment with DCT transform

This project help re-enforce the DCT transform method used in JPEG encoding. In this project, you are to write 5 functions that perform the forward and reverse DCT transform on an 8x8 input matrix:

2. Driver program

Write a driver program that reads in an 8x8 pixel matrix from stdin and do the following:

  1. Prints out the 8x8 pixel matrix to stdout

  2. Use the Forward_DCT_Trans() function to perform the Forward DCT transform and prints out the 8x8 DCT (float) matrix. Use the format "%6.1f " to print each float in the matrix to make the output line up nicely.

  3. Perform the Reverse_DCT_Trans1() function to perform the Reverse DCT transform on the matrix that you have just obtained in step (1). Print the result out to stdout and compare that to the original pixel matrix. (Should be almost equal).

  4. Use Forward_Quantize() on the result from (1) and print out the results.

  5. Use Reverse_Quantize() and then Reverse_DCT_Trans2() on the result from (4) and print out the results.

    Each printing must be preceeded by a title (tell you what the program is printing.

    3. Sample Inputs

    Try your program on the following inputs:

    1. The input pixel matrix from Wallace's paper (slowly varying):
         139  144  149  153  155  155  155  155
         144  151  153  156  159  156  156  156
         150  155  160  163  158  156  156  156
         159  161  162  160  160  159  159  159
         159  160  161  162  162  155  155  155
         161  161  161  161  160  157  157  157
         162  162  161  163  162  157  157  157
         162  162  161  161  163  158  158  158
      

    2. A rapidly varying input:
         10   40   90   150  200  170  100  20
         20   60   100  161  221  181  129  40
         40   70   111  177  211  190  130  60
         70   90   90   150  199  170  170  80
         80   80   90   160  180  160  150  99
         60   60   80   140  160  150  140  80
         50   50   80   120  130  140  130  100
         40   60   90   100  120  130  120  90 
      

    3. Abrupt changes (1):
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
      

    4. Abrupt changes (2):
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
         80   80   80   80   200  200  200  200
        200  200  200  200   200  200  200  200
        200  200  200  200   200  200  200  200
        200  200  200  200   200  200  200  200
        200  200  200  200   200  200  200  200
      

    4. Turn In

    I want a Makefile that I can use to compile your programs. The object of the makefile must be main (so I can automate the grading - I will run main on my inputs).

    Turn the following in using the following turnin codes: