Slow down compression in purebasic?
Posted: Fri May 27, 2011 9:23 pm
I really like the compression ratio of purebasic's internal Packer (JCalG1), but, problem is that every compression scheme I search for here in forums and in google dont have any option for not using high amount of cpu.
All compressor schemes seems to be based on memory usage, compression speed and decompression.
In my project, i have every 10 second a need to compress a .bmp file without gearing the cpu up to 10%. If it can be slowed down, we might end up around 0.5% over let's say 8 seconds. Is that possible?
Basically, my project consists of grabbing the desktop, saving the bmp and send it over network (with no page faults, almost no cpu-time used every 10 second).
I have tried various 24bit image to 8 and 4 bit conversion, but they all either end up with page faults or using too much cpu. Even Purebasic's saveimage with compression and 4 as bit-flag bogs my loop down and simply is not suitable. Saving the bmp straight out, with no compression or bit-flag set, uses most likeley no cpu-time, but I end up around 80-147kb pr image. Sending that over network is not so cool. I have gotten the same file and suitable image data down to about 2-3kb, but that with the expense of page faults and too much cpu-time used every 10 second.
Right now, I have no page faults in my code and cpu-time even on slow machines is only about 1-2% every 10 second. But, again, the filesize is really to high.
Any ideas about slow compression schemes?
All compressor schemes seems to be based on memory usage, compression speed and decompression.
In my project, i have every 10 second a need to compress a .bmp file without gearing the cpu up to 10%. If it can be slowed down, we might end up around 0.5% over let's say 8 seconds. Is that possible?
Basically, my project consists of grabbing the desktop, saving the bmp and send it over network (with no page faults, almost no cpu-time used every 10 second).
I have tried various 24bit image to 8 and 4 bit conversion, but they all either end up with page faults or using too much cpu. Even Purebasic's saveimage with compression and 4 as bit-flag bogs my loop down and simply is not suitable. Saving the bmp straight out, with no compression or bit-flag set, uses most likeley no cpu-time, but I end up around 80-147kb pr image. Sending that over network is not so cool. I have gotten the same file and suitable image data down to about 2-3kb, but that with the expense of page faults and too much cpu-time used every 10 second.
Right now, I have no page faults in my code and cpu-time even on slow machines is only about 1-2% every 10 second. But, again, the filesize is really to high.
Any ideas about slow compression schemes?