[FFmpeg-devel] [PATCH]pes packetizer

Trent Piepho xyzzy
Fri Jun 29 23:27:28 CEST 2007


On Fri, 29 Jun 2007, Michael Niedermayer wrote:
> On Fri, Jun 29, 2007 at 09:36:27AM +0800, realsun wrote:
> [...]
> > Index: pes.h
> > ===================================================================
> > --- pes.h	(revision 0)
> > +++ pes.h	(revision 0)
> > @@ -0,0 +1,159 @@
> [...]
> > +static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
>
> putting tables into headers will cause them to be duplicated in every
> object which used the header

gcc and other compilers are smart enough to omit static const variables
that are never referenced from object files.  It will only be duplicated in
every object that actually uses the variable, not all the ones that include
the header.

In DSOs, static globals are more efficient, space and speed wise, than
non-static globals, so duplicating a 16 byte array might actually use less
space.




More information about the ffmpeg-devel mailing list