summaryrefslogtreecommitdiff
path: root/libopenjpeg/tcd.c
diff options
context:
space:
mode:
authorParvatha Elangovan <p.elangovan@intopix.com>2007-03-07 16:04:33 +0000
committerParvatha Elangovan <p.elangovan@intopix.com>2007-03-07 16:04:33 +0000
commit78003a016a30c4d64779e09bb7135861db4c1b89 (patch)
treeed7ad986672431915940fd7ebf62648a52198327 /libopenjpeg/tcd.c
parent9e5d0b1a40da3ffa70c2d3851ebdea790adaaba1 (diff)
Added option for Digital cinema profile compliant codestream. This can be chosen by "-cinema2K" or "-cinema4K" for a 2K and 4K compliance respectively. The feature for tileparts has not been implemented in this version. Modification in image_to_j2k.c
Added the Digital Cinema profiles (CINEMA2K and CINEMA4K) to the list of profiles recognized in the codestream SIZ marker segment. Modification in openjpeg.h,j2k.c Added feature for constant quality within bitrate defined in Digital cinema standards. Modification in tcd.c Modified the method of generation of buffer length. Modification in cio.c
Diffstat (limited to 'libopenjpeg/tcd.c')
-rw-r--r--libopenjpeg/tcd.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c
index 73c3ef5e..89658ce7 100644
--- a/libopenjpeg/tcd.c
+++ b/libopenjpeg/tcd.c
@@ -1040,13 +1040,29 @@ bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_image_in
tcd_makelayer(tcd, layno, thresh, 0);
if (cp->fixed_quality) { /* fixed_quality */
- distoachieved = (layno == 0) ?
- tcd_tile->distolayer[0] : (cumdisto[layno - 1] + tcd_tile->distolayer[layno]);
- if (distoachieved < distotarget) {
- hi = thresh;
- continue;
+ if(cp->cinema){
+ l = t2_encode_packets(t2, tcd->tcd_tileno, tcd_tile, layno + 1, dest, maxlen, image_info);
+ if (l == -999) {
+ lo = thresh;
+ continue;
+ }else{
+ distoachieved = layno == 0 ?
+ tcd_tile->distolayer[0] : cumdisto[layno - 1] + tcd_tile->distolayer[layno];
+ if (distoachieved < distotarget) {
+ hi=thresh; continue;
+ }else{
+ lo=thresh;
+ }
+ }
+ }else{
+ distoachieved = (layno == 0) ?
+ tcd_tile->distolayer[0] : (cumdisto[layno - 1] + tcd_tile->distolayer[layno]);
+ if (distoachieved < distotarget) {
+ hi = thresh;
+ continue;
+ }
+ lo = thresh;
}
- lo = thresh;
} else {
l = t2_encode_packets(t2, tcd->tcd_tileno, tcd_tile, layno + 1, dest, maxlen, image_info);
/* TODO: what to do with l ??? seek / tell ??? */