[XviD-devel] What are the most important optimization opportunities?

Felix von Leitner xvid-devel@xvid.org
Sun, 19 Jan 2003 02:22:51 +0100


--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I'm interested in spending time helping optimize the xvid sources.
I have next to no understanding of how MPEG 4 works, but I am currently
trying to learn MMX, SSE and 3dnow, so I would be willing to convert a
few functions if they lend themselves to vectorization.

Please name a few functions that are called particularly often and are
stable enough that optimizations would not be useless as the function is
being rewritten right now.

Attached is a small trivial diff that I noticed.  The #if 0 part in the
end is to make the vim editor use the proper tab stops.  I would prefer
if xvid used standard 8-width tab stops, though, but that's not my
decision to make.

Felix

--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bitstream.c.diff"

Index: bitstream.c
===================================================================
RCS file: /xvid/xvidcore/src/bitstream/bitstream.c,v
retrieving revision 1.28.2.19
diff -u -r1.28.2.19 bitstream.c
--- bitstream.c	14 Jan 2003 10:30:39 -0000	1.28.2.19
+++ bitstream.c	19 Jan 2003 01:04:04 -0000
@@ -75,6 +75,9 @@
 #include "mbcoding.h"
 
 
+#if defined(__GNUC__) && defined(__i386__)
+#define log2bin(value) ({ unsigned long res; asm("bsr %1,%0\n\tincl %0" : "=r"(res) : "r"(value)); res; })
+#else
 static uint32_t __inline
 log2bin(uint32_t value)
 {
@@ -94,6 +97,7 @@
 	}
 #endif
 }
+#endif
 
 
 static const uint32_t intra_dc_threshold_table[] = {
@@ -1379,3 +1383,7 @@
 	}
 
 }
+
+#if 0
+vim:ts=4
+#endif

--LQksG6bCIzRHxTLp--