[FFmpeg-devel] [RFC] abs vs FFABS

Ronald S. Bultje rsbultje
Sat Jan 17 17:26:31 CET 2009


Hi Uoti,

On Sat, Jan 17, 2009 at 11:10 AM, Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:
> The compiler should be able to optimize that whole function to
> "return 0;", and current GCC does.

The idea is that it doesn't because the input is (semi-)random. The
abs()/FFABS() is done on a calculated number per cycle. I wish I could
check assembler to ensure it does, but I don't think it can just be
optimized to return 0, because every outcome is checked (see test_end)
and it returns 1 if it is wrong.

Ronald




More information about the ffmpeg-devel mailing list