summaryrefslogtreecommitdiff
path: root/libopenjpeg/tcd.c
diff options
context:
space:
mode:
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2007-08-08 09:41:16 +0000
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2007-08-08 09:41:16 +0000
commit7dcb817e6acf9ec78a1bf09dfa9b188dd18e68b6 (patch)
tree7fda3ea0e337a8ab5fd7b9e2dcf7dee981ea638e /libopenjpeg/tcd.c
parent9cf692e89773ac83cebbb2969039913ce761c11d (diff)
Fixed the DCinema filesize allocation. It now includes the SOT marker size
Diffstat (limited to 'libopenjpeg/tcd.c')
-rw-r--r--libopenjpeg/tcd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c
index 2253c5b4..003d521e 100644
--- a/libopenjpeg/tcd.c
+++ b/libopenjpeg/tcd.c
@@ -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) {
}
+