[FFmpeg-devel] [PATCH] fix compilation in cygwin

Stefan Gehrer stefan.gehrer
Tue Jan 12 00:15:29 CET 2010


M?ns Rullg?rd wrote:
> Michael Kostylev <michael.kostylev at gmail.com> writes:
> 
>> On Sun Jan 10 21:55:50 2010
>> Vitor Sessak wrote:
>>
>>>>> +#if !HAVE_LOG2F
>>>>> +static av_always_inline av_const float log2f(float x)
>>>>> +{
>>>>> +    return log(x) * 1.44269504088896340736;
>>>>> +}
>>>>> +#endif /* HAVE_LOG2F */
>>>> Calling log2() should be better.  Most of the bad libs have a full set
>>>> of double-precision functions.  It's the single-precision ones, which
>>>> were added in C99 that are often missing.
>>> Fine, even thought NetBSD lacks it (thats why we have a configure
>>> check for it, so no problem there).
>> Just for completeness:
>>
>>              log2 log2f exp2 exp2f
>> FreeBSD      -    -     +    + 
>> NetBSD       +    +     -    -
>> DragonFly    +    +     -    -
> 
> Ah, so log and exp are mutually exclusive in bsd-land.  Who'd have
> imagined _that_...

That's because if you have one function, you do not need its
inverse: You can just try a lot of different input values in
a for loop until you get the desired output (the input of the
inverse).
It's all a matter of trade-off: This way you save binary
size in exchange for losing some speed :)

Stefan



More information about the ffmpeg-devel mailing list