Opened 18 years ago

Last modified 18 years ago

#1046 closed defect (fixed)

jpeg and sgi driver read optimizations

Reported by: list672000@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

In an effort to speed up the JPEG read code, I added a JPGDataset::IRasterIO
(...) member function to jpgdataset.cpp.  It is only optimized for a narrow 
case (reading an entire interleaved, 8 bit RGB JPEG).  The program that I'm 
working on reads many such JPEGs, so the performance improvement is signficant 
for that program.

Before trying the attached IRasterIO(...) implementation, I tried just calling 
the BlockBasedRasterIO(...) function (similar to the BMPDataset::IRasterIO
(...)).  That didn't improve the performance too much.  I think (not sure) that 
was because each pixel in the image was being iterated through for each band 
(in a GDALCopyWords).   The attached code only iterates through each pixel once 
(I think).  The commented out case (in JPGDataset::IRasterIO) would only 
iterate through each row (instead of each pixel) (and would thus be faster).  
That case is commented out because I didn't test that case.

There is also a modified sgidataset.cpp attached.  The ImageGetRow(..) function 
was modified such that there is a memcpy and memset that replaces code that 
iterated through (potentially) many individual copies/sets.

I don't presently see an attach file link, so maybe there will be one once the 
new entry is created.

Attachments (3)

jpgdataset.cpp (47.9 KB ) - added by list672000@… 18 years ago.
jpeg driver with new IRasterIO member function
sgidataset.cpp (21.3 KB ) - added by list672000@… 18 years ago.
sgi driver with optimized ImageGetRow(...) function
sgidataset.2.cpp (19.1 KB ) - added by list672000@… 18 years ago.
sgi driver

Download all attachments as: .zip

Change History (5)

by list672000@…, 18 years ago

Attachment: jpgdataset.cpp added

jpeg driver with new IRasterIO member function

by list672000@…, 18 years ago

Attachment: sgidataset.cpp added

sgi driver with optimized ImageGetRow(...) function

by list672000@…, 18 years ago

Attachment: sgidataset.2.cpp added

sgi driver

comment:1 by warmerdam, 18 years ago

SGI update applied in CVS.

I need to review the JPEG changes more closely.

comment:2 by warmerdam, 18 years ago

Integrated suggested IRasterIO method for jpeg dataset into jpgdataset.cpp.
While it is a one one special case that is accelerated it is a reasonably
common case, and it seems no harm can come of this code in any other case.


Thanks for the updates Mike!

Note: See TracTickets for help on using tickets.