diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-05-18 20:15:07 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-05-20 20:31:28 +0200 |
| commit | 00cff6f5c02deabb64ccb15f15c13fcb773968fe (patch) | |
| tree | 2f3327cb8617bfb4655112710742be10f695e4f3 /src/lib/openjp2/t1.c | |
| parent | 99107d5e468beef3cf2f7db24633ba8b40732405 (diff) | |
Encoder: use floating-point operations for irreversible transformation
Diffstat (limited to 'src/lib/openjp2/t1.c')
| -rw-r--r-- | src/lib/openjp2/t1.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c index 1b9556ea..8d5feadf 100644 --- a/src/lib/openjp2/t1.c +++ b/src/lib/openjp2/t1.c @@ -2194,16 +2194,11 @@ static void opj_t1_clbl_encode_processor(void* user_data, opj_tls_t* tls) tileIndex += tileLineAdvance; } } else { /* if (tccp->qmfbid == 0) */ - const OPJ_INT32 bandconst = 8192 * 8192 / ((OPJ_INT32) floor( - band->stepsize * 8192)); - for (j = 0; j < cblk_h; ++j) { for (i = 0; i < cblk_w; ++i) { - OPJ_INT32 tmp = tiledp[tileIndex]; - tiledp[tileIndex] = - opj_int_fix_mul_t1( - tmp, - bandconst); + OPJ_FLOAT32 tmp = ((OPJ_FLOAT32*)tiledp)[tileIndex]; + tiledp[tileIndex] = (OPJ_INT32)opj_lrintf((tmp / band->stepsize) * + (1 << T1_NMSEDEC_FRACBITS)); tileIndex++; } tileIndex += tileLineAdvance; |
