[FFmpeg-devel] [PATCH 2/2] configure: Use intel math.h header.

Matt Oliver protogonoi at gmail.com
Wed May 7 15:52:26 CEST 2014

icl when run under msvc12 currently generates incorrect code. This is due
to an issue with msvc12's C99 additions to math.h. Several defines in
msvc's math.h are not compatible with icl and will compile but generate
erroneous results during runtime. An obvious example is that NAN from
math.h evaluates to 0.0 under icl which is clearly not a correct value for
NaN. This cause several errors that completly break FFmpeg.

There are several ways to fix this. 1) Force icl's floating point
compliance but negatively impact performance in doing so. 2) Add compiler
specific code into FFmpeg or 3) Have icl use its own native math header
(which can also improve performance).

Using 1) introduces performance degradation and will break again should the
user specify additional conflicting configure flags. Using 2) adds icl
specific code handling into FFmpeg which is rather ugly and should probably
be avoided. Using 3) fixes all errors and has the potential to increase
performance through Intels optimized math routines.

Since 3) seems to work best attached is a patch to force in the inclusion
of icl's math.h (named mathimf.h) which will override msvc's math.h and
avoid any issues.

Note in order for this to work the previous patch entitled "Fix clashes
with 'I' and 'complex' defined in complex.h" must have been previously
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-configure-Use-intel-math.h-header.patch
Type: application/octet-stream
Size: 1041 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140507/200f488f/attachment.obj>

More information about the ffmpeg-devel mailing list