Archive for March, 2010

325th Anniversary

Wednesday, March 31st, 2010

Today (new style, otherwise it’s March 21st) is 325 years since The Composer was born.

While there are many composers — gifted, talented, geniuses — there was only one Composer who wrote Music. This Music deserves a capital letter because while it was originally written for certain instruments it is actually can be played on virtually everything (and it’s de facto test for new instruments). While it was a common practice for Baroque music to re-arrange music for whatever instruments were available, this Music can be translated to be played on almost any other instrument — usually exercising all possible sounds that instrument (and player) can provide.

Here is one example (violinist test is even more obvious):

Organist proficiency test

Organist proficiency test

I’m not into music (I don’t play any musical instruments nor even know the musical notation beyond “it’s notes”) but I can value music by certain parameters. Two main factors for me are complexity (here it’s explained formally) and melody. The stuff you can hear on radio here usually lacks both. Contemporary instrumental music usually lacks one of this (yes, it’s mostly either total cacophony to my ears or melodic and quite primitive). And I don’t think it’s a coincidence that I both like to program and reverse-engineer and to listen how melodies get intertwined together, how quite simple tunes form one big piece of music, how the whole theme changes both logically and unpredictably at the same time.

Without The Composer’s Music this world would be much crappier and there would be significantly less happiness. And while 2010 is Chopin Year, every March is The Composer’s month.

A private history of prank that failed

Saturday, March 27th, 2010

How would you call the following situation: a man who has never travelled alone and never been abroad suddenly appears in a foreign country. He does not know local language nor customs. And all that happens on 1st of April.

Well, sounds like a prank indeed but it were the best days of my life. I don’t remember whose idea it was but I quite suddenly decided to visit Sweden (okay, blame those subtitles in Monty Python and the Holy Grail ) and first half of April was the time when I could do that.

What’s a first thing any tourist should do in Stockholm? In my case it was wandering in Sundbyberg. I did a lot of things every tourist should do — visiting a dozen of museums (first two of them were Post Museum and Royal Coin Cabinet) and no art galleries,going to Skärholmen and not visiting any big shops there, not buying any elk toys or T-shirts with silly inscriptions, going to churches to listen to organ music, being at city centre and shopping only at two places there (Teknik Magasinet and Hemköp); as an extra I’ve been to Copenhagen for a day and have not seen any mermaids or castle interiors.

Also I’ve attended FFmpeg developers conference (Swedish branch). It was very nice to see all those people in person. One of them was very kind to give me a short tour on Stockholm (Odenplan – KTH – Stureplan – Norrmalmstorg).

I’ve lost my heart at Sweden. This country style is “simple, beautiful and effective” applied everywhere. And if you heard the saying “the way to a man’s heart is through his stomach”, it took place too (a sure sign is that when other developers’ commit messages start with “10l cola: …” mine start with “10l trocadero: …” and thinking of Emmentaler as “Swiss version of Grevé”).

And I can’t fully express my gratitude to Benjamin Larsson without whom all of this could not happen.

Enough with reminiscences, I’ll try to produce some codec material to write about.

Some Observations on Transport Infrastructure

Thursday, March 25th, 2010

Today I’d like to rant about the ways transport is organised in different places I’ve visited so far.


Bink samples needed

Wednesday, March 10th, 2010

I’m searching for old Bink samples. There are plenty “BIKi”, “BIKf” and some “BIKh” samples available but next to nothing of older ones. By pure luck we were able to find some “BIKb” but that’s all.

We are still in need for old Bink versions, anything from “BIKa” to “BIKe”. Can you help us?

Here’s that list of stuff using Bink. Looks like that games released since 2000 use “BIKf” and later, so we are hunting earlier games (and it’s because some Mike has not bothered to retrieve all that information from MobyGames).

Probably “Might & Magic VIII: Day of the Destroyer” demo may use it (release uses “BIKf” and “BIKh”), for a start. Maybe some other Heroes of Might and Magic III games have them (“Shadow of Death” addon I have features “BIKb”).

Any help will be appreciated.


Bink versions are determined by first four bytes of file, any hex viewer can help you.

Some games (like the ones by New World Computing) may have all video files in single archive named like “videosomething.smt” or “something.vid”, sometimes along with Smacker files. But those archives usually feature file names at the beginning, again that can be easily viewed with any hex viewer. And if file resides in directory named “Video” or “Movie” it’s a good hint too.

Update: looks like there are no such files (except maybe in some archives of RAD developer(s)).

A bit about old Bink

Sunday, March 7th, 2010

I don’t think you’ll ever encounter Bink video version ‘b’, known samples were dug out from game data of certain New World Computing games. And looks like they are not supported by official software anymore. But why that can stop us from looking at it?

This information is based on findings by certain FFmpeag deaveloper and me looking at disassembly for similarities with newer Bink version.

The main difference is that this version does not employ Huffman coding at all. All bundle data is stored in raw form, 4-11 bits per entry depending on bundle type. Number of elements in bundle is stored as 13-bit number, newer version uses different number of bits depending on plane width.

Also this Bink used floating-point version of DCT (but constants are the same as in integer version employed by latter codec version).

Coding methods (block types) are in totally different order as well. And 8×8 -> 16×16 scaling block type was not devised in that time either. Bundles contain slightly different data as well — for example, quantisers and number of residue masks are there but pattern run block uses diminishing number of bits to code runs instead of reading it from bundle (indeed, if you have to decode 48 more block elements you need to read 6 bits but when there are mere 7 block elements left 3 bits are enough).

I’ve not looked too close at DCT coefficient/residue coding methods but they seem to resemble those used in newer version of codec.

Short conclusion: while Bink video codec steadily improved, most concepts are remained the same (but there’s a bigger leap between versions ‘b’ and ‘f’ than between ‘f’ and ‘i’, the latter are almost backwards compatible). And maybe we’ll see decoder for it in FFmpeg for completeness sake.