*/
static int t2_encode_packet(opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi, unsigned char *dest, int len, opj_codestream_info_t *cstr_info, int tileno);
/**
-@param seg
+@param cblk
+@param index
@param cblksty
@param first
*/
@param tile Tile for which to write the packets
@param tcp Tile coding parameters
@param pi Packet identity
+@param pack_info Packet information
@return
*/
static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_tile_t *tile,
if (tcp->csty & J2K_CP_CSTY_EPH) {
if ((*hd) != 0xff || (*(hd + 1) != 0x92)) {
opj_event_msg(t2->cinfo, EVT_ERROR, "Expected EPH marker\n");
+ return -999;
} else {
hd += 2;
}
int tpnum = compno;
if (pi_create_encode(pi, cp,tileno,poc,tpnum,tppos,t2_mode,cur_totnum_tp)) {
opj_event_msg(t2->cinfo, EVT_ERROR, "Error initializing Packet Iterator\n");
+ pi_destroy(pi, cp, tileno);
return -999;
}
while (pi_next(&pi[poc])) {
} else {
e = 0;
}
-
+ if(e == -999) return -999;
/* progression in resolution */
image->comps[pi[pino].compno].resno_decoded =
(e > 0) ?