fixed a bug in t1.c that prevented in some cases a true lossless compression (thanks to Don Mimlitch for reporting this bug)

This commit is contained in:
Antonin Descampe 2006-03-19 18:51:32 +00:00
parent f0721df1d9
commit 817681fb98
2 changed files with 4 additions and 5 deletions

View File

@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed
+ : added
March 19, 2006
* [Antonin] fixed a bug in t1.c that prevented in some cases a true lossless compression (thanks to Don Mimlitch for reporting this bug)
February 12, 2006
- [Herve Drolon] removed unneeded working variables in opj_tcd_t

View File

@ -1066,11 +1066,7 @@ void t1_decode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp) {
for (j = 0; j < cblk->y1 - cblk->y0; j++) {
for (i = 0; i < cblk->x1 - cblk->x0; i++) {
int tmp = t1->data[j][i];
if(tmp >> 1 == 0) {
tilec->data[x + i + (y + j) * (tilec->x1 - tilec->x0)] = 0;
} else {
tilec->data[x + i + (y + j) * (tilec->x1 - tilec->x0)] = tmp<0?(tmp>>1)+1:(tmp>>1);
}
tilec->data[x + i + (y + j) * (tilec->x1 - tilec->x0)] = tmp/2;
}
}
} else { /* if (tcp->tccps[compno].qmfbid == 0) */