summaryrefslogtreecommitdiff
path: root/libopenjpeg/t2.c
diff options
context:
space:
mode:
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2007-11-14 08:45:00 +0000
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2007-11-14 08:45:00 +0000
commit24e189e4d8a231e7273d788b2bd77e2484cec761 (patch)
tree48f57b8a816afa4b9bf6c6167a45eecfca91a778 /libopenjpeg/t2.c
parent61a15672bb980744297909e6dfe97b23c2430aea (diff)
Patch by Callum Lerwick. This patch rearranges the largest memory allocations so they're allocated as late as possible, and freed as soon as possible. This cuts memory usage by about half on two large test images.
Diffstat (limited to 'libopenjpeg/t2.c')
-rw-r--r--libopenjpeg/t2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libopenjpeg/t2.c b/libopenjpeg/t2.c
index 7fb53ef2..b10b822d 100644
--- a/libopenjpeg/t2.c
+++ b/libopenjpeg/t2.c
@@ -323,9 +323,8 @@ static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_t
int precno = pi->precno; /* precinct value */
int layno = pi->layno; /* quality layer value */
- opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
- opj_tcd_resolution_t *res = &tilec->resolutions[resno];
-
+ opj_tcd_resolution_t* res = &tile->comps[compno].resolutions[resno];
+
unsigned char *hd = NULL;
int present;