README.txt file for DP image coder.
Ivan V. Bajic, 2005.

--------------------------------------------------------------
The program supports grayscale PGM and raster images only. It might not be too difficult to add support for other formats, but I have not done so yet.

--------------------------------------------------------------
To compile the files for DP image coder:

1. Unzip the archive into a chosen directory, say 'c:\DPimage'
2. Open the file 'MakefileWin.dsw'
3. Change the HOME directory in 'MakefileWin.dsw' to your chosen directory, say 'c:\DPimage'
4. You may also need to change the LIB and LINK directories in 'MakefileWin.dsw' depending on where your Microsoft Visual C compiler is installed.
5. Build the project - this will create two files in the 'bin' subdirectory: 'packetize.exe' and 'depacketize.exe'

--------------------------------------------------------------
To change the type of error concealment used in the decoder:

1. Change the value of the global constant CONCEAL in 'depacketize.c' - choices are explained in the file.
2. Build the project.

--------------------------------------------------------------
To run 'packetize.exe':

If used for PGM images (default), us as
         packetize [input image][output file][ratio]
    e.g. packetize lena.pgm lenaenc 32

This will create 17 files, one header that starts with 'h' (hlenaenc) and 16 packet files that start    with 's' (slenaenc000, slenaenc001, ..., slenaenc015). The version provided only supports 16 packets. To change the number of packets, you need to change the code.

If used for raster images, use as
         packetize [input image][width][height][output image][ratio]

Prior to running in the raster mode, change the global constant RASTER in 'packetize.c' to 1 and recompile. For PGM mode, set this constant to 0.

--------------------------------------------------------------
To run 'depacketize.exe':

         depacketize [encoded image] [decoded image] [original image] [lost packets file] [result file]
    e.g. depacketize lenaenc lenadec lena.pgm missa1_16.txt lena_results.txt

[lost packets file] contains indices of lost packets (these are not used in decoding). A single row of this file specifies the packets lost in a single run. Each row is terminated by 10000. If there are more than one rows in this file, the decoder will keep decoding each rin in turn, and calculate average PSNR upon completion. Results are stored in [result file]. Some examples of [lost packet file] are included in the archive.

Note that if MAP error concealment is selected (CONCEAL constant set to 5 in 'depacketize.c'), the decoder needs to have access to the file named 'MAP_parameters.txt'. One such file is included in the archive. Parameters can be changed to optimize the performance. 

