*
* JasPer License Version 2.0
*
+ * Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
- * Copyright (c) 2001-2003 Michael David Adams
*
* All rights reserved.
*
*/
/*
- * $Id: jpc_dec.c,v 1.1 2007/01/15 16:09:28 vp153 Exp $
+ * $Id: jpc_dec.c,v 1.2 2008/05/26 09:40:52 vp153 Exp $
*/
/******************************************************************************\
opts->maxpkts = atoi(jas_tvparser_getval(tvp));
break;
default:
- fprintf(stderr, "warning: ignoring invalid option %s\n",
+ jas_eprintf("warning: ignoring invalid option %s\n",
jas_tvparser_gettag(tvp));
break;
}
/* Get the next marker segment in the code stream. */
if (!(ms = jpc_getms(dec->in, cstate))) {
- fprintf(stderr, "cannot get marker segment\n");
+ jas_eprintf("cannot get marker segment\n");
return -1;
}
/* Ensure that this type of marker segment is permitted
at this point in the code stream. */
if (!(dec->state & mstabent->validstates)) {
- fprintf(stderr, "unexpected marker segment type\n");
+ jas_eprintf("unexpected marker segment type\n");
jpc_ms_destroy(ms);
return -1;
}
}
if (JAS_CAST(int, sot->tileno) > dec->numtiles) {
- fprintf(stderr, "invalid tile number in SOT marker segment\n");
+ jas_eprintf("invalid tile number in SOT marker segment\n");
return -1;
}
/* Set the current tile. */
if (jpc_dec_decodepkts(dec, (tile->pkthdrstream) ? tile->pkthdrstream :
dec->in, dec->in)) {
- fprintf(stderr, "jpc_dec_decodepkts failed\n");
+ jas_eprintf("jpc_dec_decodepkts failed\n");
return -1;
}
curoff = jas_stream_getrwcount(dec->in);
if (curoff < dec->curtileendoff) {
n = dec->curtileendoff - curoff;
- fprintf(stderr,
- "warning: ignoring trailing garbage (%lu bytes)\n",
+ jas_eprintf("warning: ignoring trailing garbage (%lu bytes)\n",
(unsigned long) n);
while (n-- > 0) {
if (jas_stream_getc(dec->in) == EOF) {
- fprintf(stderr, "read error\n");
+ jas_eprintf("read error\n");
return -1;
}
}
} else if (curoff > dec->curtileendoff) {
- fprintf(stderr,
- "warning: not enough tile data (%lu bytes)\n",
+ jas_eprintf("warning: not enough tile data (%lu bytes)\n",
(unsigned long) curoff - dec->curtileendoff);
}
jpc_dec_cmpt_t *cmpt;
if (jpc_dec_decodecblks(dec, tile)) {
- fprintf(stderr, "jpc_dec_decodecblks failed\n");
+ jas_eprintf("jpc_dec_decodecblks failed\n");
return -1;
}
for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
++compno, ++tcomp) {
ccp = &tile->cp->ccps[compno];
- jpc_tsfb_synthesize(tcomp->tsfb, ((ccp->qmfbid ==
- JPC_COX_RFT) ? JPC_TSFB_RITIMODE : 0), tcomp->data);
+ jpc_tsfb_synthesize(tcomp->tsfb, tcomp->data);
}
JPC_CEILDIV(dec->xstart, cmpt->hstep), tcomp->ystart -
JPC_CEILDIV(dec->ystart, cmpt->vstep), jas_matrix_numcols(
tcomp->data), jas_matrix_numrows(tcomp->data), tcomp->data)) {
- fprintf(stderr, "write component failed\n");
+ jas_eprintf("write component failed\n");
return -4;
}
}
jpc_dec_tile_t *tile;
if (JAS_CAST(int, coc->compno) > dec->numcomps) {
- fprintf(stderr,
- "invalid component number in COC marker segment\n");
+ jas_eprintf("invalid component number in COC marker segment\n");
return -1;
}
switch (dec->state) {
jpc_dec_tile_t *tile;
if (JAS_CAST(int, rgn->compno) > dec->numcomps) {
- fprintf(stderr,
- "invalid component number in RGN marker segment\n");
+ jas_eprintf("invalid component number in RGN marker segment\n");
return -1;
}
switch (dec->state) {
jpc_dec_tile_t *tile;
if (JAS_CAST(int, qcc->compno) > dec->numcomps) {
- fprintf(stderr,
- "invalid component number in QCC marker segment\n");
+ jas_eprintf("invalid component number in QCC marker segment\n");
return -1;
}
switch (dec->state) {
/* Eliminate compiler warnings about unused variables. */
dec = 0;
- fprintf(stderr, "warning: ignoring unknown marker segment\n");
+ jas_eprintf("warning: ignoring unknown marker segment\n");
jpc_ms_dump(ms, stderr);
return 0;
}
Here we ensure that any such bits are masked off. */
if (mag & (~mask)) {
if (!warn) {
- fprintf(stderr,
- "warning: possibly corrupt code stream\n");
+ jas_eprintf("warning: possibly corrupt code stream\n");
warn = true;
}
mag &= mask;