Toy h.261 decoder. I said this was doable in 1 sitting. I WAS WRONG!
2024-07-02: I got DCT+Quantization working after ~7 sittings...
2024-07-05: Implemented fast IDCT, shoutout Nayuki for the 1D implementation
2024-07-05: Basic INTER blocks after 9 sittings!
2024-07-06: Motion Vectors after 11 sittings!
2024-07-06: Working decoder after 12 sittings!
H.261 - The actual spec, kinda hard to read for a beginner
FFMPEG - An implementation that actually builds (looking at you maikmerten/p64).
Configuring with the following command will give you a minimal h261 ffplay build.
./configure --enable-debug=3 --disable-ffmpeg --disable-ffprobe --disable-doc --disable-everything --enable-decoder=h261 --enable-parser=h261 --enable-demuxer=h261 --enable-protocol=file --enable-filter=scaleYCbCr on Wikipedia - The color model
Discrete cosine transform on Wikipedia - Basically the most important part of the codec
JPEG on wikipedia - More DCT material
High level overview of h261 - I wish this was the first thing I read
Techniques and standards for image, video, and audio coding - Useful book (you have to create an archive.org account to borrow)
Fast DCT implementation - This helped me achive real-time decoding (on a 3700X at leasts).