~ubuntu-branches/ubuntu/wily/wxwidgets3.0/wily-proposed

« back to all changes in this revision

Viewing changes to src/common/quantize.cpp

  • Committer: Package Import Robot
  • Author(s): Olly Betts
  • Date: 2014-06-18 12:42:22 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140618124222-y7t2vpsije1cesxy
Tags: 3.0.1-1
* New upstream release
  + Incorporates most of the patches we were carrying - only one left is:
    wx-config-conditionalise-webview-in-std.patch
* Drop versioning of dependencies from run-time libraries to wx-common -
  this will make the transition to the next wx version harder, and also
  makes backporting to wheezy more work.
* Mark -dbg packages as "Multi-Arch: same".
* Correct short descriptions of the webview packages to not just be
  copies of the corresponding media package's short description.
* Wrap 81 character line in package description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
337
337
          JSAMPARRAY WXUNUSED(output_buf), int num_rows)
338
338
{
339
339
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
340
 
  register JSAMPROW ptr;
341
 
  register histptr histp;
342
 
  register hist3d histogram = cquantize->histogram;
 
340
  JSAMPROW ptr;
 
341
  histptr histp;
 
342
  hist3d histogram = cquantize->histogram;
343
343
  int row;
344
344
  JDIMENSION col;
345
345
  JDIMENSION width = cinfo->output_width;
390
390
/* Find the splittable box with the largest color population */
391
391
/* Returns NULL if no splittable boxes remain */
392
392
{
393
 
  register boxptr boxp;
394
 
  register int i;
395
 
  register long maxc = 0;
 
393
  boxptr boxp;
 
394
  int i;
 
395
  long maxc = 0;
396
396
  boxptr which = NULL;
397
397
 
398
398
  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
410
410
/* Find the splittable box with the largest (scaled) volume */
411
411
/* Returns NULL if no splittable boxes remain */
412
412
{
413
 
  register boxptr boxp;
414
 
  register int i;
415
 
  register INT32 maxv = 0;
 
413
  boxptr boxp;
 
414
  int i;
 
415
  INT32 maxv = 0;
416
416
  boxptr which = NULL;
417
417
 
418
418
  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
543
543
{
544
544
  int n,lb;
545
545
  int c0,c1,c2,cmax;
546
 
  register boxptr b1,b2;
 
546
  boxptr b1,b2;
547
547
 
548
548
  while (numboxes < desired_colors) {
549
549
    /* Select box to split.
915
915
{
916
916
  int ic0, ic1, ic2;
917
917
  int i, icolor;
918
 
  register INT32 * bptr;    /* pointer into bestdist[] array */
 
918
  INT32 * bptr;    /* pointer into bestdist[] array */
919
919
  JSAMPLE * cptr;       /* pointer into bestcolor[] array */
920
920
  INT32 dist0, dist1;       /* initial distance values */
921
 
  register INT32 dist2;     /* current distance in inner loop */
 
921
  INT32 dist2;     /* current distance in inner loop */
922
922
  INT32 xx0, xx1;       /* distance increments */
923
 
  register INT32 xx2;
 
923
  INT32 xx2;
924
924
  INT32 inc0, inc1, inc2;   /* initial values for increments */
925
925
  /* This array holds the distance to the nearest-so-far color for each cell */
926
926
  INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
993
993
  hist3d histogram = cquantize->histogram;
994
994
  int minc0, minc1, minc2;  /* lower left corner of update box */
995
995
  int ic0, ic1, ic2;
996
 
  register JSAMPLE * cptr;  /* pointer into bestcolor[] array */
997
 
  register histptr cachep;  /* pointer into main cache array */
 
996
  JSAMPLE * cptr;  /* pointer into bestcolor[] array */
 
997
  histptr cachep;  /* pointer into main cache array */
998
998
  /* This array lists the candidate colormap indexes. */
999
999
  JSAMPLE colorlist[MAXNUMCOLORS];
1000
1000
  int numcolors;        /* number of candidate colors */
1050
1050
{
1051
1051
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1052
1052
  hist3d histogram = cquantize->histogram;
1053
 
  register JSAMPROW inptr, outptr;
1054
 
  register histptr cachep;
1055
 
  register int c0, c1, c2;
 
1053
  JSAMPROW inptr, outptr;
 
1054
  histptr cachep;
 
1055
  int c0, c1, c2;
1056
1056
  int row;
1057
1057
  JDIMENSION col;
1058
1058
  JDIMENSION width = cinfo->output_width;
1084
1084
{
1085
1085
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
1086
1086
  hist3d histogram = cquantize->histogram;
1087
 
  register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */
 
1087
  LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */
1088
1088
  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
1089
1089
  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
1090
 
  register FSERRPTR errorptr;   /* => fserrors[] at column before current */
 
1090
  FSERRPTR errorptr;   /* => fserrors[] at column before current */
1091
1091
  JSAMPROW inptr;       /* => current input pixel */
1092
1092
  JSAMPROW outptr;      /* => current output pixel */
1093
1093
  histptr cachep;
1162
1162
      if (*cachep == 0)
1163
1163
    fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
1164
1164
      /* Now emit the colormap index for this cell */
1165
 
      { register int pixcode = *cachep - 1;
 
1165
      { int pixcode = *cachep - 1;
1166
1166
    *outptr = (JSAMPLE) pixcode;
1167
1167
    /* Compute representation error for this pixel */
1168
1168
    cur0 -= GETJSAMPLE(colormap0[pixcode]);
1173
1173
       * Add these into the running sums, and simultaneously shift the
1174
1174
       * next-line error sums left by 1 column.
1175
1175
       */
1176
 
      { register LOCFSERROR bnexterr, delta;
 
1176
      { LOCFSERROR bnexterr, delta;
1177
1177
 
1178
1178
    bnexterr = cur0;    /* Process component 0 */
1179
1179
    delta = cur0 * 2;