NanoJPEG: a compact JPEG decoder

(April 29, 2009)

If you followed my works, you know that I like compact, single-file implementations of decoders for various media formats, and where such a thing doesn’t exist, I tend to write or at least port one myself. Now I’d like to add the third format to that list: Baseline JPEG images.
Read more …

A MPEG Audio Layer II decoder in 4k

(September 19, 2006)

Last week, I read a paper on how to partially encrypt MPEG Audio data. That is, modify an existing audio file that it is still syntactically correct, but sounds more or less broken. For example, imagine an online music shop that offers free, but partially encrypted music downloads: The files are in bad quality, and you have to pay to restore the full fidelity. But I digress.
The point is: that paper was inspiring. I decided to try the presented method using MPEG-1 Audio Layer II (»MP2«) as a basis. I chose this format because it’s the simplest audio compression scheme that is still in broad use today (for example VCD/SVCD, DAB and most prominently DVB). Layer III (»MP3«), AAC and Vorbis are considerably more complex. And, it just so happened that I got a copy of ISO 11172-3 (MPEG-1 Audio) on my hard disk :)
While working on the project, I thought that it’d be cooler to write a full decoder instead of this mere proof-of-concept »look what I can do to my MP2 files« hack. So I developed a small MPEG-1 Audio Layer II decoding library called kjmp2 which eventually evolved into a less-than-4k MP2 player application …
Read more …

The inner workings of »Origami«

(April 22, 2006)

As promised in my post about writing 4k intros, I’m now digging a bit deeper how my 4k (actually 3.5k) intro Origami 3.5K was made. I’ll start with a »end-user« FAQ that covers some of the artistic and organizational aspects. The rest of this article will be very technical. Maybe the information isn’t directly useable in other projects, or maybe my solutions aren’t the optimal ones, but I hope that anyone who is going to do a 4k intro soon finds at least part of the information useful. YMMV.
Read more …

How to write a 4k demo/intro

(April 6, 2006)

Now I’m almost done with the functional part of my 4k intro (read: all the tricky stuff is working, and there’s still lots of space to add new stuff). I’ll use this occasion to summarize some of my findings. Maybe someone else will find it useful (but I doubt that :) – I surely do, so this is also some kind of reference for myself. So here is KeyJ’s little TinyDemoWritingGuide. It’s targeted towards experienced C programmers. Not everything here may be completely true as I’m a beginner in the 4k field for myself.
Read more …

Size coding loses its magic if you do it yourself

(April 1, 2006)

From the programmer’s point of view, 4k and 64k size limited demos are particularly interesting, because these types of demos rely much more on code than on data. And of course, there’s the sheer fascination of really cool graphics and excellent music in such a tiny amount of space. Programmers appreciate size limited demos the most, because they know how hard it is to get the code so small.
I’m no exception: When I first saw major 64k masterpieces like Heaven 7 or the product, my jaws dropped considerably further than those of my non-programmer friends, because I knew that 64k is really not much space.
Read more …