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); |
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; |
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; |
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? */ |
244 |
|
} |
245 |
|
|
246 |
|
static void |
247 |
< |
subconspicuity(x0,y0,x1,y1, cs) /* compute subportion of conspicuity */ |
248 |
< |
int x0, y0, x1, y1; |
249 |
< |
struct ConspSum *cs; |
247 |
> |
subconspicuity( /* compute subportion of conspicuity */ |
248 |
> |
int x0, |
249 |
> |
int y0, |
250 |
> |
int x1, |
251 |
> |
int y1, |
252 |
> |
struct ConspSum *cs |
253 |
> |
) |
254 |
|
{ |
255 |
|
struct ConspSum mysum; |
256 |
|
int i; |
309 |
|
sum_consp(cs, &mysum); |
310 |
|
} |
311 |
|
|
312 |
< |
void |
313 |
< |
conspicuity() /* compute conspicuous error map */ |
312 |
> |
extern void |
313 |
> |
conspicuity(void) /* compute conspicuous error map */ |
314 |
|
{ |
315 |
|
int fhres, fvres; |
316 |
|
int fx, fy; |
350 |
|
|
351 |
|
|
352 |
|
static int |
353 |
< |
ppri_cmp(pp1, pp2) /* pixel priority comparison */ |
354 |
< |
const void *pp1, *pp2; |
353 |
> |
ppri_cmp( /* pixel priority comparison */ |
354 |
> |
const void *pp1, |
355 |
> |
const void *pp2 |
356 |
> |
) |
357 |
|
{ |
358 |
|
double se1 = cerrmap[*(const int *)pp1]; |
359 |
|
double se2 = cerrmap[*(const int *)pp2]; |
373 |
|
|
374 |
|
|
375 |
|
static int |
376 |
< |
ray_refine(n) /* refine the given pixel by tracing a ray */ |
377 |
< |
register int n; |
376 |
> |
ray_refine( /* refine the given pixel by tracing a ray */ |
377 |
> |
register int n |
378 |
> |
) |
379 |
|
{ |
380 |
|
RAY ir; |
358 |
– |
int neigh[NSAMPOK]; |
359 |
– |
int nc; |
381 |
|
COLOR ctmp; |
382 |
|
int i; |
383 |
|
|
440 |
|
|
441 |
|
|
442 |
|
static long |
443 |
< |
refine_rays(nrays) /* compute refinement rays */ |
444 |
< |
long nrays; |
443 |
> |
refine_rays( /* compute refinement rays */ |
444 |
> |
long nrays |
445 |
> |
) |
446 |
|
{ |
447 |
|
int *pord; |
448 |
|
int ntodo; |
485 |
|
} |
486 |
|
|
487 |
|
|
488 |
< |
int |
489 |
< |
refine_frame(pass) /* refine current frame */ |
490 |
< |
int pass; |
488 |
> |
extern int |
489 |
> |
refine_frame( /* refine current frame */ |
490 |
> |
int pass |
491 |
> |
) |
492 |
|
{ |
493 |
|
static double rtime_used = 0; |
494 |
|
static long ray_cnt = 0; |
577 |
|
/* compute refinement rays */ |
578 |
|
if (!silent) { |
579 |
|
printf("\tRefinement pass %d...", |
580 |
< |
pass+1, rays_todo); |
580 |
> |
pass+1); /*, rays_todo); */ |
581 |
|
fflush(stdout); |
582 |
|
} |
583 |
|
if (asump != NULL) /* flag low-quality samples */ |
587 |
|
/* trace those rays */ |
588 |
|
nr = refine_rays(rays_todo); |
589 |
|
if (!silent) |
590 |
< |
printf("traced %d HQ rays\n", nr); |
590 |
> |
printf("traced %ld HQ rays\n", nr); |
591 |
|
if (nr <= 0) |
592 |
|
return(0); |
593 |
|
/* update timing stats */ |