summaryrefslogtreecommitdiff
path: root/libopenjpeg/t1.c
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2011-07-10 17:32:22 +0000
committerAntonin Descampe <antonin@gmail.com>2011-07-10 17:32:22 +0000
commit6106e48397d8a48bb544a8cfbc30d1516db6cc77 (patch)
tree52af09629e036392a3e4476abf298488f1e43919 /libopenjpeg/t1.c
parent0358177c3fc8872a38a46c2a55c84536daeae888 (diff)
improved encoding speed in t1_encode_cblks (credit to Giuseppe Baruffa)
Diffstat (limited to 'libopenjpeg/t1.c')
-rw-r--r--libopenjpeg/t1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libopenjpeg/t1.c b/libopenjpeg/t1.c
index 1794ac22..002a82d4 100644
--- a/libopenjpeg/t1.c
+++ b/libopenjpeg/t1.c
@@ -1413,6 +1413,7 @@ void t1_encode_cblks(
for (bandno = 0; bandno < res->numbands; ++bandno) {
opj_tcd_band_t* restrict band = &res->bands[bandno];
+ int bandconst = 8192 * 8192 / ((int) floor(band->stepsize * 8192));
for (precno = 0; precno < res->pw * res->ph; ++precno) {
opj_tcd_precinct_t *prc = &band->precincts[precno];
@@ -1463,7 +1464,7 @@ void t1_encode_cblks(
datap[(j * cblk_w) + i] =
fix_mul(
tmp,
- 8192 * 8192 / ((int) floor(band->stepsize * 8192))) >> (11 - T1_NMSEDEC_FRACBITS);
+ bandconst) >> (11 - T1_NMSEDEC_FRACBITS);
}
}
}