gluScaleimage slow, looking for options

I’ve been doing some benchmarking/profiling on the application I’m working on and have found much of the startup time is spent in gluScaleImage/gluBuild2DMipmaps. This wasn’t a complete surprise as I new these functions had a reputation for being slow. So I’ve got a new routine to build the mipmaps myself, and have been working on a scaling the image.

So the question is does anyone have or know of fast scaling code? I figure others have run into this themselves. I’m primarily looking for scaling code that would scale RGB(24) and RGBA(32) images. Also could Iprobably optimize it for the much used case of reducing images by factor of 2. Any ideas? Anyone know of any sample/source code out there?

Thanks for any help and input

Errrrm, I only use both of these functions at initialisation - how come you use them all the time?

I only use this when creating textures as well…

I am trying to optimize startup costs and the application can have upwards of 50+ high resolution texures. The gluScaleImage is quite slow and when you start with 50 512x512 textures the scaling cost is enormous when building mipmaps. I patched in a simple special case scaling function and it saved over 15 seconds on startup cost. Before spending time fixing up and polishing the code I wanted to see if anyone else out there had seen/used/written scaling code (Maybe even with Assembly routines )

Hi elroy
I have written a bitmap scaling function that takes GLubyte’s of any dimensions and scales this bitmap to any size. It works pretty fast, but the real plus is that is produces better looking scales than gluScaleImage. You can see if it’s faster but it uses a lot of floating point math so you know…