zlib using bios functions
Posted: Sat Jul 14, 2012 4:57 pm
as you guys know, among the bios functions there's support to decompress lz777 / huffman / rle
which is exactly what zlib uses (altough i'm not sure if they are modified versions of those)
but so my question is... anyone know if it's possible to use those to make the INFLATE/UNCOMPRESS functions from zlib? anyone atempted something like that?
also i saw the huffman part is streamed so it will probabily have poor performance and not suitable
since i wanted to check if it out could outperform zlib itself...
otherwise i think i should try to make a fully optimized pure ARM ASM version of such functions from zlib, to achieve maximum performance....
since i'm doing a AVI player (for ZMBV codec) the codec used in dosbox. and altough i had sucess playing an .avi 320x200x8 with full 70.083 fps with ADPCM (DS hardware) 22khz mono, for some videos that are more demanding, because they not compress great as simple platform games... the ZLIB alone is responsible for like 70% of cpu usage, even on 1/3rd fps videos (23.361 fps). and so even my frame caching scheme isnt enough to play such videos... so i think aside the fact that i can recode zlib to use compression level 1, to speed up zlib decompression, i think i can make it be at least 30-50% faster if using pure asm, because ZLIB is being compiled from a generic code (altough it does have a DS makefile)
(in fact i'm surprised that GCC can compile such things for DS, even knowing the horrendous alignment problems, that one can have on DS, (that affects pretty much all my freebasic compiled programs))
so anyway, maybe this isnt the best sections for this, but since the BIOS functions are on libnds, i tought it would worth a shot
which is exactly what zlib uses (altough i'm not sure if they are modified versions of those)
but so my question is... anyone know if it's possible to use those to make the INFLATE/UNCOMPRESS functions from zlib? anyone atempted something like that?
also i saw the huffman part is streamed so it will probabily have poor performance and not suitable
since i wanted to check if it out could outperform zlib itself...
otherwise i think i should try to make a fully optimized pure ARM ASM version of such functions from zlib, to achieve maximum performance....
since i'm doing a AVI player (for ZMBV codec) the codec used in dosbox. and altough i had sucess playing an .avi 320x200x8 with full 70.083 fps with ADPCM (DS hardware) 22khz mono, for some videos that are more demanding, because they not compress great as simple platform games... the ZLIB alone is responsible for like 70% of cpu usage, even on 1/3rd fps videos (23.361 fps). and so even my frame caching scheme isnt enough to play such videos... so i think aside the fact that i can recode zlib to use compression level 1, to speed up zlib decompression, i think i can make it be at least 30-50% faster if using pure asm, because ZLIB is being compiled from a generic code (altough it does have a DS makefile)
(in fact i'm surprised that GCC can compile such things for DS, even knowing the horrendous alignment problems, that one can have on DS, (that affects pretty much all my freebasic compiled programs))
so anyway, maybe this isnt the best sections for this, but since the BIOS functions are on libnds, i tought it would worth a shot