Live data from Hacker News

Video encoding requires using your eyes

redvice.org

21–30 of 53 posts

Re: Video encoding requires using your eyes

#21

Is downscaling difficult? I can understand that upscaling is hard and you need learning. But when downscaling, for me OpenCV's "area" interpolation always gives great results super fast.

In short: no, it shouldn't be.

The Netflix post is sort of bizarre. They claim to be optimizing for minimum mean-squared error (MSE) given a conventional (bicubic) upscaling process [0], but... that should have an analytic closed-form solution, as this post states? You definitely do not need multiple layers of neural networks to achieve it. Then they present VMAF results, but VMAF is very much not equivalent to MSE, so you have no idea if they even improved the metric they optimized for. Subjective results are similarly unpersuasive: it isn't clear if "the deep downscaler was preferred by 77% of test subjects" means they thought it was closer to the original or simply "better" than Lanczos[1]. Netflix may not care: longer watch times are longer watch times. But as an engineer you might want to know if that is because you actually achieved the thing you were optimizing for, or it is due to an artifact of the process that might go away the next time you change something to actually improve what you were optimizing for. You can famously make people prefer one audio track over another by making it louder, and video has similar things around sharpness and contrast (and now, thanks to ML, hallucinated detail).

I agree that you can do better than Lanczos for large downscale factors [2]: you need to do something area-based, like you suggest (I have not looked at OpenCV's implementation, but it could be fine). The biggest thing to get wrong is handling gamma incorrectly, but the right thing to do depends on whether you intend to display the result at the downscaled size or upscaled back to the original size as seems to be assumed here (and whether or not your upscaler is gamma-aware, which it probably isn't).

As an aside to those struggling to see the visual differences, make sure you are looking at the image in its original (1874x1596) resolution: https://redvice.org/assets/images/netflix-downscaler-compare... (or right-click, View Image on the original page). Otherwise you also have your browser's resampling algorithm in the mix. To my eyes on my display there is also a pretty big color shift in the featureless pink background of the painting on the right wall, but when I look at the actual pixel values, that appears to be an optical illusion. Subjective comparison is hard!

[0] Unlike the post, I think this is reasonable. In the past, we did experiments that showed that optimizing for bilinear when nearest-neighbor is used (for chroma) is worse than optimizing for nearest-neighbor when bilinear is used. I suspect something similar will be true for bicubic and bilinear, but these days it may be safe to assume that you will get at least bicubic upscaling (for luma), because bilinear luma looks really bad. I haven't done a recent survey of actual playack devices, though.

[1] It's also not how you report subjective test results: what was the statistical significance? There are standard protocols for these kinds of tests and it would have been helpful to cite which one was used.

[2] Nobody ever says what downscaling factors are being tested here. The example graph shows 1080p to 342p, or ~3.16x, but Netflix goes as low as 144p (from, e.g, 2160p), so they can get pretty large (15x) in practice. A 6-tap filter is not going to cut it.

Re: Video encoding requires using your eyes

#23
post #16

I love bagging on lazy engineers who just chuck code over the fence without caring about the user experience, but I seriously doubt I would notice this. The sad truth is a lot of video is watched in the background and Netflix knows this. For the specific case of a children's cartoon, I doubt the children watching will notice or care. If there is user feedback about the quality, then by all means listen to users and a…

When will people finally learn that people do not know what they want. You, the expert has to know what works and how and whats the best way to use it properly. And do not rely on user feedback. Again. People don't know whats wrong, they don't even know what's right. They just feel that something is off. And only a very small percentage of users would write an email and even fewer would get through the automated AI b…

I am not the user. What I honestly believe is right may not work out the way I expect despite my best efforts as an expert.

If you can't get any user feedback on your products, that is its own problem.

Re: Video encoding requires using your eyes

#24

Earlier quoted context omitted.

Appreciate this, I was feeling the same way as the original comment. It looks maybe over-sharpened, but I don't see anything as glaring as the text of the article makes it sound! (Of course, I'm not a video codec developer.) It does remind me of how stereo & speaker manufacturers sometimes boost treble a little bit (rather than being perfectly "transparent" to the original signal) because it gives the impression of c…

Yeah, audio response curves have always been a bit confusing to me. Like, they say that headphones should use a Harman curve because that sounds 'best' to listeners, but how valid is it as an objective measure? (E.g., will listeners 50 years from now find a different curve 'better', the same way that instrument tuning has changed over centuries?) And how much of it is responding to current practices in recording and…

The thing that gets me about audio is people obviously have different ears. Some are more sensitive to high frequencies, etc. It's even age-dependent. It's like salt preference on food.

Re: Video encoding requires using your eyes

#25

Earlier quoted context omitted.

You can see some ringing in the sky around the trees and on the line between the crow's beak/feathers if you look closely. (Alvin's?) fur goes much farther down his forehead as well. People who work deeply with codecs are usually hypersensitive to these sorts of issues that mere mortals like us need to try to see. There used to be a legendary blog called "Diaries of an x264 developer" by Fiona Glaser [0] where she'd…

I agree the "negative" artifacts are almost impossible to see, and came here to the comments to see what the heck the author was talking about. > People who work deeply with codecs are usually hypersensitive to these sorts of issues that mere mortals like us need to try to see. I think that kind of shows that the author is unfairly critical. They're saying "this should not have shipped", when it seems just fine to us…

Also video is viewed in motion, not as static frames. And end-users watching on low bitrates aren't going to freeze-frame and zoom in.

Re: Video encoding requires using your eyes

#26
post #21

Is downscaling difficult? I can understand that upscaling is hard and you need learning. But when downscaling, for me OpenCV's "area" interpolation always gives great results super fast.

In short: no, it shouldn't be. The Netflix post is sort of bizarre. They claim to be optimizing for minimum mean-squared error (MSE) given a conventional (bicubic) upscaling process [0], but... that should have an analytic closed-form solution, as this post states? You definitely do not need multiple layers of neural networks to achieve it. Then they present VMAF results, but VMAF is very much not equivalent to MSE,…

I spent a good while looking at the image on my phone trying to spot what the author was talking about, but ironically the comparison image itself is compressed (not using a NN ;) ) and that obscures the artifacts you're supposed to be looking at.

If you're looking for examples of ringing and hallucinated details, they're really obvious in the framed picture on the right on respectively the character's shirt and the frame.

Re: Video encoding requires using your eyes

#27

> Is Lanczos an example, or the current best option What’s the best (computationally not that more expensive than Lanczos) option? Edit: also some CV researchers write like that (the Netflix writing) — bicubic is like a flag in opencv that they just use. Probably those researchers were much more preoccupied with the researchy problem than actual wide deployment, which is what many researchers do

It's not really possible to say what's "best" because the criteria is super subjective.

I personally like the Spline family, and I default to Spline36 for both upscaling and downscaling in ffmpeg. Most people can't tell the difference between Spline36 and Lanczos3. If you want more sharpness, go for Spline64, for less sharpness, try Spline16.

Edit: As far as I'm aware though OpenCV doesn't have Spline as an option for resizing.

Re: Video encoding requires using your eyes

#29
post #21

Is downscaling difficult? I can understand that upscaling is hard and you need learning. But when downscaling, for me OpenCV's "area" interpolation always gives great results super fast.

In short: no, it shouldn't be. The Netflix post is sort of bizarre. They claim to be optimizing for minimum mean-squared error (MSE) given a conventional (bicubic) upscaling process [0], but... that should have an analytic closed-form solution, as this post states? You definitely do not need multiple layers of neural networks to achieve it. Then they present VMAF results, but VMAF is very much not equivalent to MSE,…

Since, you mention gamma, I have to link this: http://www.ericbrasseur.org/gamma.html?i=1

Also, side-by-side comparisons are hard, its best to flip back and forth between the two images, like opening them in an image viewer and pressing arrow keys. Or cross eyes like with magic eye stereograms so you see them "layered".

But yes, more fundamentally, I think you're right that this is not really image content dependent, it doesn't need any image prior, if all you want is to minimize means squared error after upscaling with a fixed bicubic interpolation.

Re: Video encoding requires using your eyes

#30

Earlier quoted context omitted.

You can see some ringing in the sky around the trees and on the line between the crow's beak/feathers if you look closely. (Alvin's?) fur goes much farther down his forehead as well. People who work deeply with codecs are usually hypersensitive to these sorts of issues that mere mortals like us need to try to see. There used to be a legendary blog called "Diaries of an x264 developer" by Fiona Glaser [0] where she'd…

I agree the "negative" artifacts are almost impossible to see, and came here to the comments to see what the heck the author was talking about. > People who work deeply with codecs are usually hypersensitive to these sorts of issues that mere mortals like us need to try to see. I think that kind of shows that the author is unfairly critical. They're saying "this should not have shipped", when it seems just fine to us…

It does strike me that video encoding blog posts that show up here are often these kinda toxic rants that seemingly exaggerate whatever it is they're ranting about and also assume the people working on these things are complete morons for missing whatever minute detail the author is angry about.
Post reply on HN