Kodi Community Forum

Full Version: VDPAU Internal scaler quality problems. Request for SW decode fallback for SD content
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just realized that NVIDIA VDPAU internal upscaler does a very ugly job for upscaling SD content to 1920x1080 size. Just open up the two full size pictures in two browser windows and switch back and forth:

VDPAU off, sw decode with lanczos upscaling:
Image

VDPAU on, hw decode with vdpau internal upscaling:
Image

Image Image

1.Detail with Lanczos upscaling and 2. Detail with VDPAU upscaling

I think the difference is night and day. Even NVIDIA admits that sadly for VDPAU they use a worse quality upscaling algorithm than on windows.

http://www.nvnews.net/vbulletin/showthread.php?t=128329

I found this issue very dissapointing for my SD h264 encoded files and now even with the newly VDPAU re-enabled mp2 DVD SD files.

I think it would be a nice feature if one can choose a different renderer for SD and HD content no matter what type of file played. In this case the high quality upscalers can be used for SD content. For HD content there is VDPAU scaler which in that resolution does a decent job.

At least it would be goot to have such setting in advancedsettings.xml.

Great work with implementing VDPAU anyway and i know the scaler issue is not xbmc's problem.
I got some information form site NVNews about the upscaler,
Stephen Warren from Nvidia blames everything on the xbmc implementation:

Quote:"Also note that it's entirely possible that XBMC is scaling the image a second time; XBMC copies the VDPAU surface into OpenGL to use as a texture. I have no idea if XBMC creates the VDPAU surfaces to match the video or display resolution, and if any scaling is performed by the GL operations or not. A better test would be MPlayer.

BTW, I didn't say that " VDPAU uses a worse algorithm for vdpau than for windows dxva.", I said that on *some* high-end GPUs, there's a better scaling option. I don't know which GPUs, nor which algorithms the default/better algorithm are, nor whether the higher end GPUs automatically use the algorithm, or if the application has to explicitly request it."

I think he is not right about it.

Motd2k can you confirm that xbmc is not making any upscaling in case of vdpau used ?
Hmm... maybe it is... I'll have a think about it
motd2k Wrote:Hmm... maybe it is... I'll have a think about it

Thank Motd for checking it ! Smile

By the time i will try to make an mplayer with vdpau test with the same material.
Hi Motd2k !

I ran some new test to see what is the cause for different scaler qualities.
I found out that scaling quality is the SAME no matter if is use VDPAU or not !
I even tried mplayer with vdpau and also with xv renderer with the same results.

So it is not the fault of VDPAU at all. The only thing that makes the a huge difference is the HQ Software upscaler Lanczos algorythm.

So it would really be good to use the HQ upscaler for the SD contents.

I thought of two solutions to have this functionallity.

1. (easier solution) In case VDPAU is set as renderer AND HW Upscaler is on for SD content, xbmc could simply fall-back to GLSL renderer in case of SD movies, For HD movies VDPAU remains. To make it more clear to users the text for HQ upscaler could be changed to something like this: "High quality software upscaling (disables VDPAU if in use)"

2. For a better solution which would be a really awsome thing (if it is possible with the vdpau implementation) is to have the decoded movie frames first UNSCALED from vdpau surface and make the scaling the same way as xbmc does with SW decode and GLSL renderer. This way we could use HQ Software upscaling along with VDPAU decoding, Best things combined together,

What do you think ?
I'm kind of curious about VDPAU now, when you are running a 1080p movie at 720p I'm curious if the scaler is making the image look worse at all or if it handles HD content differently all together? I don't notice anything really but I only have a 26" display at the moment.
alanwww1 Wrote:Hi Motd2k !

I ran some new test to see what is the cause for different scaler qualities.
I found out that scaling quality is the SAME no matter if is use VDPAU or not !
I even tried mplayer with vdpau and also with xv renderer with the same results.

So it is not the fault of VDPAU at all. The only thing that makes the a huge difference is the HQ Software upscaler Lanczos algorythm.

So it would really be good to use the HQ upscaler for the SD contents.

I thought of two solutions to have this functionallity.

1. (easier solution) In case VDPAU is set as renderer AND HW Upscaler is on for SD content, xbmc could simply fall-back to GLSL renderer in case of SD movies, For HD movies VDPAU remains. To make it more clear to users the text for HQ upscaler could be changed to something like this: "High quality software upscaling (disables VDPAU if in use)"

2. For a better solution which would be a really awsome thing (if it is possible with the vdpau implementation) is to have the decoded movie frames first UNSCALED from vdpau surface and make the scaling the same way as xbmc does with SW decode and GLSL renderer. This way we could use HQ Software upscaling along with VDPAU decoding, Best things combined together,

What do you think ?

I'm confused. Are you saying that both the XBMC and mplayer images look the same when using VDPAU?
motd2k Wrote:I'm confused. Are you saying that both the XBMC and mplayer images look the same when using VDPAU?

Yes, that is the situation. Only if i use hq sw uscaling, i get the significantly better quality.

Edit: I got some new tip for mplayer with better opengl scaling from nvidia forums:

Code:
MPlayer with opengl output is capable of pretty good scaling with hardware acceleration. E.g. try: -vo gl:yuv=3:lscale=5:cscale=5 or the same with 1 for lscale/cscale.

I have to try it tonight if i go home.
I made some test with the

-vo gl:yuv=3:lscale=5:cscale=5:filter-strength:1

mplayer settings.

It resulted a very nice picture quality. Almost as good as hq sw Lanczos algorythm. The cpu load remained very low, which shows that it was hw accelerated, Maybe it is an opengl 2.1 scaling method ? I found this on mplayer man page about this scaler.

5: Use experimental unsharp masking with 5x5 support and a default strength of 0.5 (see filter-strength).

Picture quality with lscale:0

Image

Picture quality with lscale:5

Image

@motd2k
Do you think this could be implemented in xbmc along with the existing bilinear, bicubic upscaling ?

What do you think of the ideas in my previous posts ?