[FFmpeg-devel] [PATCH] Change round to rint in atrac3.c
Michel Bardiaux
mbardiaux
Mon Oct 15 14:52:13 CEST 2007
M?ns Rullg?rd a ?crit :
> Fred Rothganger <fred at rothganger.org> writes:
>
>> I am compiling ffmpeg under cygwin with -mno-cygwin, and then linking
>> the resulting static libs under MSVC 2005 edition. There are three
>> symbols that remain undefined at link time:
>>
>> _snprintf
>> _gettimeofday
>> _round
>>
>> This patch addresses _round. Don't know what the efficiency impact is
>> of using rint() and cast rather than round().
>
> It's not only a matter of efficiency, it's also a matter of
> correctness. Using rint() here is plain wrong for several reasons.
> Firstly, rint() uses the current rounding direction, which we have no
> control over, thus making the exact output unpredictable.
Mmm, then why all those calls to lrint and lrintf?
> Secondly,
> rint() raises the inexact exception when the argument is not an
> integer.
>
> Just get a C99-compatible libc and be done with it.
>
--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be
Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
More information about the ffmpeg-devel
mailing list