FFhistory: Måns Rullgård

Finally I can pay homage to a man whose contributions to the project are rivalling Fabrice’s and Michael’s. Of course I’m talking about Måns.

Born in rural Sweden, he went to study at KTH, one of the most prestigious universities in the world. There he together with Michael Ahlberg created tcvp player, a “slightly over-engineered” system as he admits (as it depended on its own portability layer library and used its own build system called TC2). I have the honour of being introduced to one of its developers by another one.

Måns also had interest in embedded systems and created omapfbplay, a demonstration video player for OMAP-based systems (like BeagleBoard) which managed to squeeze every last cycle of the performance from it to play H.264 videos. He was also involved in creating VideoWall—a Beowulf cluster of BeagleBoards playing large video file by splitting it into separate tiles and showing them on individual displays.

He worked at different hardware-related companies and did freelance consulting. He was employed by ARM at some point and it was the company that managed to persuade him to join after years of asking to do so, unlike, say, Reimar Döffinger who got work at ARM (their Swedish subsidiary) but mostly because he could not find anything better.

Måns was known for his profound knowledge of C standard (people believed he knows it all by heart along with all the compiler quirks) and MPEG streaming containers among other things. I don’t know what he does nowadays but I hope he’s doing well as he deserves only the best.

Anyway, what has he done for FFmpeg since his first patches in 2002? I think his work can be divided into five large categories: new build system, new FATE system, ARM optimisations, exotic systems support and optimisations, C language related fixes and optimisations. Let’s review them all. But before doing that I should mention the fact that he was one of the server admins as well (truly Jack of all trades—but master of them as well).

I still remember the times when you could change a file, build ffmpeg and it would crash because the structure definition in a shared header file would not make dependent files recompile. So some people, mostly he and Diego, decided to make it properly and essentially rewrote build system from scratch. Nowadays somebody naïve comes time from time and proposes to replace it with a popular build system used in some other projects but it is very hard to do because while it may be old and configure is slow on Windows (because process spawning is expensive there, unlike on UNIX), it allows to configure individual components and resolve the required dependencies for them and create configuration files for Make. So far no other solution could provide the same features.

As I mentioned above, Måns had interest in embedded programming as well as more exotic hardware. That is why he accumulated various computing devices and tried to run ffmpeg on them, providing patches for the build or some possible optimisations. And when The Multimedia Mike devised FATE for catching regressions, Måns took it as an inspiration and improved existing build system for regression tests, created network infrastructure for running regular tests and reporting the results, and of course used his devices to run those tests.

Naturally some of those devices were ARM-based. So Måns created various bits of code to make decoders run faster on the rather underpowered hardware. He also changed C code in order to make it easier to optimise (I still remember his changes to AAC and DCA decoders, to give an example). From what I heard he actually earned his bread at some point by writing optimised ARM code at request for some commercial closed-source projects.

As I mentioned in the introduction, he knew the C specification (almost?) by heart so usually when he quoted from it it was the end of discussion (this was different from, say, Michael Niedermayer who sometimes believed that the compiler should do stuff in a way he thought even if it turned out to disagree with the real compiler behaviour and the language specification). Måns had also vast experience with various C compilers for various platforms so he knew what kind of code may cause miscompilation or speed degradation in certain compilers and how to work around it. Along with Diego he helped to make overall codebase cleaner and more portable.

Even before the split he got fed up with the project and virtually retired. After the split libav developers managed to get him back for a while but he got disillusioned and left for good (probably he could foresee the future better than the rest of us).

Speaking about the split, here’s yet another random fact: he designed the original FFmpeg logo. So after the split he did not want it to be used by the project (so Luca found a lawyer to send a letter to Michael telling that, I think it’s still the only legal letter in FFmpeg history), that’s how the current logo is more 3D-ish.

In general, his attitude to learning things was to study the concepts and make some useful thing with it. That’s how many of his works came to life. I can remember only one case where he did not achieve good results: back in the day he tried to write a native inflate implementation for FFmpeg, he got it to the point of “mostly working but there are still bugs in corner cases” state but then a split happened and he lost interest before weeding out those bugs.

I can only wish that he would never have a greater failure in life.

One Response to “FFhistory: Måns Rullgård”

  1. […] Kostya's Rants around Multimedia « FFhistory: Måns Rullgård […]