A couple of hacks to KDMs for testing by Dolby.
[libdcp.git] / src / j2k.cc
index 635d50244cc4f717d8d20b4ff900773aa074d67a..13474f51641c2b3851b423f5e3046ae8454cdc74 100644 (file)
@@ -136,8 +136,8 @@ dcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
        opj_destroy_codec (decoder);
        opj_stream_destroy (stream);
 
-       image->x1 = rint (float(image->x1) / pow (2, reduce));
-       image->y1 = rint (float(image->y1) / pow (2, reduce));
+       image->x1 = rint (float(image->x1) / pow (2.0f, reduce));
+       image->y1 = rint (float(image->y1) / pow (2.0f, reduce));
        return shared_ptr<OpenJPEGImage> (new OpenJPEGImage (image));
 }
 
@@ -229,6 +229,7 @@ dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frame
        }
        parameters.max_comp_size = parameters.max_cs_size / 1.25;
        parameters.tcp_numlayers = 1;
+       parameters.tcp_mct = 1;
 
        /* Setup the encoder parameters using the current image and user parameters */
        opj_setup_encoder (encoder, &parameters, xyz->opj_image());