[Libav-user] ff_log2_tab defined multiple times in the fmpeg 1.1 libraries, bug or feature ??

Hendrik Leppkes h.leppkes at gmail.com
Fri Feb 15 09:15:16 CET 2013

On Fri, Feb 15, 2013 at 1:27 AM, Lars Hammarstrand
<lars.hammarstrand at gmail.com> wrote:
>> However, not only that, it would also require exporting a ff* private
>> symbol from avutil, and adds a lot of complexity when dealing with
>> shared library builds on some systems (eg. MSVC)
> This is one part that I don't understand, what problem does MSVC have that
> requires multiple definitions of the same global variable?  Btw, what do you
> mean by "private" symbol in this case, private like in a class definition or
> "static global in c" like  Linkages of identifiers ?

Everything prefixed with ff are private symbols in ffmpeg, and as such
are not supposed to be exposed in link libraries, because they are not
part of the public API/ABI.
There are already too many exceptions to this, and this avoided even more.

> Anyhow, there was an another case with exactly the same problem in
> libavcodec v53.61.100  The global variable ff_inverse[257] in
> libavutil/inverse.c was included by libavcodec/inverse.c but has now moved
> into mathtables.c and is declared in mathops.h (see below). AFAIK there has
> been no problem so far with for MSVS.
> libavcodec/mathops.h: extern const uint32_t ff_inverse[257];
> libavcodec/mathtables.c: const uint32_t ff_inverse[257]={

This is the exact reason it was moved from libavutil to libavcodec.
Its only used in libavcodec, and to avoid loading the table from
another library, it was moved into the library which actually uses it.

More information about the Libav-user mailing list