Live data from Hacker News

H.264 is Magic

sidbala.com

151–160 of 230 posts

Re: H.264 is Magic

#151
What is the latest in video compression technology after H264 and H265?

The article discusses lossy compression in broad terms, but have we reaped all the low hanging fruit? Can we expect some sort of saturation just like we have with Moore's law where it gets harder and harder to optimize videos?

Re: H.264 is Magic

#152

The lossy transform is important, but I think what's actually most important in video compression is getting rid of redundancy --- H.264 actually has a lossless mode in which that transform is not used, and it still compresses rather well (especially for noiseless scenes like a screencast.) You can see the difference if you compare with something like MJPEG which is essentially every frame independently encoded as a…

> MJPEG which is essentially every frame independently encoded as a JPEG.

"essentially" makes it sound like it isn't precisely true. MJPEG is literally just a stream of JPEG images. The framing of the stream varies a bit, but many implementations are just literal JPEG images bundled one after the other into a MIME "multipart/x-mixed-replace" message.

Re: H.264 is Magic

#153

Earlier quoted context omitted.

RLE a given. It's true that the average person rarely understand that this is what computers call compression, but everything after that involves a bit of thinking. Optimal huffman.

The DEFLATE[1] algorithm is actually fairly accessible, and will give a good idea of how compression works. 1: https://en.wikipedia.org/wiki/DEFLATE

I liked this explanation of DEFLATE here on HN a few months ago:

https://news.ycombinator.com/item?id=12334270

Re: H.264 is Magic

#154

Earlier quoted context omitted.

But actually, no. Because you could set up HTTHTTTHHHHHHHHHH the format like this: 01001000 11001010 That's sixteen bits for 17 coinflips. With no continuous sequences longer than seven, this format takes up one extra bit every seven flips. How does it work? The first bit is a sign bit. If it's zero, the next seven bits are raw coinflips, 0 for tails, 1 for heads. If it's one, the second bit signifies whether the nex…

I know that, the point is that this kind of stuff needs some thought, it's not so simple as "HTHTHTHT" = "HT five times". The article kind of glosses over that.

In the context of the analogy, it's probably better to read it as saving time to human-parse rather than the space required to send. (And it definitely takes less time to verbally state, even if the sentence is clearly longer; caching) The general idea is the same through; compression by describing patterns rather than explicitly stating the event

Re: H.264 is Magic

#155

Earlier quoted context omitted.

But actually, no. Because you could set up HTTHTTTHHHHHHHHHH the format like this: 01001000 11001010 That's sixteen bits for 17 coinflips. With no continuous sequences longer than seven, this format takes up one extra bit every seven flips. How does it work? The first bit is a sign bit. If it's zero, the next seven bits are raw coinflips, 0 for tails, 1 for heads. If it's one, the second bit signifies whether the nex…

I know that, the point is that this kind of stuff needs some thought, it's not so simple as "HTHTHTHT" = "HT five times". The article kind of glosses over that.

In the context of the analogy, it's probably better to read it as saving time to human-parse rather than the space required to send. (And it definitely takes less time to verbally state, even if the sentence is clearly longer; caching) The general idea is the same through; compression by describing patterns rather than explicitly stating the event

Re: H.264 is Magic

#157

Earlier quoted context omitted.

IMO Huffman is conceptually more complicated (not the implementation, but the logic) than arithmetic coding. And Huffman isn't optimal unless you are lucky, unlike arithmetic coding.

Huffman seems simpler to me, but I've implemented both at various times so that might colour my perspective.

AC implementation is actually quite tricky, but conceptually IMO it's much simpler and more elegant than Huffman.

Re: H.264 is Magic

#158

Absolutely love this: 'Suppose you have some strange coin - you've tossed it 10 times, and every time it lands on heads. How would you describe this information to someone? You wouldn't say HHHHHHHHH. You would just say "10 tosses, all heads" - bam! You've just compressed some data! Easy. I saved you hours of mindfuck lectures.' This is a really great, simple way to explain what is otherwise a fairly complex concept…

That's how compression was first explained to me, and it really stuck with me ever since. It was in the context of an image though, and instead of heads, it was red pixels.

What's really cool is that the simple explanation can be extended to explain things like why ciphertext doesn't compress well: because ciphertext has no patterns

Re: H.264 is Magic

#159

I love how you can edit photos from people to correct some skin imperfections without loosing the touch that the image is real (and not that blurred, plastic look) when you decompose it in wavelets and just edit some frequencies. Don't know in photoshop, but in Gimp there's a plugin called "wavelet decomposer" that does that.

Well, that's the most awesome thing I've seen in a long time! Thanks for sharing.

Re: H.264 is Magic

#160
post #56

Earlier quoted context omitted.

I try to use VLC when I can because it offers intuitive playlist support, but for high-resolution H.264 and friends I usually have to switch to Media Player Classic. VLC is willing to let my entire screen look like a blob of grey alien shit for 10 seconds instead of just taking a moment to reconstruct frames. And its hardware acceleration for newer codecs is balls. Sucks because otherwise, it's right up there with f2…

I stopped using VLC when I found mpv [0]. I really like it because it exposes everything from the CLI, so once you're familiarized with the flags you're interested in using, it's easy to play anything. For everyday usage it "just works" too, as expected of any video player. [0] https://mpv.io/

How does it compare to mplayer? My biggest complaint about mplayer is it still doesn't play VFR videos well.
Post reply on HN