Menu

H.264 is magic (2016)
📰

H.264 is magic (2016)

Adafruit Industries – Makers, hackers, artists, designers and engineers!·Anne Barela·about 2 hours ago
#vIDrRtNJ
#adafruit#bala#sidbala#frames#frame
Reading 0:00
15s threshold

Sid Bala wrote a walkthrough of how H.264 video compression works, published on sidbala.com. He starts with a demonstration: a screen capture of the Apple homepage, 300 frames long, encodes to 175KB as H.264. A single frame of that same video saved as PNG is 1015KB.

The post covers the main tricks. Raw 1080p at 60Hz runs about 370 MB/sec, so something has to go. H.264 transforms image data into the frequency domain and discards the high frequency components, which are the fine details. Bala shows the laptop close-up at 2% of the original information entropy, where the speaker grill holes disappear but little else does.

Then chroma subsampling, which stores brightness at full resolution and color at a quarter, cutting bandwidth roughly in half. Then motion compensation, where 16×16 macroblocks carry motion vectors and only I-frames hold a complete picture. That is also why scrubbing backward on YouTube pauses before it plays: the decoder has to rebuild from the nearest I-frame.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.