View Full Version : Prefilter roundtrip?
anton_foy
11th March 2022, 13:29
Filters like KNLMeansCL and TTempSmooth for example has rclip and pfclip but for filters like HQdn3D it has none. Is it possible (or even usable) to prefilter a filter that has no built-in reference clip/prefilter option?
Ceppo
11th March 2022, 22:13
If you provide a sample grainy clip, I might try an idea with hqdn3d but I can't promise it will work.
anton_foy
12th March 2022, 13:23
If you provide a sample grainy clip, I might try an idea with hqdn3d but I can't promise it will work.
Thanks so much! Will upload when I get back this evening.
anton_foy
13th March 2022, 13:41
Here are two clips (450mb)
https://we.tl/t-10vhCWnWT5
Ceppo
13th March 2022, 15:30
My idea didn't work. But I didn't want to come empty-handed. So I will give you alternatives you can use as a starting point.
Limit hqdn3d to filter only grain detected by the prefilter:
src = last
den = FFT3DFilter(sigma=0,sigma2=1,sigma3=2,sigma4=4,bt=1,plane=4)
diff = mt_makediff(src,den,u=3,v=3)
mt_makediff(diff.hqdn3d(10,10,10,10),diff,u=3,v=3)
mt_adddiff(src,last,u=3,v=3)
Use hqdn3d as a dynamic blur filter:
src = last
den = FFT3DFilter(sigma=0,sigma2=1,sigma3=2,sigma4=4,bt=1,plane=4)
mt_makediff(den.hqdn3d(10,10,10,10),den,u=3,v=3)
mt_adddiff(src,last,u=3,v=3)
anton_foy
13th March 2022, 16:06
My idea didn't work. But I didn't want to come empty-handed. So I will give you alternatives you can use as a starting point.
Limit hqdn3d to filter only grain detected by the prefilter:
src = last
den = FFT3DFilter(sigma=0,sigma2=1,sigma3=2,sigma4=4,bt=1,plane=4)
diff = mt_makediff(src,den,u=3,v=3)
mt_makediff(diff.hqdn3d(10,10,10,10),diff,u=3,v=3)
mt_adddiff(src,last,u=3,v=3)
Use hqdn3d as a dynamic blur filter:
src = last
den = FFT3DFilter(sigma=0,sigma2=1,sigma3=2,sigma4=4,bt=1,plane=4)
mt_makediff(den.hqdn3d(10,10,10,10),den,u=3,v=3)
mt_adddiff(src,last,u=3,v=3)
The first was really good! Thanks! The second gets horribly smeared in the luma and seems not to affect chroma at all.
Ceppo
13th March 2022, 16:35
I set hqdn3d at max strength, you should tune the parameters to avoid the smeared thing. Also, you should tune the prefilter, maybe the prefilter was not strong enough on chroma.
I didn't look much in the filters setting for laziness :)
anton_foy
13th March 2022, 18:02
I set hqdn3d at max strength, you should tune the parameters to avoid the smeared thing. Also, you should tune the prefilter, maybe the prefilter was not strong enough on chroma.
I didn't look much in the filters setting for laziness :)
Nice! But I was thinking reset parametet should be lt +1? I did not experiment with it though.
Ceppo
13th March 2022, 18:11
I can't help you :( I never used hqdn3d in my life, I just used strong random settings so that I could notice the difference :)
anton_foy
13th March 2022, 18:42
I can't help you :( I never used hqdn3d in my life, I just used strong random settings so that I could notice the difference :)
No I mean it really looks good :) I will try out the other one and adjust it a bit too.
Fjord
17th March 2022, 16:11
I tried hqdn3d v1.1.1, with default settings - zooming in on the image (in AvsPmod) to look at the denoising it provided. The first thing I noticed was that the whole image shifts slightly right and down. Do others see this? The shift increases with increasing value of ls or cs parameter. Try ls=20.0 to make it obvious.
My video is a 1984x1404 10-bit MagicYUV intermediate of an 8mm film scan and restoration project. I also reduced to 8-bit, and see the same.
I didn't find a "home" thread for hqdn3d. Is there a better place to raise this issue? (there is no issues tab on Asg-d's github repository).
kedautinh12
17th March 2022, 17:20
I seen had issues tab on Asd-g's github repository
https://github.com/Asd-g/AviSynth-hqdn3d/issues
anton_foy
17th March 2022, 23:26
I tried hqdn3d v1.1.1, with default settings - zooming in on the image (in AvsPmod) to look at the denoising it provided. The first thing I noticed was that the whole image shifts slightly right and down. Do others see this? The shift increases with increasing value of ls or cs parameter. Try ls=20.0 to make it obvious.
My video is a 1984x1404 10-bit MagicYUV intermediate of an 8mm film scan and restoration project. I also reduced to 8-bit, and see the same.
I didn't find a "home" thread for hqdn3d. Is there a better place to raise this issue? (there is no issues tab on Asg-d's github repository).
Yes that is how hqdn3d "roll's", it always been like that (at least since I first tried it).
Fjord
18th March 2022, 00:25
Thanks for confirmation @anton_foy. This makes hqdn3d() unsuitable for my purposes, which include masking and differencing with the original.
anton_foy
18th March 2022, 08:52
Thanks for confirmation @anton_foy. This makes hqdn3d() unsuitable for my purposes, which include masking and differencing with the original.
You still could just replace hqdn3d in the script above with any other spatal-temporal or just temporal denoiser I guess (fluxsmooth, vsdegrainmedian, temporalsoften).
StainlessS
18th March 2022, 12:29
was that the whole image shifts slightly right and down. Do others see this? The shift increases with increasing value of ls or cs parameter. Try ls=20.0 to make it obvious.
You still could just replace hqdn3d in the script above with any other spatal-temporal or just temporal denoiser I guess
Looks like hqdn3d shift problem is only using Spatial args, seems temporal only denoise not affected.
(I have not tested)
anton_foy
18th March 2022, 19:24
Looks like hqdn3d shift problem is only using Spatial args, seems temporal only denoise not affected.
(I have not tested)
Interesting. Last time I used hqdn3d only temporal I got a bug and it wouldn't affect the image at all so now I muat try that again its a fast filter and the spatial part can be replaced by another filter.
Ceppo
19th March 2022, 13:38
So I wasn't seeing things :rolleyes: anyway, what's so cool about hqdn3d? I didn't look at the code but I have always thought that it was some kind of deen filter.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.