3 ms·
If you're interested in more "hands on" or practical video codec learning, I recommend writing a H.261 decoder. Only two supported frame sizes, no B-frames, and
by userbinator 7y ago
If you're interested in more "hands on" or practical video codec learning, I recommend writing a H.261 decoder. Only two supported frame sizes, no B-frames, and no intra prediction (effectively a subset of JPEG) make for a simple yet possibly quite rewarding weekend project that can be completed in around 700 lines of C (my attempt). Unfortunately not much existing media is available in 261, but I think watching a video being decoded entirely by code you wrote is a pretty fun experience, including all the weird and amusing distortions you can see when debugging; and from there you can move on to MPEG-1 with variable frame sizes and B frames (another weekend, assuming you reuse much of the 261 exercise --- I ended up with 1k lines total to decode MPEG-1), and that has somewhat more existing media you'll be able to watch.
Then you can try H.262/MPEG-2 and enjoy the intricacies of handling interlacing as well as being able to decode DVDs and a lot of existing content; and then there's H.263 which has intra prediction... I haven't gotten past the first two largely for reasons of time and other things to play with, but IMHO getting a basic implementation of a video decoder is not that hard especially when you're working from a standard.
- sparklingriver 7y agoVery cool idea! Is your code for this online anywhere?
- userbinator 7y agoSorry, no. But a search of GitHub reveals some others have.
- nayuki 7y agoI'm sold on this idea! Are there readily available documents that specify the bitstream and decoding semantics for H.261?
- userbinator 7y agowww.itu.int has H.261 and the rest of the H.* standards, they're a free download. This is H.261: https://www.itu.int/rec/T-REC-H.261/en https://www.itu.int/rec/T-REC-H.261/en Direct link to the spec itself is here: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.261-199303-I!!PDF-E&type=items https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.26...