typedef INT16 FSERROR; /* 16 bits should be enough */
typedef int LOCFSERROR; /* use 'int' for calculation temps */
#else
-typedef INT32 FSERROR; /* may need more than 16 bits */
-typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */
+typedef JPEG_INT32 FSERROR; /* may need more than 16 bits */
+typedef JPEG_INT32 LOCFSERROR; /* be sure calculation temps are big enough */
#endif
typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */
int c1min, c1max;
int c2min, c2max;
/* The volume (actually 2-norm) of the box */
- INT32 volume;
+ JPEG_INT32 volume;
/* The number of nonzero histogram cells within this box */
long colorcount;
} box;
{
register boxptr boxp;
register int i;
- register INT32 maxv = 0;
+ register JPEG_INT32 maxv = 0;
boxptr which = NULL;
for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
histptr histp;
int c0,c1,c2;
int c0min,c0max,c1min,c1max,c2min,c2max;
- INT32 dist0,dist1,dist2;
+ JPEG_INT32 dist0,dist1,dist2;
long ccount;
c0min = boxp->c0min; c0max = boxp->c0max;
int maxc0, maxc1, maxc2;
int centerc0, centerc1, centerc2;
int i, x, ncolors;
- INT32 minmaxdist, min_dist, max_dist, tdist;
- INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
+ JPEG_INT32 minmaxdist, min_dist, max_dist, tdist;
+ JPEG_INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */
/* Compute true coordinates of update box's upper corner and center.
* Actually we compute the coordinates of the center of the upper-corner
{
int ic0, ic1, ic2;
int i, icolor;
- register INT32 * bptr; /* pointer into bestdist[] array */
+ register JPEG_INT32 * bptr; /* pointer into bestdist[] array */
JSAMPLE * cptr; /* pointer into bestcolor[] array */
- INT32 dist0, dist1; /* initial distance values */
- register INT32 dist2; /* current distance in inner loop */
- INT32 xx0, xx1; /* distance increments */
- register INT32 xx2;
- INT32 inc0, inc1, inc2; /* initial values for increments */
+ JPEG_INT32 dist0, dist1; /* initial distance values */
+ register JPEG_INT32 dist2; /* current distance in inner loop */
+ JPEG_INT32 xx0, xx1; /* distance increments */
+ register JPEG_INT32 xx2;
+ JPEG_INT32 inc0, inc1, inc2; /* initial values for increments */
/* This array holds the distance to the nearest-so-far color for each cell */
- INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
+ JPEG_INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
/* Initialize best-distance for each cell of the update box */
bptr = bestdist;