Skip to content

Commit

Permalink
Fix incorrect propagation of a COC parameter (DWT transform)
Browse files Browse the repository at this point in the history
Why: If the DWT transform differs among components, the information of DWT transform used for each component should be found as the COC marker segment. This information is wrongly used for dequantization and rounding in JasPer.
How: Fixed dequantization and rounding in jpc_dec_tiledecode() to use ccp->qmfbid which has the information of DWT transform.
  • Loading branch information
osamu620 committed Jul 30, 2020
1 parent 3204e67 commit 1c220a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libjasper/jpc/jpc_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile)
}
jpc_undo_roi(band->data, band->roishift, ccp->roishift -
band->roishift, band->numbps);
if (tile->realmode) {
if (ccp->qmfbid == JPC_COX_INS) {
jas_matrix_asl(band->data, JPC_FIX_FRACBITS);
jpc_dequantize(band->data, band->absstepsize);
}
Expand Down Expand Up @@ -1169,9 +1169,10 @@ static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile)
}

/* Perform rounding and convert to integer values. */
if (tile->realmode) {
for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
++compno, ++tcomp) {
ccp = &tile->cp->ccps[compno];
if (ccp->qmfbid == JPC_COX_INS) {
for (jas_matind_t i = 0; i < jas_matrix_numrows(tcomp->data); ++i) {
for (jas_matind_t j = 0; j < jas_matrix_numcols(tcomp->data); ++j) {
v = jas_matrix_get(tcomp->data, i, j);
Expand Down

0 comments on commit 1c220a1

Please sign in to comment.