pmeerw's blog

17 Jul 2008

Thu, 17 Jul 2008

icc rocks on MC-EZBC

I tried the Intel C/C++ compiler (icc), 10.1.017, with MC-EZBC, see also my post on PGO with gcc.

icc 10.1.012 failed to compile the code, probably some compatibility issue with the gcc 4.2.3 installed on my system. The auto-vectorizer has to be disabled (-no-vec), otherwise the executable crashes.

Apart from that, the results are excellent (decoding 32 frames of the Foreman sequence, Intel Core2 Duo 2.66 GHz):

The fastest gcc results is 10.2 sec.

posted at: 14:48 | path: /programming | permanent link

Profile-guided optimization (PGO) with GCC

GCC supports profile-guided optimization for some time now. I gave it a try on the MC-EZBC video codec, which certainly can use some speedup from optimization :-).

To generate an executable which collects runtime information, use

gcc -fprofile-generate -o prog_gen_gpo prog.c
This create files ending in *.gcda and *.gcno in your source tree.

In a second compilation pass, instruct gcc to make use of the runtime profile information

gcc -fprofile-use -o prog prog.c
The profiling options must be given in the compile and link stage!

Results for decoding 32 frames, Foreman sequence, on a Intel Core2 Duo, 2.66 GHz, compiled with gcc 4.3:

The following CFLAGS -DNDEBUG -O3 -g -march=core2 -fomit-frame-pointer -fprofile-use -msse3 -mfpmath=sse provide best results, the new (with gcc 4.3) -march=core2 (or -march=native) helps at lot (2.1 sec), -mfpmath=sse brings 0.5 sec.

For comparison: gcc 4.2.3 -O3 is dead slow, 46.2 sec!

posted at: 13:47 | path: /programming | permanent link

Embedding fonts in PDFs

To convert a Postscript files (.ps) to a PDF file and embed all fonts use the command

ps2pdf -dPDFSETTINGS=/prepress -dSubsetFonts=true -dEmbedAllFonts=true paper.ps
(the /prepress setting is important); ps2pdf comes with the Ghostscript package. In order to check if all fonts are embedded, run
pdffonts paper.pdf
The emb column indicates whether the fonts is embedded; pdffonts comes with Poppler, use the poppler-utils package on Ubuntu.

posted at: 13:05 | path: /academic | permanent link

Made with PyBlosxom