lundi 28 avril 2008

Magic the Gathering (multiplatform)

Just a link for those wanting to play MtG online on linux or mac :
http://mindless.sourceforge.net/

It is said to be compatible with apprentice.

For non rpm based distribution, you can either build it from the source or use alien to convert the rpm file to your distribution package system

under debian or ubuntu

sudo apt-get install alien
wget downloads.sourceforge.net/mindless/mindless-1.6-1.i386.rpm
sudo alien --to-deb mindless-1.6-1.i386.rpm
sudo dpkg -i mindless-1.6-1.i386.deb

The card data base will also be needed, they are not released with the program.

here is a link http://www.magic-league.com/download/10th%20patch.zip

vendredi 18 janvier 2008

bbg33k|^{bb}

to be geek or not to be,
just a photo of me at work with some of my anti-stress

vendredi 10 août 2007

mplayer -> VLC ?

I have decided to use VLC instead of mplayer/mencoder for one single reason : VLC supports MPEG-2 TS muxing (through the libdvbpsi) while mencoder do not.

Of course it may be possible to use this lib with mplayer too, but I don't want loosing my time to hack it ...

update 17/08/2007
Mmm, it seems that it is supported in ffmpeg (and so mencoder) too but it is not documented.
The output format name option is "mpegts".
Alternatively there is apparently the Avidemux software that can do the muxing job.
I cannot test right now ... So it's a note for later ...

mardi 7 août 2007

minitutorial : video.yuv -> video.yuv.avi

Well just a small tutorial note for people working with me on video coding ...

to obtain a yuv video from any video source that mplayer can read, execute:
mplayer file.ext -ao null -vo yuv4mpeg -o file.yuv
and to pack a yuv video file into an avi container use:
mencoder file.yuv -ovc copy -o file.yuv.avi
to keep the sound in the uncompressed avi you can do:
mplayer file.ext -ao pcm -vo yuv4mpeg
mencoder stream.yuv -audiofile audiodump.wav -ovc copy -o file.yuvpcm.avi

the two actions can be done in one single command like this:
mencoder file.ext -ovc raw -nosound -of avi -o file.raw.avi
or
mencoder file.ext -ovc raw -oac pcm -of avi -o file.raw.avi

mardi 31 juillet 2007

gcc -a

in man pages of gcc 3

       -a  Generate extra code to write profile information for
basic blocks, which will record the number of times
each basic block is executed, the basic block start
address, and the function name containing the basic
block. If -g is used, the line number and filename of
the start of the basic block will also be recorded.
If not overridden by the machine description, the
default action is to append to the text file bb.out.

This data could be analyzed by a program like "tcov".
Note, however, that the format of the data is not what
"tcov" expects. Eventually GNU "gprof" should be
extended to process this data.

This option was remove from gcc4 !
In http://gcc.gnu.org/gcc-4.1/changes.html

Transition of basic block profiling to tree level implementation has been completed. The new implementation should be considerably more reliable (hopefully avoiding profile mismatch errors when using -fprofile-use or -fbranch-probabilities) and can be used to drive higher level optimizations, such as inlining.

The -ftree-based-profiling command line option was removed and -fprofile-use now implies disabling old RTL level loop optimizer (-fno-loop-optimize). Speculative prefetching optimization (originally enabled by -fspeculative-prefetching) was removed.

What is tree level implementation ?
mmmh I'm thinking about installing gcc-3.4
... done
Warg it's the same.

There is also the thread:
http://www.cygwin.com/ml/binutils/2007-05/msg00345.html
and
http://gcc.gnu.org/ml/gcc/2001-08/msg01385.html

So I have to use gcov !

samedi 28 juillet 2007

For RPG geeks

Only because I love this video.
Here is Farador !

Farador D&D via Koreus

mardi 17 juillet 2007

MPlayer H.264 profiling (further ...)

Some interesting links
profiling line by line
annotated source listing

So, let's do it !

... working ...

gcc doesn't understand the "-a" option


Here is the new gprof command line to test :

gprof --line \
--annotated-source=h264.c:decode_residual \
--separate-files \
--directory-path=~/local/src/mplayer/libavcodec \
--flat-profile --no-graph \
~/local/bin/mplayer \
*.gmon > sumup.prof

Here is the head of the command result in sumup.prof




So, what's appears ?
mmmh everything is mixed, not just the decode_residual function as wanted, and the last gprof command consumes time...
Also just the function name line is commented and not all basic blocs as desired.
Something is missing ...

... thinking ...

rtfm gcc
does the -a option disappears in gcc-4 ?
is it replaced by -fprofile-arcs ? :/
... mmmh, no it doesn't seems.

lundi 16 juillet 2007

script to sum up profiling result not needed.

rtfm gprof
or http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC4

You can give more than one profile data file by entering all their names after the executable file name; then the statistics in all the data files are summed together.

No, we'll just need to find a representive set of videos.
for f in *.mov
do
mplayer $f
mv gmon.out {$f%.mov}.gmon
done
gprof ~/local/bin/mplayer *.gmon > sumup.prof

MPlayer H.264 profiling (continue ...)

Read the previous article

So the MPlayer H.264 first candidate function for HW acceleration (i.e.: the most time consuming procedure) is decode_residual (in libavcodec/h264.c part of FFmpeg). [geeknote: I use emacs with etags to browse and jump to source code].

Well, after analyzing the source code of this function, I've seen that there is in it a lots of inline procedures call. So these inline procedures are more likely the code parts to be HW accelerated but the profiling did not count the time consumed in theses procedures since there are inlined. Let's go further in the profiling using some more gcc compiling options
i.e.: --fno-inline.
sed s/OPTFLAGS.*/"& -pg -fno-inline"/ config.mak > tmp
mv tmp config.mak
make clean && make && make install
we run mplayer on the "1408" movie trailer and then analyze the profiling.



before removing inlining we had no detail of the decode_residual subfunctions.



after, there is more details:




Profiling extract of the "Ducaty" trailer decompression (without inlined function).

Finally, it seems the inlined procedures does not represent so much of the decode_residual function. For the "1408" movie trailer, the total execution time of decode_residual calls is 8.19 s within 2.10 s in the de-inlined functions.
For the "Ducaty" trailer the the total execution time of decode_residual calls is 2.2 s, within 1.1 s in the de-inlined functions.

lundi 9 juillet 2007

animated pdf figure : beamer + xfig + mpost/mptopdf

Minitutorial
This is a summary of usefull information I have found on the web and some tricks I've found myself.
You can have ave a look at http://www.xfig.org/userman/latex_and_xfig.html
(Xfig and pdf / section 4)

If your animation will just consists of successives layers of a figure you can
defines these layers with xfig provided that you will export the figure in the multimetapost format (.mmp files).
It is not so easy, to define the differents layers. With xfig you have to set the depths of your elements. Elements of consecutive depths will be parts of the same layer. Layers of deapest elements will be showned first.
Then when you have generated the .mmp file you may need to edit it.
For example I have had some latex code just for the accents.
% +MP-ADDITIONAL-HEADER
verbatimtex
%&latex
\documentclass{article}
\usepackage[french]{babel}
\usepackage[latin9]{inputenc}
\usepackage[cyr]{aeguill}
\usepackage[T1]{fontenc}
\begin{document}
etex
% -MP-ADDITIONAL-HEADER
then use mpost + mptopdf or just mptopdf that whill call mpost (I had problem using just mptopdf)
mpost -tex=latex myfile.mmp
mptopdf myfile.*
or just
mptopdf --latex myfile.mmp

In beamer you have to deactivate the covered feature if you normally use it.
For example:
\documentclass{beamer}
%\usepackage ...
\usepackage{xmpmulti}
% \DeclareGraphicsRule{*}{mps}{*}{}
\begin{document}
\setbeamercovered{transparent}
% some frames with transparent

\setbeamercovered{invisible} % deactivate transparent covered mode
\begin{frame}
\frametitle{my frame with the pdf animated figure}
\multiinclude[graphics={width=\textwidth},format=pdf]{figures/myfile}
\end{frame}
\setbeamercovered{transparent} % back to transparent covered mode
With xfig, I will suggest you first define the number of layers you want for your figure, let's say ten. Then set to 91,92,..,99 the depth of the elements that you want to be in the first layer; 81,82,..,89 the depth of the elements that you want to be in the second layer; and so on to 1,2,..9 the depth of the elements you want to be in the last layer.
In this way the number of tens indicate the number of the layer of the element, since you will probably not need more than 9 deapths for any layer (a diagram basically consists of a background shape, text, arrows, and eventually a foreground shape).

That's it.
It's just like a memo for me, but in the same time hope it could help ...
Don't hesitate to give feedback.

Today I prefer to use tikz with overlays and pause to do such animations in pdf documents generated by latex. It's more geeky, more hacker's tool !
I'll may post some example of what I have done with it later here.


update 15/08/2007
Tomorrow (another day :), I will test the animate package of Alexander Grahn
http://tug.ctan.org/macros/latex/contrib/animate/doc/animate.pdf
that auto-animate sets of graphics files or inline graphics.
Even il you don't need automatic animation, one feature of the package is that the animation running remains on the same pdf page whereas without this package animation like explain in this article creates various pages.
One drawback is that animation created with this package only can be seen with Adobe Reader or Acrobat.


Nicogeek