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

Vitor Sessak vitor1001
Tue Jan 12 03:20:13 CET 2010


M?ns Rullg?rd wrote:
> Vitor Sessak <vitor1001 at gmail.com> writes:
> 
>> 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_EXP2F
>>>>>>> +static av_always_inline av_const float exp2f(float x)
>>>>>>> +{
>>>>>>> +    return exp(x) * 0.693147180559945;
>>>>>>> +}
>>>>>>> +#endif /* HAVE_EXP2F */
>>>>>> Same again.  exp2() should be preferred.
>>>>> Let's hope that at least exp2() is supported...
>>>> exp2() is missing in NetBSD and DragonFly.
>>> We have a replacement for it, so it's OK.
>> We have a replacement for log2(), but not for exp2().
>>
>> I'm slightly favorable of adding a replacement for exp2() (as
>> attached) as we do for log2(), since we can get some speed gain in
>> platforms where exp2() is supported and we'll eventually need exp2()
>> sooner or later.
>>
>> -Vitor
>> Index: configure
>> ===================================================================
>> --- configure	(revision 21124)
>> +++ configure	(working copy)
>> @@ -950,6 +950,8 @@
>>      dos_paths
>>      ebp_available
>>      ebx_available
>> +    exp2
>> +    exp2f
>>      fast_64bit
>>      fast_cmov
>>      fast_unaligned
>> @@ -965,6 +967,7 @@
>>      libdc1394_2
>>      llrint
>>      log2
>> +    log2f
>>      loongson
>>      lrint
>>      lrintf
>> @@ -2370,8 +2373,11 @@
>>  check_lib math.h sin -lm
>>  check_lib va/va.h vaInitialize -lva
>>  
>> +check_func exp2
>> +check_func exp2f
>>  check_func llrint
>>  check_func log2
>> +check_func log2f
>>  check_func lrint
>>  check_func lrintf
>>  check_func round
>> Index: libavutil/internal.h
>> ===================================================================
>> --- libavutil/internal.h	(revision 21124)
>> +++ libavutil/internal.h	(working copy)
>> @@ -263,6 +263,20 @@
>>      }\
>>  }
>>  
>> +#if !HAVE_EXP2
>> +static av_always_inline av_const double exp2(double x)
>> +{
>> +    return exp(x * 0.693147180559945);
>> +}
>> +#endif /* HAVE_EXP2 */
>> +
>> +#if !HAVE_EXP2F
>> +static av_always_inline av_const float exp2f(float x)
>> +{
>> +    return exp2(x);
>> +}
>> +#endif /* HAVE_EXP2F */
>> +
>>  #if !HAVE_LLRINT
>>  static av_always_inline av_const long long llrint(double x)
>>  {
>> @@ -277,6 +291,13 @@
>>  }
>>  #endif /* HAVE_LOG2 */
>>  
>> +#if !HAVE_LOG2F
>> +static av_always_inline av_const float log2f(float x)
>> +{
>> +    return log2(x);
>> +}
>> +#endif /* HAVE_LOG2F */
>> +
>>  #if !HAVE_LRINT
>>  static av_always_inline av_const long int lrint(double x)
>>  {
> 
> I'm fine with this.  Please commit it so we get rid of those build
> failures.

Applied.

-Vitor



More information about the ffmpeg-devel mailing list