[Ffmpeg-devel] trying to reduce the binary size when few mpegvideo codecs are built.

Michael Niedermayer michaelni
Tue Oct 10 21:27:32 CEST 2006


On Tue, Oct 10, 2006 at 08:56:21PM +0200, pecno rabane wrote:
> hi,
> I am working on an embeded OS, and devices with limited memory. (no secret it's rockbox for ipods, irivers, and other dap)
> We are working on mpeg2 video codec, but actually the binary size when you only select mpeg2 is around 1,5 megs, when building just the apiexemple.c .
> So I am wondering if anyone have an idea to modularise and reduce the binary code.
> Actually the various mpeg codecs have some functions in common.
> It's not a problem exept that this functions are choosing at runtime wich depend subroutine to call, therefore all the routines present in libavutil or dsputil are built, because they are all referenced in a struct.
> so I am wondering what is the way to go.
> Using ifdefs in the referenced struct, and also in the common functions, kind of like it's done to separate encoders and decoders ?
> I prefer avoid to start something if it's a bad idea and rejected in the end.

first id say split the really huge files like dsputil into several files and
dont compile them if they arent needed
second add #ifdefs around the code which initalizes the fields of the struct
with the function pointers

and send small patches, if you send a single huge one which splits dsputil 
into 10 files and the adds #ifdefs around 500 things ill rejecte it with a
note that it must be split
so id say for every file split out of dsputil there should be 1 patch

> about libavutil I don't see what is the gain by referencing most of the methods into a struct.

which struct rferences stuff from libavutil?


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list