aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lcldec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-05-31 18:17:33 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-05-31 18:17:33 +0000
commit79183d3c3ef509543b47acc1b5e48e4285734f36 (patch)
tree445a0c304c3a896162b6c283e036b70173d9bb9f /libavcodec/lcldec.c
parenta7bfbe4e130779e1aefe59abbc1d93944d43bd4e (diff)
downloadffmpeg-79183d3c3ef509543b47acc1b5e48e4285734f36.tar.gz
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
Diffstat (limited to 'libavcodec/lcldec.c')
-rw-r--r--libavcodec/lcldec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index bc7e11d267..a6e348bd8e 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -102,6 +102,13 @@ static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsign
maskbit >>= 1;
if (!maskbit) {
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;
}
}