Ticket #3295 (closed defect: fixed)
Accessing some JPEG2000 files takes an extraordinary amount of memory.
| Reported by: | warmerdam | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | high | Milestone: | 1.7.2 |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | normal | Keywords: | jp2kak |
| Cc: | gaopeng |
Description
(as reported to the kakadu_jpeg2000 mailing list by myself)
I have a 230MB jpeg2000 file with which I am experiencing expectedly high memory use when I decode it for viewing with Kakadu. The -record report on the file is:
Sprofile=PROFILE2
Scap=no
Sextensions=0
Ssize={36021,43221}
Sorigin={0,0}
Stiles={36021,43221}
Stile_origin={0,0}
Scomponents=3
Ssigned=no,no,no
Sprecision=8,8,8
Ssampling={1,1},{1,1},{1,1}
Sdims={36021,43221},{36021,43221},{36021,43221}
Cycc=yes
Cmct=0
Clayers=20
Cuse_sop=no
Cuse_eph=no
Corder=LRCP
Calign_blk_last={no,no}
Clevels=5
Cads=0
Cdfs=0
Cdecomp=B(-:-:-)
Creversible=no
Ckernels=W9X7
Catk=0
Cuse_precincts=no
Cblk={64,64}
Cmodes=0
Qguard=1
Qderived=no
Qabs_steps=0.000115,0.000114,0.000114,0.000114,0.000229,0.000229,0.000227,0.000
467,0.000467,0.000470,0.000978,0.000978,0.001009,0.001931,0.001931,0.001877
I have found if I transcode it like this, viewing memory use is dramatically reduced:
kdu_transcode -i N05-E132.jp2 -o optimized.jpc
'Cprecincts={128,128}' Corder=RPCL ORGgen_plt=yes
I find that "kdu_expand -i N05-E132.jp2 -o out.tif" promptly rises to around 395MB resident memory use with the unoptimized file, while the optimized file only rises to bout 72MB. I assume the original jp2 was generated in an organization that is hostile for low-memory viewer access, but my core question is if there are things I can do with my viewer application or even kdu_expand to reduce memory use on the original file.
