[XviD-devel] optimizations

Radek Czyz radoslaw at airnet.com.au
Sun Apr 6 01:35:26 CEST 2003


Hi,
I was doing a bit of profiling/optimizations today. My target was
d_mv_bits(), as it wasn't so fast so I thought and is used in
almost every checkcandidate.

Now the funny part: we use ABS() there. Twice. It's a macro, #defined
as (X<0?-X:X) which looks cool. However, this is _not_ the tricky
abs() used by MSVC, so it produces branches. My question is why do we
use macro, if compiler's abs() works either better (MSVC) or at least
not worse (gcc 2.9) ? Is there any reason?
I was able to remove the two other branches from this function and now
CodeAnalyst is unable to measure any time taken by this computation
(the average was 33 cycles, now it's more like 0.5 <-- I don't think
it's a real value)

Regards,
Radek



More information about the XviD-devel mailing list