[FFmpeg-devel] [PATCH 00/15] replace pow(10, x) by exp10(x) across FFmpeg

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Dec 24 22:57:39 CET 2015

On Thu, Dec 24, 2015 at 1:49 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
> On Thu, Dec 24, 2015 at 11:47 AM, Ganesh Ajjanagadde <gajjanag at mit.edu>
> wrote:
>> On Thu, Dec 24, 2015 at 8:37 AM, Ronald S. Bultje <rsbultje at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > On Wed, Dec 23, 2015 at 7:49 PM, Ganesh Ajjanagadde <gajjanag at mit.edu>
>> > wrote:
>> >
>> >> What I meant was the following (I casually labelled it as ifdef, I
>> >> meant some preprocessor stuff):
>> >> #if !HAVE_EXP10 || !(defined(_GNU_SOURCE))
>> >> ...
>> >> #endif
>> >>
>> >> I have reproduced your issues via a minimal configure line, and the
>> >> above idea fixes those. Do you see any issues? Of course, there is the
>> >> theoretical one of a libc (more precisely libm) having exp10 without
>> >> GNU_SOURCE, but in that case it should just use the fallback.
>> >
>> >
>> > I don't like this as much. In all other instances of any other function
>> > whatsoever, we just check if the function exists. We should do the same
>> > thing here. If implemented correctly in configure, #if !HAVE_EXP10 should
>> > always work. If we can fail to compile when compiling some video filter,
>> we
>> > can fail alike when testing for the feature in configure.
>> It is not easy to do via configure, as Michael points out since
>> GNU_SOURCE may get enabled from pkg-config and other steps in
>> configure. Basically then this will need to be deferred to a stage way
>> below in configure, once all cflags have been set to their values.
>> This will add IMHO greater complexity to configure than the ugly hack
>> above.
>> Ultimately, it is a question of which one is preferred. If you still
>> feel this way, I will delve a bit into configure to see what can be
>> done.
> exp10 is just one of the many bits where this will come in useful, so I'd
> rather have a solution that covers all bases than adding many ||GNU_SOURCE
> hacks all across the codebase in random, undefined places.

Indeed, please see
for a better solution (based on discussions with Nicolas).

Also, over time I would like to cleanup the avutil/libm header: there
are macros in places where there should really be functions, though
Hendrik points out that in some cases there is no real alternative. At
the moment, most of the macros are used without any justification in
the patch notes or as comments.

> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list