Home > Back-end >  C language BMP file compression (5 m compression about 500 k, completed within 10 ms)
C language BMP file compression (5 m compression about 500 k, completed within 10 ms)

Time:12-12

As title, I now need to use the C language compression BMP file, 5 m or so expect 10 ms, have the feasibility?
I now use Gzip compression, 6 m file compression to 1 m or so, time for 281 ms;
Use LZMA compression, 6 m file compression to about 300 k, time is between 800-900 ms ms,
Excuse me each ace, what better way to my needs?

CodePudding user response:

Setting compression parameters, using the fastest way, but, as a result, the compression ratio is very low

CodePudding user response:

I've written a simple compression algorithm, tried to picture a single BMP images, can be compressed hundreds or even dozens of KB, and 7 z, ZIP differ not quite, but for the complex picture, it doesn't have much effect, I'm afraid (7 z, ZIP the effect is not very good),
This algorithm is simple, it is repeated for testing part + compressed into repeat repeat single copy, detection 1 byte repeated first, then traverse the second time testing two bytes repetitive, so, to what extent are you testing casually, as for the time can be controlled within 10 ms, not clear, if is 24 bits BMP, direct detection of 3 bytes you repeat it, should control within 10 ms (after all, this is a very simple compression algorithm,, and through only once and if this amounted to less than 10 ms, don't know what algorithm can),
  • Related