[Ffmpeg-devel] [PATCH]/Benchmark-request LZO move bounds check

Reimar Döffinger Reimar.Doeffinger
Wed Jan 31 18:27:02 CET 2007


Hello,
I am very interested in benchmarks of attached patch, I get up to a 10%
performance gain on my AMD64 system, but no visible difference on an
Power5 (shared user though, so that might have to do with it).
Of course if someone wants to check for correctness you're welcome, too,
I lately tend to mess up those checks *g*

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/lzo.c
===================================================================
--- libavcodec/lzo.c	(revision 7784)
+++ libavcodec/lzo.c	(working copy)
@@ -86,6 +86,14 @@
 static inline void copy(LZOContext *c, int cnt) {
     register uint8_t *src = c->in;
     register uint8_t *dst = c->out;
+#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
+    COPY4(dst, src);
+    src += 4;
+    dst += 4;
+    cnt -= 4;
+    if (cnt > 0)
+#endif
+    {
     if (src + cnt > c->in_end || src + cnt < src) {
         cnt = c->in_end - src;
         c->error |= LZO_INPUT_DEPLETED;
@@ -94,14 +102,9 @@
         cnt = c->out_end - dst;
         c->error |= LZO_OUTPUT_FULL;
     }
-#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
-    COPY4(dst, src);
-    src += 4;
-    dst += 4;
-    cnt -= 4;
     if (cnt > 0)
-#endif
         memcpy(dst, src, cnt);
+    }
     c->in = src + cnt;
     c->out = dst + cnt;
 }



More information about the ffmpeg-devel mailing list