[FFmpeg-devel] [PATCH] reduce duplicate data

Stefan Gehrer stefan.gehrer
Wed Jun 25 16:32:13 CEST 2008

Stefan Gehrer wrote:
> Michael Niedermayer wrote:
>> On Wed, Jun 25, 2008 at 12:50:59PM +0200, Stefan Gehrer wrote:
>>> Hi,
>>> I have written a small program for a brute-force search of duplicate
>>> tables in ffmpeg. The result is attached patch, which removes all
>>> duplications between tables bigger than eight bytes.
>>> Most of it is removing tables in vc1data.c which are already present in
>>> msmpeg4data.c and should be straight-forward.
>>> A bit more controversial is the merge of mvtab (h263data.h) and
>>> ff_mpeg12_mbMotionVectorTable (mpeg12data.c) as it generates a new
>>> dependency for VC1/WMV3 decoder on mpeg12data.o
>> Iam against the ff_mpeg12_mbMotionVectorTable table change the rest is
>> ok
> applied without the motion table merge.
>> also it would be nice to have the "small program" in tools/ and maybe use
>> it during the regression tests to ensure no additional redundant tables
>> have been added.
> I will try to get it in reusable shape. Here is it's current output
> but there is not much interesting left :)

The duplicate-test program is attached. Example usage is

objdump -t ffmpeg_g | grep rodata > symbols.txt
objcopy -j .rodata -O binary ffmpeg_g rodata.bin
./duplicates symbols.txt rodata.bin

I know it would be cleaner to use something like libelf and properly
read out the symbols, but it's just a quick solution.

I realized that in the runs before I only checked global symbols,
now I also checked local symbols and found a lot more stuff to work at.
The biggest waste of space at the moment is libavformat/dv.c and
libavformat/dvenc.c including libavcodec/dvdata.h and therefore kBytes
of tables with dv_place_* name which they never use. Unfortunately
this is not trivial to resolve because of the dv_profiles structures
shared between libavformat and libavcodec.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: duplicates.c
Type: text/x-csrc
Size: 1777 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080625/d03776c7/attachment.c>

More information about the ffmpeg-devel mailing list