AN3223 / dotfiles

MIT License
35 stars 9 forks source link

mpv shaders : nlmeans will heavily smear textures #11

Closed dyphire closed 1 year ago

dyphire commented 1 year ago

When using the shader of nlmeans to test its noise reduction effect in some videos, I noticed that it produces severe texture smearing behavior, which did not occur in its filter version. test file: sample.zip

nlmeans.glsl image

vf_nlmeans image

AN3223 commented 1 year ago

I agree, this is too much blur for this scene. I just pushed a commit (bda61d72b3dc898ba13d07038ebff289c4c74051) that adds a light-noise tuned profile here, let me know what you think. I'll also look into building an slightly lighter profile.

nlmeans_light.glsl output:

mpv-shot0001

dyphire commented 1 year ago

I agree, this is too much blur for this scene. I just pushed a commit (bda61d7) that adds a light-noise tuned profile here, let me know what you think. I'll also look into building an slightly lighter profile.

nlmeans_light.glsl output:

The effect of nlmeans_light.glsl has improved in my test, although significant texture loss can still be seen

AN3223 commented 1 year ago

I pushed a commit that fixes a bug which was creating extra blur. Here is the new state of nlmeans_light.glsl:

mpv-shot0001

Focusing only on the blinds in the background, it now appears that the difference between -vf=nlmeans and nlmeans_light.glsl is quite small.

There is low frequency noise on the left head and the pink suit that is handled well by -vf=nlmeans but not handled well by any of my nlmeans shaders. So I built an nlmeans profile to replicate the effect of -vf=nlmeans (it can be found here) and the result is virtually identical to -vf=nlmeans (I measured an SSIM of 0.997064 where 1.0 would mean identical):

mpv-shot0001

So everything appears to be working correctly now. I'll eventually make light variants for LQ/HQ/sharpen/sharpen+denoise/etc., and the new ffmpeg_eqv profile will always be there too.

AN3223 commented 1 year ago

I thought about it some more and I decided to move nlmeans_ffmpeg_eqv.glsl to the dev/experimental subdirectory. I updated the link in my previous comment to point to the new location.