Live data from Hacker News

H.264 is Magic

sidbala.com

61–70 of 230 posts

Re: H.264 is Magic

#61
post #59

Can someone explain how the frequency domain stuff works? I've never really understood that, and the article just waves it away with saying it's like converting from binary to hex.

It's the Fourier transform basically. There were even some past links on HN that explained it nicely so you might check those first

(Though for images it's in 2D, not 1D which is more commonly done)

Re: H.264 is Magic

#62
post #9

I thought I'll learn something special about H.264, but all information here is high level and generic. For example if you replace H.264 with a much older technology like mpeg-1 (from 1993) every sentence stays correct, except this: "It is the result of 30+ years of work" :)

"This post will give insight into some of the details at a high level - I hope to not bore you too much with the intricacies."

Did you miss the third paragraph?

As someone who knew nothing about it before, I found it lived up to it's goal.

Re: H.264 is Magic

#63
post #59

Can someone explain how the frequency domain stuff works? I've never really understood that, and the article just waves it away with saying it's like converting from binary to hex.

The search keyword to learn about it is Fourier Transform: https://en.wikipedia.org/wiki/Fourier_transform

Along with the Wikipedia article and the obvious Internet search, there's a lot of good stuff that has been on HN: https://hn.algolia.com/?query=fourier%20transform&sort=byPop...

Re: H.264 is Magic

#65
Nice article! The motion compensation bit could be improved, though:

> The only thing moving really is the ball. What if you could just have one static image of everything on the background, and then one moving image of just the ball. Wouldn't that save a lot of space? You see where I am going with this? Get it? See where I am going? Motion estimation?

Reusing the background isn't motion compensation -- you get that by encoding the differences between frames so unchanging parts are encoded very efficiently.

Motion compensation is when you have the camera follow the ball and the background moves. Rather than encoding the difference between frames itself, you figure out that most of the frame moved and you encode the different from one frame to a shifted version of the blocks from a previous frame.

Motion compensation won't work particularly well for a tennis ball because it's spinning rapidly (so the ball looks distinctly different in consecutive frames) but more importantly because the ball occupies a tiny fraction of the total space so it doesn't help that much.

Motion compensation should work much better for things like moving cars and moving people.

Re: H.264 is Magic

#66
post #9

I thought I'll learn something special about H.264, but all information here is high level and generic. For example if you replace H.264 with a much older technology like mpeg-1 (from 1993) every sentence stays correct, except this: "It is the result of 30+ years of work" :)

"This post will give insight into some of the details at a high level - I hope to not bore you too much with the intricacies." Did you miss the third paragraph? As someone who knew nothing about it before, I found it lived up to it's goal.

I think they just mean it shouldn't be "H.264 is magic", it should just be "video compression is magic" or some such. That irked me a little bit too.

Re: H.264 is Magic

#67
post #59

Can someone explain how the frequency domain stuff works? I've never really understood that, and the article just waves it away with saying it's like converting from binary to hex.

It's a bad analogy. Binary and hex are just different formats for representing the same number. Spatial domain and frequency domain are different views of a complex data set. In the spatial domain, you are looking at the intensity of different points of the image. In the frequency domain, you are looking at the frequencies of intensity changes in patterns in the image.

A good way to develop an intuition for the fourier space is to look at simple images and their DFT transforms: http://web.cs.wpi.edu/~emmanuel/courses/cs545/S14/slides/lec... (3/4 of the way through the slide deck).

This analysis of a "bell pepper" image and its transform is also helpful: https://books.google.com/books?id=6TOUgytafmQC&pg=PA116&lpg=....

As for why you want to do this: throwing away bits in the spatial domain eliminates distinctions between similar intensities, making things look blocky. In the frequency domain, however, you can throw away high-frequency information, which tends to soften patterns like the speaker grills in the MBP image that the human eye isn't that sensitive to to begin with.

Re: H.264 is Magic

#68
post #21

What are directions for the future? Could neural networks become practically useful for video compression? [1] [1] http://cs.stanford.edu/people/eroberts/courses/soco/projects...

Suppose I have a table of 8-digit numbers that I need to add and subtract for various reasons. Do I A: have a child, train them how to read numbers, add, and subtract, and then have the child do it or B: use a calculator purpose built to add and subtract numbers?

Neural nets are always expensive to train. You'd better be getting something from them that you can't get some other way.

Re: H.264 is Magic

#69

Well done. The only thing that could make this better is an interactive model/app for me to play around with. The frequency spectrum can probably be used while retouching images as well. A video on youtube led me to Joofa Mac Photoshop FFT/Inverse FFT plugins [1] which was worth a try. I was unable to register it, as have others. Then I came across ImageJ [2], which is a really great tool (with FFT/IFFT). Edit: if an…

I published a set of utilities that I developed for playing and to help myself learn about frequency analysis here, you might find them interesting:

https://github.com/0x09/dspfun

Re: H.264 is Magic

#70
post #23
post #18

Earlier quoted context omitted.

Doesn't look like it; https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC > H.264 is protected by patents owned by various parties. A license covering most (but not all) patents essential to H.264 is administered by patent pool MPEG LA.[2] Commercial use of patented H.264 technologies requires the payment of royalties to MPEG LA and other patent owners. MPEG LA has allowed the free use of H.264 technologies for streaming…

It is an open standard. Anyone can purchase and implement it, and it was developed by ISO. The technologies are not royalty free in the US. Don't conflate the two. * Edit: I emphasize this mainly because the terms have a specific meaning in standards jargon but also because it places the blame for software patent abuses on the wrong parties (the standards developers rather than the lawyers and legislators).

OK, so it is open, but not free ? Is it available for academic purposes free of cost ?
Post reply on HN