Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5094376
Votes 5
Synopsis Slow native JPEG reader in JAI-Image I/O Tools
Category jai:codeclib
Reported Against 1.0_01
Release Fixed
State 8-Fix Available, bug
Priority: 3-Medium
Related Bugs
Submit Date 30-AUG-2004
Description
Bug as reported by customer, Thomas Barregren <  xxxxx@xxxxx  >:

Hi,

The native version of JPEG reader in JAI-Image I/O Tools 1.0_01-rc is more
than twice as slow as the Java version of the ImageReader. On my 1 Mhz
Pentium with 256 MB RAM running Windows 2000 and Java 1.4.2_05-b04,
CLibJPEGImageReader needed 1.8 seconds to decode an 2160 x 1440 pixels large
JPEG image, while JPEGImageReader needed only 0.8 seconds. It is great that
Java excels over C, but one would expect the native version to be faster;
especially as it seems to have precedence before the Java version. Is there
anything wrong with my program or system? Or is there a bug in
CLibJPEGImageReader? Or should I, and every one else, just conclude that the
so called accelerated version of JPEG reader is actually slower than the
Java one?

I enclose a stripped down version of a small program I wrote to test
JAI-Image I/O Tools 1.0_01-rc.

Regards,
Thomas
Work Around
I am not sure if we have enough time to speed up the JPEG decoder on win32
to be as fast as that of the core Java Image I/O, so maybe the default order
of the plugins can be altered on win32 for the time being.
  xxxxx@xxxxx   10/16/04 01:17 GMT
Evaluation
The IDCT functions, and maybe others, used by the codecLib JPEG decdoer
are not x86 friendly in terms of performance.
  xxxxx@xxxxx   10/16/04 01:17 GMT
By using the SSE2 version mediaLib functions for IDCT, dequantization,
color conversion and etc., CLibJPEGImageReader is broght up to the
speed of the core JPEGImageReader, or even faster, for example on a
Windows XP with Pentium M:

-- listing average times to read image IMG_2406.JPG --
com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReader --  0 1 2 3 4 5 6 7 8 9 -- 1026.5 ms
com.sun.imageio.plugins.jpeg.JPEGImageReader --  0 1 2 3 4 5 6 7 8 9 -- 1069.5 ms

As of jclib4jai.20060421, a new library clib_jiio_sse2.dll is added,
mainly for fixing this bug.
Posted Date : 2006-04-24 23:11:46.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang