[Ffmpeg-devel] -fwhole-program -combine

Ramiro Polla angustia
Mon Feb 26 03:49:56 CET 2007


Hello,

Note: attached patch is for informational and archiving purposes only.

With gcc 4.1.2 out, I decided to build FFmpeg with -fwhole-program 
-combine to see what happened. My previous attempts with older 4.1.1 
came accross the externally_visible bug (it was ignored, so it didn't 
link correctly).

I made some changes to configure and the makefiles to echo out the 
filenames, and then when a program is being built (only ffmpeg on my 
case), it builds with all source code in the command line.

I'm not sure it was necessary, but I put a #ifndef header_h to all 
headers that missed it.
I also removed some stuff that was throwing errors from imgconvert.c

Then I configured, removing some codecs and muxers that caused a buch of 
errors, with this command line:
./configure --enable-whole --cc=gcc-4.1.2 --disable-mmx --disable-zlib 
--disable-decoder=vc1 --disable-decoder=wmv3 --disable-parser=vc1 
--disable-decoder=h264 --disable-encoder=h264 --disable-parser=h264 
--disable-decoder=svq3

Compiled, and benchkmard with a 100 seconds output_example mpg with this 
comman line:
nice -20 ./ffmpeg_whole_g -benchmark -y -i input.mpg -f avi -vcodec 
mpeg4 -acodec wmav1 /dev/null

Then also configured and compiled without --enable-whole, to compare and 
benchmark.

These were the results:
ffmpeg_g: 10718593 bytes
ffmpeg: 3430584 bytes
ffmpeg_whole_g: 11684716 bytes
ffmpeg_whole: 3712872 bytes

ffmpeg_whole_g benchmark average: 18.960s
ffmpeg_g benchmark average: 18.710s

Basically, ffmpeg_g got 9% larger, ffmpeg got 8.2% larger, and the 
benchmarks showed a slowdown of 1.3%. Way to go gcc =)

Pretty frustrating... I was hoping it would be faster or smaller. Am I 
missing something to get the "agressive" optimizations to work properly?

btw, what good is -DBUILD_AVUTIL good for? It doesn't seem to be used 
anymore.

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whole_program.diff
Type: text/x-patch
Size: 36704 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070225/3d29fd3d/attachment.bin>



More information about the ffmpeg-devel mailing list