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

Michael Niedermayer michael at niedermayer.cc
Fri Dec 25 00:08:15 CET 2015


On Thu, Dec 24, 2015 at 01:39:36AM +0100, Michael Niedermayer wrote:
> On Wed, Dec 23, 2015 at 03:52:50PM -0800, Ganesh Ajjanagadde wrote:
> > On Wed, Dec 23, 2015 at 3:38 PM, Michael Niedermayer
> > <michael at niedermayer.cc> wrote:
> > > On Wed, Dec 23, 2015 at 10:47:20AM -0800, Ganesh Ajjanagadde wrote:
> > >> exp10(x) is superior to pow(10,x).
> > >> Note that in some cases, this may affect integers derived from pow calls. When
> > >> spotted, this remark has been added to the relevant commit message.
> > >>
> > >> Note that if such a thing is troublesome, one can do one of two things:
> > >> 1. leave the pow(10,x) call as is in such places.
> > >> 2. replace the lavu/libm fallback by the correct pow(10,x) as opposed to the
> > >> sloppy exp2(M_LOG2_10 * x).
> > >>
> > >> Patches tested with FATE on x86-64, GNU/Linux.
> > >
> > > some of these fail on arm
> > >
> > > i suspect thats because exp10 is only available with GNU_SOURCE
> > > and we dont define that nor do we want to define that
> > > -DGNU_SOURCE often leaks in from pkg_config files though
> > 
> > ah, thanks for this. Out of curiousity, why don't we want to always
> > define it? My FFmpeg runs fine, built with GNU_SOURCE.
> 
> it would hide any use of GNU features and FFmpeg should work
> on non GNU platforms too.
> Its best if any non standard (c99/posix) features trigger immedeate
> errors for developers instead of having to depend on the roundtrip
> over bug reports to find and remove such uses
> 
> 
> > 
> > > my arm setup doesnt include many external libs so GNU_SOURCE doesnt
> > > get enabled
> > 
> > It is only with GNU_SOURCE as per man page; I assumed that was handled
> > via configure and the like and I thought I mentioned this somewhere
> > during the discussion.
> 
> 
> 
> 
> > 
> > >
> > > i didnt think deeply abot it but would it make sense to always enable
> > > the fallback even if exp10 is available? that is assuming the fallback
> > > is faster everywhere
> > 
> > The fallback is faster everywhere. The trouble is I run into linker
> > issues when it is available natively.
> 
> ifdef ... undef ...
> #define exp10(x) ...
> might work
> not sure this has other issues or not

an alternative would be to add and use av_exp10()
considering that our implementation is AFAIK much faster than the one
from glibc, all the troubble to use it could maybe be avoided


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151225/f9b79f3a/attachment.sig>


More information about the ffmpeg-devel mailing list