1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

mszh decompression: add a special case for an all-0 mask, i.e. 32 uncompressed

bytes in a row.
About 15% faster mszh_decomp on an Atom N270 for
http://samples.mplayerhq.hu/V-codecs/mszh-zlib/avimzsh_sample.avi

Originally committed as revision 19068 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger 2009-05-31 18:17:33 +00:00
parent a7bfbe4e13
commit 79183d3c3e

View File

@ -102,6 +102,13 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
maskbit >>= 1; maskbit >>= 1;
if (!maskbit) { if (!maskbit) {
mask = *srcptr++; mask = *srcptr++;
while (!mask) {
if (destptr_end - destptr < 32 || srcptr_end - srcptr < 32) break;
memcpy(destptr, srcptr, 32);
destptr += 32;
srcptr += 32;
mask = *srcptr++;
}
maskbit = 0x80; maskbit = 0x80;
} }
} }