MNG decoder performance very bad
Markus Meyer <meyer-GO0b9/[email protected]> 14 Aug 2003 19:48:42 +0200
| Newsgroups | gmane.comp.graphics.mng.general |
|---|---|
| Message-ID | <1060883322.4043.87.camel@markus> |
Hello List, I'm trying to use LibMNG (with ZLib and LCMS) to play back animated clips of medical data (no videos of persons, but animated technical schematics). MNG seems perfect for the job, because the animations have no sound, and also the compression should be lossless (no artifacts). The MNG files have been converted from uncompressed AVIs using JASC Animation Shop, then fix them using the utility on the web site (I tried some other tools, but found none which was able to both import AVI and write a MNG file and didn't crash or produced strange error messages. Maybe someone has an idea). My problem is that decoding is very slow (it doesn't reach the frame rate I need, though I have a P-IV 2,4 GHz and 512 MB RAM) and it's allocating LOTS of memory. I have tried a lot of things, e.g. storing chunks is off, I preload the entire MNG into memory to avoid buffering issues etc. But to no avail. Let me give some figures. For example, one file is ~4 MB big and contains 31 frames of size 765x486. Framerate is 10 fps. Even though I'm preloading the whole image into memory, LibMNG can only play this file at about 5 fps. Also, everytime mng_display_resume() is called, there is ~170 kB memory allocated. After all 31 frames have been shown, the animation loops and then plays the 10 fps without problems. So it seems to me that the library is storing all frames in memory, and the decompression takes so much time. I have checked with the Visual C++ profiler to ensure that it isn't some glitch inside my own drawing code, but this is the result: Time (ms) Function ---------------------------------------------- 1401,371 _filter_paeth (libmng_filter.obj) 1283,284 MngAlloc(unsigned int) (manimationwindow.obj) 706,850 mng_display_bgr8 (libmng_pixels.obj) 403,552 _inflate_fast (inffast.obj) 207,538 _adler32 (adler32.obj) 192,358 _mng_store_rgba8 (libmng_pixels.obj) This means that more than 4 seconds are needed just for the internal decoding functions of the video which should play in approx. 3 seconds. So did I miss something or is this task just too difficult for MNG? Best regards Markus Meyer -- Send the message body "help" to [email protected]