484 |
|
histot += tms->histo[i]; |
485 |
|
sum += (double)(j -= HISTEP) * tms->histo[i]; |
486 |
|
} |
487 |
< |
threshold = histot*0.005 + .5; |
487 |
> |
threshold = histot*0.002 + .5; |
488 |
|
if (!histot) |
489 |
|
returnErr(TM_E_TMFAIL); |
490 |
|
Lwavg = tmLuminance( (double)sum / histot ); |
503 |
|
do { /* iterate to solution */ |
504 |
|
sum = 0; /* cumulative probability */ |
505 |
|
for (i = 0; i < histlen; i++) { |
506 |
< |
cumf[i] = (double)sum/histot; |
507 |
< |
sum += histo[i]; |
506 |
> |
cumf[i] = sum/histot; |
507 |
> |
sum += (double)histo[i]; |
508 |
|
} |
509 |
|
cumf[histlen] = 1.; |
510 |
|
Tr = histot * (double)(tms->hbrmax - tms->hbrmin) / |
511 |
< |
((double)histlen*TM_BRTSCALE) / logLddyn; |
511 |
> |
((double)TM_BRTSCALE*histlen*logLddyn); |
512 |
|
ceiling = Tr + 1.; |
513 |
|
trimmings = 0; /* clip to envelope */ |
514 |
|
for (i = histlen; i--; ) { |