5CCSD3ZF0000100000001NJPL3IF0PDS200000001 = SFDU_LABEL&RECORD_TYPE = VARIABLE_LENGTHOBJECT = TEXTI NOTE = "Description of VAX/VMS software provided with the, Voyager CD-ROM set." END_OBJECTEND2 ------------------------------2 VAX/VMS Decompression Software2 ------------------------------AVAX/VMS software modules are supplied in the VAX subdirectory as:/ 1. Stand-alone application VAXDCOMP8 2. C-language source code for program VDCOMP< 3. C-language source code for DECOMP subroutines8 4. C-language source code for program DETEST> 5. FORTRAN-language source code for program DETESTC 6. VAX MACRO-language source code for subroutine DCMPRSB 7. FORTRAN-language source code for DECOMP subroutines? 8. FORTRAN-language source code for program VAXDRIV@ 9. FORTRAN-language source code for program IMGINDEX@These modules are described in detail in the following sections.'The VAX Stand-alone Executable VAXDCOMP(----------------------------------------HThe program VAXDCOMP creates decompressed image files and is supplied asFan executable in the VAXDCOMP.EXE file. The output files will containCfixed-length records in one of four formats (see below). The imageChistogram and all engineering parameters are discarded when writing'the FITS, VICAR and unlabelled formats.;The output formats supported all have fixed-length records:4 FORMAT RESULTING FILE7 --------------------------------------------------6 SFDU/PDS 836-byte records7 FITS 2880-byte records6 VICAR 800-byte records6 unlabelled raster 800-byte recordsKThe VAXDCOMP program assumes that file-access support for ISO-format CD-ROMJdisks is available, or that a CD-ROM utility routine has been used to read.the compressed file from CD-ROM to a VAX disk.C-language Program VDCOMP-------------------------CThe program VDCOMP is a C-language image decompression program thatCincludes all routines necessary to produce an executable version ofAthe program. It is supplied as source code in the VDCOMP.C file.AVDCOMP prompts the user for a input file name, output file formatCchoice, and output file name. The output file formats supported by0VDCOMP are identical to those of VAXDCOMP above.AVAX/VMS users may have to edit the "#include " statementBat the beginning of the file depending on their environment setup,9and may need to redefine the link library as shown below.EThe following commands should be used to link subroutines and producean executable file: cc VDCOMP2 $ define lnk$library sys$library:vaxcrtl.olb link VDCOMPE The program will need to be 'installed' in order to use command line arguments:2 $ VDCOMP :== $DISKNAME:[DIRECTORY]VDCOMP.exe6 where DISKNAME is the disk drive and DIRECTORY is the& directory where VDCOMP.EXE is stored.. Use the following command to run the program:/ VDCOMP [infile] [outfile] [output format]7 infile - name of compressed image file.: outfile - name of uncompressed output file.: output format - selected from the following list:) 1 SFDU/PDS format [DEFAULT]. 2 FITS format. 3 VICAR format.! 4 Unlabelled raster.C-language DECOMP Subroutines-----------------------------HFor those who want to write their own C-language programs, decompressionFsubroutines are provided in the DECOMP.C file. This file contains the subroutines:( decmpinit decompress6 dcmprs huff_tree sort_freq>See the example C-language program below for subroutine usage.C-language Program DETEST-------------------------GDETEST is a main program, located in the DETEST.C file, which tests theHperformance of the decompression software. Anyone adapting the softwareGto their particular hardware and operating system environment will need&this program for testing the software.FORTRAN-language Program DETEST-------------------------------7DETEST.FOR is the FORTRAN version of the above program.#FORTRAN-language DECOMP Subroutines"----------------------------------CThe FORTRAN versions of the decompression subroutines reside in the4DECOMP.FOR file. This file contains the subroutines:( DECMPINIT DECOMPRESS6 DCMPRS HUFF_TREE SORT_FREQ;See the example FORTRAN program below for subroutine usage. MACRO-language Subroutine DCMPRS --------------------------------EDCMPRS.MAR is an assembler language version of the DCMPRS subroutine.GThis routine will improve the performance of the decompression softwareJby a factor of two. This VAX/VMS assembler routine will only work with the.FORTRAN version of the decompression software. FORTRAN-language Program VAXDRIV --------------------------------IThe program VAXDRIV.FOR will decompress image files and write them out toDa PDS formatted file. The program needs to be compiled, then linked:with the DECOMP object file to produce an executable file. for vaxdriv,decomp link vaxdriv,decomp!FORTRAN-language Program IMGINDEX!---------------------------------BThe sample program IMGINDEX.FOR will read and display the contentsDof the image index table (IMGINDEX.TAB). The image index table mustEbe in the same directory as the executable for the program to operateDproperly. The FILE='IMGINDEX.TAB' statement in the OPEN call can be,edited to reflect the location of the table.Example C-language Program--------------------------IThe example program shown below demonstrates the use of the decompression subroutines.G /******************************************************************** *F * hist - Buffer to contain 511 elements of the encoding histogram.E * The encoding histogram is extracted from the image area.C * nsi - Number of bytes obtained from the read of a compressed * line.F * nso - Number of output samples after decompression. For Voyager' * images, this value is 836.9 * linei - Buffer containing the input compressed line.E * lineo - Buffer to contain the restored line after decompression.E * nl - Number of lines in the image array. For Voyager images, * this value is 800.5 * il - Loop counter for processing image lines.E ******************************************************************/ main () {B extern void decmpinit(); /* decmpinit is void function*/C extern void decompress();/* decompress is void function*/ long nsi,nso,nl,il; long hist[511];& char linei[836],lineo[836]; . .G /********************************************************************9 * Assume the encoding histogram has been extracted from; * the image file and has been placed into the hist array.7 * Pass it to the decmpinit routine for initializationG ********************************************************************/ decmpinit(hist); . .G /********************************************************************C * The loop will read one compressed line at a time from the input< * file and call the decompress routine to restore the lineG ********************************************************************/ nl = 800; nso = 836; for (il=0; i