Linux VAAPI: Nuc, Chromebox, HSW, IVB, Baytrail with Ubuntu 14.04
Guys!

Not sure if this is the right thread but I've been harassing Smile lmyllari with some pm questions on color space etc. Since he knows a lot I thought I'd share he's answer if anybody else finds it useful. Thanks Lauri!

Question:

Hey Lauri!

Sorry if I keep asking the same questions Smile

I've been following the vaapi thread and saw this yesterday from you:

"It's better to use xrandr to set full range, then match Kodi and TV settings (either full or limited - shouldn't make much of a difference with dithering enabled)."

Is there no difference between full and limited as long as you match kodi and tv (with xrandr set to full)? I was under the impression that we had less conversions if we set kodi and tv to limited?

Also, how do I enable dithering, and do I need it?

Thank you!


Answer:

Hi Johan!

The VAAPI work is landing a little earlier than I expected, and it's really good stuff. Smile The idea is that we get frames from the hardware decoder without any processing (just like from the ffmpeg software decoder) - and they are already in GPU memory and can be used as textures for OpenGL. This makes for perfect quality and very good performance.

The decoded frames are in limited range (16-235) YCbCr. They are converted to RGB in the GLSL renderer, scaled if needed and then converted to full range (0-255) RGB if needed. The result is still in higher than 8 bit precision, so no information is lost yet.

If dithering is not enabled, the result is just cut into 8 bits. This is where the banding is introduced if the signal was converted from limited to full range (the levels don't map 1-to-1). If it is kept in limited range, it should fit into 8 bits with maybe a tiny loss of precision in the scaling results.

If dithering is enabled, a small amount of noise (less than 1 bit) is added to the picture before cutting it to 8 bits. This causes some pixels to round down and some up. The end result is more than 8 bit precision with a small amount of noise.

You'll find the dithering settings in System->Video (set settings level to Expert). It should be enabled by default in the builds that have it.

If you have your GPU set to full range with xrandr and are using limited range in Kodi and your TV, dithering is not needed (but it shouldn't hurt either). If you want full range signal, then dithering eliminates the banding from that conversion.

Even with limited range output you might want dithering to keep more information from scaling. It becomes more important when you use a 3dlut. I'm hoping to introduce that soon - I have it already working in my branch but there's no user controls yet.

So the short answer is that it is enabled by default if your build has it, but your setup doesn't (yet) need it. It shouldn't hurt picture quality - and if you find a case where it does, please report it so we can fix it.

Happy watching Smile
Lauri


ps. if you found this helpful, feel free to post the question and answer publically


Messages In This Thread
EDID / HDMI Handshake workaround - by Ney - 2014-10-29, 13:58
Thank you! - by Sta11ion - 2015-01-02, 01:51
RE: VAAPI: Nuc, Chromebox, HSW, IVB, Baytrail with Ubuntu 14.04 - by Hufvudet - 2015-06-29, 08:23
Logout Mark Read Team Forum Stats Members Help
VAAPI: Nuc, Chromebox, HSW, IVB, Baytrail with Ubuntu 14.0416