[FFmpeg-devel] [PATCH] Make ff_inverse stay with libavutil, and optional copy it to libavcodec.
Michael Niedermayer
michaelni
Tue Jul 20 18:41:15 CEST 2010
On Tue, Jul 20, 2010 at 06:16:51PM +0200, Diego Elio 'Flameeyes' Petten? wrote:
> The ff_inverse table is used by FASTDIV macro, defined in libavutil, but up
> to now the table was defined only in libavcodec.
>
> After this change, the main copy of ff_inverse is part of libavutil (just
> like FASTDIV), but if CONFIG_SMALL is unset, then a different copy is made
> available to libavcodec, to avoid the performance penalty of using an
> external look up table.
>
> Dynamic linking works, because the libraries are linked with -Bsymbolic, so
> the local copy of the symbol has priority over the external; static linking
> works because the table is on a standalone object file in both libraries,
> so the linker is able to discard one of the two.
>
> Tested on Linux/x86-64 and Mac OS X/x86-64.
> ---
> libavcodec/Makefile | 2 +
> libavcodec/dsputil.c | 38 -------------------------------
> libavutil/Makefile | 1 +
> libavutil/inverse.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 63 insertions(+), 38 deletions(-)
> create mode 100644 libavutil/inverse.c
>
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 965948c..fab5211 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -609,6 +609,8 @@ OBJS-$(HAVE_W32THREADS) += w32thread.o
>
> OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
>
> +OBJS-$(!CONFIG_SMALL) += ../libavutil/inverse.o
this needs a comment, in 2 years noone might rememeber why this was
done and in the meantime we would get patches from smart people
removing cruft
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100720/3fa23e9a/attachment.pgp>
More information about the ffmpeg-devel
mailing list