Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vf_d3d11vpp: always insert filter for non-standard scaling modes #15071

Closed
wants to merge 1 commit into from

Conversation

kasper93
Copy link
Contributor

Apparently, some processing is still desired by users even at a 1.0 scaling factor.

Fixes: #14698 (comment)

Apparently, some processing is still desired by users even at a 1.0
scaling factor.

Fixes: mpv-player#14698 (comment)
Copy link

Download the artifacts for this pull request:

Windows
macOS

@Damole-wer
Copy link

Damole-wer commented Oct 13, 2024

Thank you for the commit.
After some testing, it seems that Nvidia VSR only gets enabled when output resolution is higher than input resolution. In other words, when there is a "Output Resolution" field in mpv stats. So scaling factor that doesn't change the output resolution by at least 1 pixel won't enable the feature in mpv.
However, in chromium-based browsers it gets enabled even when input = output resolution. So my guess is that the VSR feature has a specific trigger for a case when no upscaling is needed, and simply matching resolutions is not enough. Maybe i can find something, but i don't guarantee it.
To be honest, i wanted to know if it already works and i just don't know how to configure. VSR is only useful for de-artifacting and some detail restoration, so i just wanted to optimise it for that usage. No pressure for that to be implemented. It's already better quality in mpv.
I really appreciate that you took time for this, if you have an idea of what can be done here, please let me know. But as i said, it's not critical.

@kasper93
Copy link
Contributor Author

However, in chromium-based browsers it gets enabled even when input = output resolution. So my guess is that the VSR feature has a specific trigger for a case when no upscaling is needed,

Are you sure they are not doing super resolution by always scaling up and downscaling? There is no trigger, we set the same filter mode and version.

Closing this PR as it doesn't work as expected.

@kasper93 kasper93 closed this Oct 13, 2024
@hooke007
Copy link
Contributor

hooke007 commented Oct 14, 2024

However, in chromium-based browsers it gets enabled even when input = output resolution. So my guess is that the VSR feature has a specific trigger for a case when no upscaling is needed, and simply matching resolutions is not enough. Maybe i can find something, but i don't guarantee it.

Not sure how nvdia actually handling the native res's VSR.
Have you checked that if manually appending a dscale 0.5 filter after VSR?

d3d11vpp=scale=2:scaling-mode=nvidia,d3d11vpp=scale=0.5

@Damole-wer
Copy link

Let me explain my point of view. After reading this blog post about the first version of VSR, i was assuming that upscaling by any factor is done using bi-cubic filtering. After that, other processing takes place. Therefore i thought we can skip the upscaling part, as it seems separate and done just to enlarge the image.

Let's compare VSR in chrome and mpv. I'll be using this video at 720p SDR in h264 codec. To see what i'm talking about, there are two archives for comparing mpv and chrome VSR and for scaling factors, with all video screenshots done by ShareX. No shaders were enabled. I'm comparing two screenshots by setting video-zoom to at least 2 in mpv and switch them back and forth, It's just much more convenient to do it locally than in a browser.

When upscaling from 720 to 1080 here, for some reason mpv is different, and has more details despite scaling factor being the same. Here output is 720p, --vf=d3d11vpp=scale=2:scaling-mode=nvidia,d3d11vpp=scale=0.5 downscale seems almost identical to --dscale=lanczos --linear-downscaling=no, while chrome, if it was downscaled, is similar to dscale=catmull_rom. Despite chrome being less sharp, it has a bit more details in some areas (water, for example). I understand that those are very slight deviations, but I'm curious of what could be the cause of that.
Also, just so people know, whole VSR quality cap is at scale=2, and it just blurs the 2x image from there.

So to summarize, while I agree that VSR at scale factor of 2 can be higher quality (because it is able to fit in extra details in higher resolution), most of the upgrade comes from de-artifacting, quality of which seems to be different between chrome and mpv.

Thank you for your time. Hopefully, I explained everything I needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants