opj_tcd_resolution_t *res = &tilec->resolutions[resno];
opj_bio_t *bio = 00; /* BIO component */
+#ifdef ENABLE_EMPTY_PACKET_OPTIMIZATION
OPJ_BOOL packet_empty = OPJ_TRUE;
+#else
+ OPJ_BOOL packet_empty = OPJ_FALSE;
+#endif
/* <SOP 0xff91> */
if (tcp->csty & J2K_CP_CSTY_SOP) {
}
opj_bio_init_enc(bio, c, length);
+#ifdef ENABLE_EMPTY_PACKET_OPTIMIZATION
+ /* WARNING: this code branch is disabled, since it has been reported that */
+ /* such packets cause decoding issues with cinema J2K hardware */
+ /* decoders: https://groups.google.com/forum/#!topic/openjpeg/M7M_fLX_Bco */
+
/* Check if the packet is empty */
/* Note: we could also skip that step and always write a packet header */
band = res->bands;
break;
}
}
-
+#endif
opj_bio_write(bio, packet_empty ? 0 : 1, 1); /* Empty header bit */
-
/* Writing Packet header */
band = res->bands;
for (bandno = 0; !packet_empty &&