Fixed the DCinema filesize allocation. It now includes the SOT marker size

This commit is contained in:
Francois-Olivier Devaux
2007-08-08 09:41:16 +00:00
parent 9cf692e897
commit 7dcb817e6a
7 changed files with 23 additions and 10 deletions

View File

@@ -151,6 +151,13 @@ void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int c
/* Modification of the RATE >> */
for (j = 0; j < tcp->numlayers; j++) {
tcp->rates[j] = tcp->rates[j] ?
cp->tp_on ?
(((float) (tile->numcomps
* (tile->x1 - tile->x0)
* (tile->y1 - tile->y0)
* image->comps[0].prec))
/(tcp->rates[j] * 8 * image->comps[0].dx * image->comps[0].dy)) - (((tcd->cur_totnum_tp - 1) * 14 )/ tcp->numlayers)
:
((float) (tile->numcomps
* (tile->x1 - tile->x0)
* (tile->y1 - tile->y0)
@@ -1049,7 +1056,7 @@ bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_image_in
double hi = max;
int success = 0;
/* TODO: remove maxlen */
int maxlen = tcd_tcp->rates[layno] ? int_min(((int) ceil(tcd_tcp->rates[layno])), len) : len;
int maxlen = tcd_tcp->rates[layno] ? int_min(((int) ceil(tcd_tcp->rates[layno]- 2)), len) : len;
double goodthresh = 0;
double stable_thresh = 0;
int i;
@@ -1436,3 +1443,4 @@ void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno) {
}