changeset 9782:66922728d7f7 libavcodec

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
author reimar
date Sun, 31 May 2009 18:17:33 +0000
parents 05b6cba2c95b
children 21f3bbb20e42
files lcldec.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lcldec.c	Sun May 31 17:44:35 2009 +0000
+++ b/lcldec.c	Sun May 31 18:17:33 2009 +0000
@@ -102,6 +102,13 @@
         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;
         }
     }