home *** CD-ROM | disk | FTP | other *** search
/ Los Alamos National Laboratory / LANL_CD.ISO / software / compres / src / src_rle / encode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-12  |  433 b   |  21 lines

  1. main(argc, argv) char **argv; {
  2.     int ncv, nbyte, nindex, *indices;
  3.     char *ifile, *ofile;
  4.  
  5.     if(argc != 4) {
  6.         printf("Usage: %s ifile ofile ncv\n", argv[0]);
  7.         exit(-1);
  8.     }
  9.  
  10.     ifile = argv[1];
  11.     ofile = argv[2];
  12.     ncv = atoi(argv[3]);
  13.  
  14.     nbyte = cread2(ifile, &indices);
  15.     nindex = nbyte / sizeof(float);
  16.  
  17.     rle_encode(&indices, &nindex, ncv);
  18.  
  19.     cwrite(ofile, indices, nindex*sizeof(int), 0);
  20. }
  21.