NAME

     dpc_compress - compresses an image using differential  pulse
     code modulation

SYNOPSIS

      #include "CVIPimage.h"
      #include "CVIPcompress.h"
      #include <sys/stat.h>

     int dpc_compress(Image *inputImage,  char  *filename,  float
     ratio,  int   bit_length,  int  clipping, int direction, int
     origin)

      <inputImage> - a pointer to an Image structure
      <filename> - pointer to char string containing filename
      <ratio> - the correlation factor
      <bit_length> - number of bits for compression (1 to 8)
      <clipping> - clip to maximum value (1), otherwise 0
      <direction> - scan image horizontally (0) or vertically (1)
      <origin> - use original (1) or reconstructed (0) values

     Image *dpc_decompress(char *filename)

      <filename> - compressed file

PATH

     $CVIPHOME/COMPRESSION/dpcm.c

DESCRIPTION

     DPCM is a compression technique  that  uses  the  predictive
     method of differential pulse code modulation. It is based on
     the observation that adjacent pixels are  highly  correlated
     within  real  images,  and it is wasteful to store repeated,
     large values to represent consecutive pixels.  Rather,  DPCM
     stores  an initial value, followed by the difference between
     the initial value and subsequent pixel values. For  example,
     a  line  of  10  white pixels (value = 255) would usually be
     represented in 80 bits(8 bits/pixel X  10  pixels),  whereas
     with  DPCM, only 17 bits are needed: the first pixel needs 8
     bits, but each of the other  pixels  only  requires  1  bit,
     since  the difference between the initial value and the oth-
     ers is zero (255 - 255 = 0).

TYPES AND CONSTANTS

     none

RETURN VALUES

     dpc_compress: 0 on success, -1 on failure

     dpc_decompression: an uncompressed image pointer on success,
     a NULL pointer on failure

HISTORY

     History information recorded: None

BUGS

     None at this time

SEE ALSO

     libcompress

AUTHOR

     Copyright (C) 1996 SIUE - by Scott Umbaugh.