88 |
|
if ((fcs == NULL) | (tms == NULL) || (tms->histo == NULL) | |
89 |
|
(0 > pctile) | (pctile >= 50)) |
90 |
|
return(TM_E_ILLEGAL); |
91 |
< |
i = (tms->hbrmin-MINBRT)/HISTEP; |
91 |
> |
i = HISTI(tms->hbrmin); |
92 |
|
brt0 = MINBRT + HISTEP/2 + i*HISTEP; |
93 |
< |
histlen = (tms->hbrmax-MINBRT)/HISTEP + 1 - i; |
93 |
> |
histlen = HISTI(tms->hbrmax) + 1 - i; |
94 |
|
histot = 0; |
95 |
|
for (i = histlen; i--; ) |
96 |
|
histot += tms->histo[i]; |
114 |
|
if ((fcs == NULL) | (tms == NULL) || (tms->histo == NULL) | |
115 |
|
(.0 > pctile) | (pctile >= 50.)) |
116 |
|
return(TM_E_ILLEGAL); |
117 |
< |
i = (tms->hbrmin-MINBRT)/HISTEP; |
117 |
> |
i = HISTI(tms->hbrmin); |
118 |
|
brt0 = MINBRT + HISTEP/2 + i*HISTEP; |
119 |
< |
histlen = (tms->hbrmax-MINBRT)/HISTEP + 1 - i; |
119 |
> |
histlen = HISTI(tms->hbrmax) + 1 - i; |
120 |
|
histot = 0; |
121 |
|
for (i = histlen; i--; ) |
122 |
|
histot += tms->histo[i]; |
170 |
|
if (fcs == NULL || fcs->lumap == NULL) |
171 |
|
return(-1); |
172 |
|
|
173 |
< |
miderr = fcs->lumap[(fcs->mbrmax - fcs->mbrmin)/2] - |
174 |
< |
128L * (fcs->mbrmax - fcs->mbrmin) / |
175 |
< |
(fcs->mbrmax - fcs->mbrmin + 1); |
173 |
> |
miderr = (fcs->mbrmax - fcs->mbrmin)/2; |
174 |
> |
miderr = fcs->lumap[miderr] - |
175 |
> |
256L * miderr / (fcs->mbrmax - fcs->mbrmin + 1); |
176 |
|
|
177 |
|
return((-1 <= miderr) & (miderr <= 1)); |
178 |
|
} |