[FFmpeg-devel] [RFC] remove lrintf fallback implementation

Víctor Paesa wzrlpy
Mon Oct 29 20:10:08 CET 2007


Hi,
V?ctor Paesa said:

> The route I'm pondering by now is to create my own (minimalistic)
> libm99: if gcc delivers a C99 function missing in newlib I can do the
> same too, and it be would just a matter of using --extra-libs instead of
> patching ffmpeg.

It ended up that I do not need to create a separate library, as Cygwin
and MinGW use the same COFF format: I can leverage its llrint()
implementation.

a) We need first to download the mingw-runtime Cygwin package.

b) Then we create a small library:

ar x /usr/lib/mingw/libmingwex.a llrint.o
ar cq /usr/local/lib/libllrint.a llrint.o

c) And finally, we use that library in FFmpeg configure line:

 --extra-ldflags='-L /usr/local/lib' --extra-libs='-l llrint'

This works well because the llrint() implementation is self-contained.
I checked that at the source code:

$ cat /usr/src/cygwin-1.5.24-2/winsup/mingw/mingwex/math/llrint.c
#include <math.h>

long long llrint (double x)
{
  long long retval;
  __asm__ __volatile__                                                    
   \
    ("fistpll %0"  : "=m" (retval) : "t" (x) : "st");
      \
  return retval;
}

Hence, instead of patching FFmpeg, my attached patch proposal modifies
the documentation for compilation under Cygwin.

Regards,
V?ctor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.cygwin.llrint.4.diff
Type: text/x-patch
Size: 1540 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071029/660adfc6/attachment.bin>



More information about the ffmpeg-devel mailing list