View Full Version : New filter: HQDering
mf
26th December 2003, 23:20
And here I'm at it again. High quality deringing.
http://mf.creations.nl/avs/hqdering-scrshot.png (http://mf.creations.nl/avs/functions/HQDering-v0.1.avs)
Hope you like it. Greets from Bonta Claus - FUMO!!
morsa
27th December 2003, 01:00
Great stuff.
At least this really must become a coded filter, or better an internal filter of Avisynth.
Soulhunter
27th December 2003, 01:06
The picture on the top is with your new script... Right? :D
Nice results, but does it drop the speed more to the regular mfps-factor?
Ok, enough joking... ;)
The sample image looks really impressive!
As I said before, I'm not that advanced with complex script stuff...
Please, could you give me an example usage to change the smoother!?
Bye
mf
27th December 2003, 12:51
The usage is the same as with UnSmooth (if you remember ;)). If you want to use another smoother, you need to specify smoother= and params=.
HQDering(smoother="Convolution3D", params="preset="+Chr(34)+"animeLQ"+Chr(34))
for instance.
And it's 7fps, i find that not so bad, now is it? :D
Soulhunter
27th December 2003, 18:58
The usage is the same as with UnSmooth (if you remember ;)).
Ohw, yes... The UnSmooth script !!! :D
And it's 7fps, i find that not so bad, now is it? :D
Wow... Then it should get implemented into mftoon !!! ;)
THX n' Bye
ZoNtO
16th January 2004, 00:08
Hey there, I need to use this dering filter on my TMNT anime DVD encode I'm working on because it's older and has a lot of "line noise". Would this script below be a valid one to use with the filter? If not, what would be a valid one? I've never modified, or even made an AviSynth script before so I have no idea really. Would mf toon be a good idea as well? Thanks guys!
script edited for length
ZoNtO
16th January 2004, 06:37
anybody?
mf
16th January 2004, 11:12
Well, HQDering is really only for slight ringing. It preserves so much detail that anything that's bad enough to be seen with the naked eye and without amplification won't be touched. The reason I made it was that I was annoyed at deringers in the fact that they harmed small details (well duh :rolleyes:). So I managed to make one that didn't do that. But it's really only for HQ (hence the name) sources. Also, if you had read closely enough (hint: at the top of the script is a section that says "Usage:"), the script is to be downloaded, saved into a directory, and then called with Import("HQDering-v0.1.avs"). You shouldn't just insert it at the end of your script (though that would have worked if you actually bothered to type HQDering() under it).
Note to other people reading this thread: I forgot to mention this here, but HQDering could be an excellent alternative to things like Dust or UnDot. It's a lot less destructive than said filters (possibly less effective as a result though), and should also create "invisible" extra compressibility, as some people like to call it.
Cyberman
16th January 2004, 12:18
So it´s only for High Quality sources, allright. What would happen if I applied it to low quality? Would it harm it, or at worst merely do nothing?
Manao
16th January 2004, 12:29
With deen("a2d") or deen("a3d"), you don't need to substract the thin mask from the thick mask. Deen won't take into account pixels whose value is over the threshold. So by doing as you do, you only risk not to filter close enough of the real edge.
In fact, I think a script like that one would give better results :thinmask = msmooth(treshold = 10, highq = true, debug = true)
enlargedmask = thinmask.blur().blur().blur().blur().binarize(upper = false, threshold = 1,y=3,u=1,v=1).blur().blur().blur()
filteredclip = clip.deen("a2d")
result = clip.maskedmerge(filteredclip,enlargedmask,y=3,u=2,v=2)Msmooth is better (imho) at detecting properly edges. It should be faster. The blur().blur().blur().blur().binarize() could be trasnformed in inflate().inflate().inflate().inflate(), but I would bet it would be slower ( can't make tests right now, though )
Edit : @cyberman : it will still improve slightly the quality ( visually speaking ). When the quality is bad, applying a smoothing filter helps a lot, and the script will apply it on some part of the picture. But you won't see much difference.
mf
16th January 2004, 12:40
Originally posted by Manao
With deen("a2d") or deen("a3d"), you don't need to substract the thin mask from the thick mask. Deen won't take into account pixels whose value is over the threshold. So by doing as you do, you only risk not to filter close enough of the real edge.
Theoretically, yes. But it's just safer. And on HQ sources, the ringing never occurs ON the edge (only around it), so why risk artifacts? Note that I don't care about speed ;). Also, Binarize will cause hard edges, and the advantage of my filters (something I would never trade away for speed), is that they use soft masks, so that you never get threshold artifacts.
Manao
16th January 2004, 13:04
Yes, but your way, you're not sure to discard totally the edge, if he is really thick, and if on the contrary it is thin, you won't filter the pixels close to it.
And I don't do a binary mask, the last three blurs are not binarized.
Finally, for having tested my script on a disney's movie, it doesn't create artifacts, and it is effective.
ZoNtO
16th January 2004, 15:30
What about this script then? And thanks for the help too guys!
#
# Created with Gordian Knot
#
# http://gknot.doom9.org
#
# PLUGINS
LoadPlugin("C:\PROGRA~1\GordianKnot\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GordianKnot\undot.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\decomb.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\KernelDeInt.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\dgbob.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\Convolution3d.dll")
LoadPlugin("C:\PROGRA~1\GordianKnot\FluxSmooth.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\TomsMoComp.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\VSFilter.dll")
#LoadPlugin("C:\PROGRA~1\GordianKnot\SimpleResize.dll")
#
# SOURCE
mpeg2source("C:\TURTLES_SCN\VIDEO_TS\tmnt ff.d2v")
#
#Import("C:\Documents and Settings\ZoNtO_the_KING\Desktop\mfToon-v0.52.avs")
#
#Import("C:\Documents and Settings\ZoNtO_the_KING\Desktop\HQDering-v0.1.avs")
#
# TRIM
#trim(startframe,endframe)
#
# IVTC
#Telecide(order=1,guide=1).Decimate()
# or use
#IVTC(44,11,95)
#GreedyHMA(1,0,4,0,0,0,0,0)
#
# CROPPING
crop(8,4,704,466)
#
# DEINTERLACING (1)
#FieldDeinterlace()
#FieldDeinterlace(blend=false)
#TomsMoComp(1,5,1)
#
# DEINTERLACING (2)
#KernelDeInt(order=1,sharp=true)
# or maybe
#DGBob(order=1,mode=0)
# DEINTERLACING (3) - special requests
#GreedyHMA(1,0,0,0,0,0,0,0)
#Telecide()
#SeparateFields()
#
#
# SUBTITLES
#VobSub("FileName")
#
# RESIZING
LanczosResize(640,464)
#
Undot()
#
# DENOISING: choose one combination (or none)
# 1) little noise
#Temporalsoften(2,3,3,mode=2,scenechange=6)
#mergechroma(blur(1.3))
#FluxSmooth(5,7)
#
# 2) medium noise
#Temporalsoften(3,5,5,mode=2,scenechange=10)
#Convolution3d("moviehq")
FluxSmooth(7,7)
#
# 3) heavy noise
#Temporalsoften(4,8,8,mode=2,scenechange=10)
#Convolution3d("movielq")
#FluxSmooth(10,15)
#
# BORDERS
#AddBorders(left,top,right,bottom)
#
# COMPRESSIBILITY CHECK
# !!!!Snip Size now has to be 14 for use in GKnot!
#SelectRangeEvery(280,14)
#
# FOOL CCEnc
#empty = BlankClip()
#AudioDub(last,empty)
#
#mfToon()
#
#HqDering()
mf
16th January 2004, 16:15
That would probably work.
Wilbert
16th January 2004, 16:24
:)
Lines with # are comments. If you want to use mf's scripts, you have to remove the "#":
# PLUGINS
LoadPlugin("C:\PROGRA~1\GordianKnot\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GordianKnot\undot.dll")
# Importing scripts
Import("C:\Documents and Settings\ZoNtO_the_KING\Desktop\mfToon-v0.52.avs")
Import("C:\Documents and Settings\ZoNtO_the_KING\Desktop\HQDering-v0.1.avs")
# SOURCE
mpeg2source("C:\TURTLES_SCN\VIDEO_TS\tmnt ff.d2v")
# CROPPING
crop(8,4,704,466)
# RESIZING
LanczosResize(640,464)
# Usage Undot
Undot()
# Usage scripts
mfToon()
HqDering()
mf
16th January 2004, 16:41
Originally posted by Wilbert
:)
Lines with # are comments. If you want to use mf's scripts, you have to remove the "#":
Oh, I actually didn't even notice that.
ZoNtO
16th January 2004, 16:43
Tried that, got this:
Avisynth open failure:
Script error: there is no function named "Unsharpmask"
(C:\Documents and Settings\ZoNtO_the_KING\Desktop\mfToon...line 79
(C:\Turtles_SCN\Video_ts\tmnt anime.avs, line 90)
Oh, and I did get those 3 dlls for mftoon as well, and put them in the load plugin part of the script.
Bogalvator
16th January 2004, 18:43
You probably need the updated version of MaskTools:
http://forum.doom9.org/showthread.php?s=&threadid=67232
ZoNtO
16th January 2004, 19:02
nope, tried that DL and it still gave me that error
Manao
16th January 2004, 19:12
You need either WarpSharp or aWarpSharp : look on the avisynth's filter page to download them.
mf
11th February 2004, 22:18
Maybe useful to some people: edge unfiltering.
HQDering(smoother="Unfilter", params="-50, -50")
Fixed some nasty oversharpening on hair highlights (the anime "head and shoulders" effect ;)) for me, while maintaining a lot more sharpness than a brute-force unfilter.
ObiKenobi
4th November 2004, 17:54
I know this thread has been dead for a while but I just thought I'd make a comment. This is a really great at deringing, but would it be possible to add a parameter like in BlindDeHalo which you can set the width of the ringing you want to eliminate? Or would this just destroy the great amount of detail that this retains as compared to other deringers? Here is a shot to show what I mean (especially look at the hat); it would be nice so then edges like that could be almost fully deringed.
Original:
http://img111.exs.cx/img111/9498/Original1.th.png (http://img111.exs.cx/my.php?loc=img111&image=Original1.png)
HQDering:
http://img124.exs.cx/img124/7821/Filtered.th.png (http://img124.exs.cx/my.php?loc=img124&image=Filtered.png)
-IRnoob-
25th January 2005, 19:21
I try to use this script but when I load it into VirtualDubMod it automatically closes itself. I don't get an error or anything, it just closes. Here's a sample of my script.
code:
LoadPlugin("C:\dgmpgdec110\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Decomb521.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\deen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnFilter\UnFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VSFilter.dll")
LoadPlugin("C:\Plugins\MaskTools-v1.5.6\MaskTools.dll")
Import("C:\Plugins\LimitedSharpen.avs")
Import("C:\Plugins\HQDering-v0.1.avs")
Mpeg2Source("myd2v.d2v")
Telecide(hints=false,order=1,post=2,blend=true)
Decimate(cycle=5,quality=3)
Crop(6,6,-4,-6)
Deen("a2d",2,10,12)
UnFilter(-10,-10)
TextSub("C:\SUBTITLES\MYSUB.ssa")
Subtitle("Something",text_color=$F2F200,x=275,y=40,first_frame=0,last_frame=221,size=20)
Subtitle("Something",text_color=$C0C0C0,x=230,y=60,first_frame=0,last_frame=221,size=15)
Lanczos4Resize(640,352)
LimitedSharpen(ss_x=2.0,ss_y=2.0,Smode=3,Lmode=1,overshoot=0)
HQDering()
Wilbert
25th January 2005, 21:23
I try to use this script but when I load it into VirtualDubMod it automatically closes itself.
Empty plugin folder ...
-IRnoob-
25th January 2005, 21:38
I don't think so, I have a separate plugin folder besides the AviSynth directrory. Whenver I try to use HQDering it causes that error. When I take it out of my script and serve it into VirtualDubMod again it works fine.
Didée
26th January 2005, 09:16
HQdering uses "YV12Layer()", which was present in older MaskTools versions, but isn't anymore in v1.5.6. You either have to use an older MaskTools version, or adapt HQdering by replacing YV12layer through Overlay() or yv12LUTxy().
The latter way is recommended ;)
-IRnoob-
26th January 2005, 13:19
I may sound like an idiot but how do I do that?:)
Didée
26th January 2005, 13:47
Try to replace the YV12layer-line withOverlay(amplifiedmask.Invert(), thickmask, mode="multiply").greyscaleIt's probably not the exact same operation, but I cannot figure that out right now.
After all, HQdering could undergo a buch of optimizations ... given that the available tools have matured a lot since then. But HQdering is mf's baby, not mine - and if I would alter it, then it wouldn't be "HQdering by mf" anymore ...
Soulhunter
26th January 2005, 14:17
Originally posted by Didée
...and if I would alter it, then it wouldn't be "HQdering by mf" anymore.
Then name it "HQdering by mf - hacked by Didée" or so... :eek: ;) :D
Bye
Didée
26th January 2005, 14:32
As you might now, this somewhat childish style is not mine.
Moreover, I've little need to "hack" mf's scripts - I do have my own solutions.
Soulhunter
26th January 2005, 16:00
Originally posted by Didée
As you might now, this somewhat childish style is not mine.
Moreover, I've little need to "hack" mf's scripts - I do have my own solutions.
I smell -> IIPDering... :D
Btw, whats with LimitedSharpenEX ???
Bye
Didée
26th January 2005, 16:27
Aaargh! Don't say the *EX-word!
- Last steps are often the most difficult ones. That alone is reason enough ...
- Then I *must* process lots of stuff, since my HDs are are really bursting now - I could already spot some cracks in them :D (I've stuff worth half a year of encoding time, waiting to get done)
- And on top of that, the German Doom9 collegues urged me to write a "DeLogo Guide" :rolleyes: - seems without additional guidance, they can't do anything other than blurry-box-smearing ... (Not all of them, but many ...)
- Plus I must prepare new photographs from me, for my family ... they only see me from behind, sitting at the darn machine. Last time I turned around, my wife scared "who are you" :(
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.