diff options
| author | Antonin Descampe <antonin@gmail.com> | 2004-07-13 09:17:17 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2004-07-13 09:17:17 +0000 |
| commit | bc563fc5ba6e0369dc7da995e971b7077f4788a5 (patch) | |
| tree | be25510575befe169b98430087b80840d4a90cd8 /libopenjpeg/tcd.c | |
| parent | f50f66c0c9b00426ad85cbdb444b47b31f89171d (diff) | |
* Quantization bug fixed when using 9x7 DWT (comment keyword : quantizbug1)
* Multiplication bug fixed when dividing by 8192 (comment keyword : multbug1)
Diffstat (limited to 'libopenjpeg/tcd.c')
| -rw-r--r-- | libopenjpeg/tcd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index fb778347..09e31ece 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -774,6 +774,8 @@ void tcd_init(j2k_image_t * img, j2k_cp_t * cp) cblk->y0 = int_max(cblkystart, prc->y0); cblk->x1 = int_min(cblkxend, prc->x1); cblk->y1 = int_min(cblkyend, prc->y1); + + cblk->lastbp = 0; // Add Antonin : quantizbug1 } } } @@ -1523,10 +1525,15 @@ int tcd_decode_tile(unsigned char *src, int len, int tileno) for (i = res->x0; i < res->x1; i++) { int v; + double tmp= (double) tilec->data[i - res->x0 + (j - res->y0) * tw]; if (tcd_tcp->tccps[compno].qmfbid == 1) { - v = tilec->data[i - res->x0 + (j - res->y0) * tw]; + v = (int) tmp; } else { - v = tilec->data[i - res->x0 + (j - res->y0) * tw] >> 13; + //v = (int) tmp >> 13; + //Mod antonin : multbug1 + v = (int) ((fabs(tmp/8192.0)>=floor(fabs(tmp/8192.0))+0.5)?fabs(tmp/8192.0)+1.0:fabs(tmp/8192.0)); + v = (tmp<0)?-v:v; + //doM } v += adjust; |
