opj_tcd_rateallocate(): make sure to use all passes for a lossless layer (#1009)
And save a useless loop, which should be a tiny faster.
This commit is contained in:
parent
7aa071aa27
commit
b428b8c7e7
|
@ -269,6 +269,10 @@ void opj_tcd_makelayer(opj_tcd_t *tcd,
|
||||||
|
|
||||||
n = cblk->numpassesinlayers;
|
n = cblk->numpassesinlayers;
|
||||||
|
|
||||||
|
if (thresh < 0) {
|
||||||
|
/* Special value to indicate to use all passes */
|
||||||
|
n = cblk->totalpasses;
|
||||||
|
} else {
|
||||||
for (passno = cblk->numpassesinlayers; passno < cblk->totalpasses; passno++) {
|
for (passno = cblk->numpassesinlayers; passno < cblk->totalpasses; passno++) {
|
||||||
OPJ_UINT32 dr;
|
OPJ_UINT32 dr;
|
||||||
OPJ_FLOAT64 dd;
|
OPJ_FLOAT64 dd;
|
||||||
|
@ -293,6 +297,7 @@ void opj_tcd_makelayer(opj_tcd_t *tcd,
|
||||||
n = passno + 1;
|
n = passno + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
layer->numpasses = n - cblk->numpassesinlayers;
|
layer->numpasses = n - cblk->numpassesinlayers;
|
||||||
|
|
||||||
|
@ -613,7 +618,8 @@ OPJ_BOOL opj_tcd_rateallocate(opj_tcd_t *tcd,
|
||||||
|
|
||||||
opj_t2_destroy(t2);
|
opj_t2_destroy(t2);
|
||||||
} else {
|
} else {
|
||||||
goodthresh = min;
|
/* Special value to indicate to use all passes */
|
||||||
|
goodthresh = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cstr_info) { /* Threshold for Marcela Index */
|
if (cstr_info) { /* Threshold for Marcela Index */
|
||||||
|
|
Loading…
Reference in New Issue