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/tcd.c | |
| parent | 99107d5e468beef3cf2f7db24633ba8b40732405 (diff) | |
Encoder: use floating-point operations for irreversible transformation
Diffstat (limited to 'src/lib/openjp2/tcd.c')
| -rw-r--r-- | src/lib/openjp2/tcd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c index d5d60aaf..503dc472 100644 --- a/src/lib/openjp2/tcd.c +++ b/src/lib/openjp2/tcd.c @@ -2411,7 +2411,8 @@ static OPJ_BOOL opj_tcd_dc_level_shift_encode(opj_tcd_t *p_tcd) } } else { for (i = 0; i < l_nb_elem; ++i) { - *l_current_ptr = (*l_current_ptr - l_tccp->m_dc_level_shift) * (1 << 11); + *((OPJ_FLOAT32 *) l_current_ptr) = (OPJ_FLOAT32)(*l_current_ptr - + l_tccp->m_dc_level_shift); ++l_current_ptr; } } @@ -2469,8 +2470,11 @@ static OPJ_BOOL opj_tcd_mct_encode(opj_tcd_t *p_tcd) opj_free(l_data); } else if (l_tcp->tccps->qmfbid == 0) { - opj_mct_encode_real(l_tile->comps[0].data, l_tile->comps[1].data, - l_tile->comps[2].data, samples); + opj_mct_encode_real( + (OPJ_FLOAT32*)l_tile->comps[0].data, + (OPJ_FLOAT32*)l_tile->comps[1].data, + (OPJ_FLOAT32*)l_tile->comps[2].data, + samples); } else { opj_mct_encode(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples); |
