[gdal-dev] Very large time difference using gdal_translate from Jpeg2000 to different formats using JP2KAK driver

Frank Warmerdam warmerdam at pobox.com
Sun Apr 15 00:48:54 EDT 2012


On 12-04-12 05:53 PM, ahbrown wrote:
> Hi,
>
> I am wondering why there is such a large difference in the time to convert a
> large O(250MB) Jpeg2000 image to GeoTiff format in comparison with
> conversion to other formats (e.g. jpeg, png)?
>
> I am using the Kakadu Jpeg2000 driver. With a 43221 x 36021 Jpeg2000 image.
>
> Results of timed conversions are as follows:
>
>
>
> Using RasterIO directly (via the Java wrapper) the conversion takes around 6
> seconds.

Adam,

Many drivers implement the CreateCopy() rather than Create() method. In these
cases the input dataset is passed to the output driver and they pull data in
whatever way is convenient.

The PNG and JPEG drivers are "CreateCopy" drivers and likely request data
one scanline at a time.  In this situation the JP2KAK driver actually gets
asked for the data in moderate sized tiles which turns out not to be very
efficient for the Kakadu library as there is a high setup cost for each
windowed read.

The GeoTIFF format support Create(), so gdal_translate is able to more
closely manage the chunking of reads and writes and tries to do it in
large chunks.  The JP2KAK driver handles large reads through IRasterIO()
as single windowed reads which are more efficient than the smaller tile
reads.

So I think the bulk of the difference in performance is related to different
IO strategies that apply against the JP2KAK driver.  The variation between
JPEG and PNG times is likely different costs on the compression side.

PS. it appears posts through nabble do not preserve some components, like
the fixed font timings text.  I encourage direct use of the mailing list
for posts.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://home.gdal.org/warmerda
and watch the world go round - Rush    | Geospatial Software Developer



More information about the gdal-dev mailing list