ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove2.c
(Generate patch)

Comparing ray/src/util/ranimove2.c (file contents):
Revision 3.5 by schorsch, Sun Jul 27 22:12:04 2003 UTC vs.
Revision 3.8 by greg, Tue Apr 19 01:15:07 2005 UTC

# Line 21 | Line 21 | static const char      RCSid[] = "$Id$";
21  
22   int     cerrzero;               /* is cerrmap all zeroes? */
23  
24 + static int ppri_cmp(const void *pp1, const void *pp2);
25 + static int ray_refine(int       n);
26 + static long refine_rays(long    nrays);
27  
28 < int
29 < refine_first()                  /* initial refinement pass */
28 >
29 > extern int
30 > refine_first(void)                      /* initial refinement pass */
31   {
32          int     *esamp = (int *)zprev;  /* OK to reuse */
33          int     hl_erri = errori(HL_ERR);
# Line 117 | Line 121 | struct ConspSum {
121   static double   pixel_deg;      /* base pixel frequency */
122   static int      fhsiz, fvsiz;   /* foveal subimage size */
123  
124 + static void clr_consp(struct ConspSum *cs);
125 + static void sum_consp(struct ConspSum *cdest, struct ConspSum *cs);
126 + static void est_consp(int x0, int y0, int x1, int y1, struct ConspSum *cs);
127 + static void subconspicuity(int x0, int y0, int x1, int y1, struct ConspSum *cs);
128 +
129   static void
130 < clr_consp(cs)                   /* initialize a conspicuity sum */
131 < register struct ConspSum        *cs;
130 > clr_consp(                      /* initialize a conspicuity sum */
131 >        register struct ConspSum        *cs
132 > )
133   {
134          if (cs == NULL)
135                  return;
# Line 132 | Line 142 | register struct ConspSum       *cs;
142   }
143  
144   static void
145 < sum_consp(cdest, cs)            /* sum in conspicuity result */
146 < register struct ConspSum        *cdest, *cs;
145 > sum_consp(              /* sum in conspicuity result */
146 >        register struct ConspSum        *cdest,
147 >        register struct ConspSum        *cs
148 > )
149   {
150          if ((cdest == NULL) | (cs == NULL))
151                  return;
# Line 148 | Line 160 | register struct ConspSum       *cdest, *cs;
160   }
161  
162   static void
163 < est_consp(x0,y0,x1,y1, cs)      /* estimate error conspicuity & update */
164 < int     x0, y0, x1, y1;
165 < register struct ConspSum        *cs;
163 > est_consp(      /* estimate error conspicuity & update */
164 >        int     x0,
165 >        int     y0,
166 >        int     x1,
167 >        int     y1,
168 >        register struct ConspSum        *cs
169 > )
170   {
171          double  rad2, mtn2, cpd, vm, vr, csf, eest;
172                                                  /* do we care? */
# Line 217 | Line 233 | register struct ConspSum       *cs;
233                                                  /* worth the bother? */
234          if (eest <= .01)
235                  return;
236 <                                                /* sum into map */
236 >                                                /* put into map */
237          for ( ; y0 < y1; y0++) {
238                  float   *em0 = cerrmap + fndx(x0, y0);
239                  register float  *emp = em0 + (x1-x0);
240                  while (emp-- > em0)
241 <                        *emp += eest;
241 >                        if (eest > *emp)
242 >                                *emp = eest;
243          }
244          cerrzero = 0;
245   }
246  
247   static void
248 < subconspicuity(x0,y0,x1,y1, cs) /* compute subportion of conspicuity */
249 < int     x0, y0, x1, y1;
250 < struct ConspSum *cs;
248 > subconspicuity( /* compute subportion of conspicuity */
249 >        int     x0,
250 >        int     y0,
251 >        int     x1,
252 >        int     y1,
253 >        struct ConspSum *cs
254 > )
255   {
256          struct ConspSum mysum;
257          int     i;
# Line 289 | Line 310 | struct ConspSum        *cs;
310          sum_consp(cs, &mysum);
311   }
312  
313 < void
314 < conspicuity()                   /* compute conspicuous error map */
313 > extern void
314 > conspicuity(void)                       /* compute conspicuous error map */
315   {
316          int     fhres, fvres;
317          int     fx, fy;
# Line 330 | Line 351 | static struct AmbSum {
351  
352  
353   static int
354 < ppri_cmp(pp1, pp2)              /* pixel priority comparison */
355 < const void *pp1, *pp2;
354 > ppri_cmp(               /* pixel priority comparison */
355 >        const void *pp1,
356 >        const void *pp2
357 > )
358   {
359          double  se1 = cerrmap[*(const int *)pp1];
360          double  se2 = cerrmap[*(const int *)pp2];
# Line 351 | Line 374 | const void *pp1, *pp2;
374  
375  
376   static int
377 < ray_refine(n)                   /* refine the given pixel by tracing a ray */
378 < register int    n;
377 > ray_refine(                     /* refine the given pixel by tracing a ray */
378 >        register int    n
379 > )
380   {
381          RAY     ir;
358        int     neigh[NSAMPOK];
359        int     nc;
382          COLOR   ctmp;
383          int     i;
384  
# Line 374 | Line 396 | register int   n;
396                          return(-1);
397                  if (nprocs > 1) {
398                          int     rval;
399 <                        rayorigin(&ir, NULL, PRIMARY, 1.0);
399 >                        rayorigin(&ir, PRIMARY, NULL, NULL);
400                          ir.rno = n;
401                          rval = ray_pqueue(&ir);
402                          if (!rval)
# Line 419 | Line 441 | register int   n;
441  
442  
443   static long
444 < refine_rays(nrays)              /* compute refinement rays */
445 < long    nrays;
444 > refine_rays(            /* compute refinement rays */
445 >        long    nrays
446 > )
447   {
448          int     *pord;
449          int     ntodo;
# Line 463 | Line 486 | long   nrays;
486   }
487  
488  
489 < int
490 < refine_frame(pass)              /* refine current frame */
491 < int     pass;
489 > extern int
490 > refine_frame(           /* refine current frame */
491 >        int     pass
492 > )
493   {
494          static double   rtime_used = 0;
495          static long     ray_cnt = 0;
# Line 554 | Line 578 | if (pass == 1) {
578                                          /* compute refinement rays */
579          if (!silent) {
580                  printf("\tRefinement pass %d...",
581 <                                pass+1, rays_todo);
581 >                                pass+1); /*, rays_todo); */
582                  fflush(stdout);
583          }
584          if (asump != NULL)              /* flag low-quality samples */
# Line 564 | Line 588 | if (pass == 1) {
588                                          /* trace those rays */
589          nr = refine_rays(rays_todo);
590          if (!silent)
591 <                printf("traced %d HQ rays\n", nr);
591 >                printf("traced %ld HQ rays\n", nr);
592          if (nr <= 0)
593                  return(0);
594                                          /* update timing stats */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines