Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd March 2006, 13:42   #1  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Request: need MaskTools v2.x adaptation of HQDering

I have a source with quite strong haloing which DeHalo_Alpha can't completely remove. I want to try using HQDering with low settings (so as to not produce aliasing) as a postprocessor, but it requires MaskTools v1.4.9. Could someone please adapt it to MaskTools v2.x but keeping its functionality intact?
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.

Last edited by Chainmax; 4th March 2006 at 03:59.
Chainmax is offline   Reply With Quote
Old 3rd March 2006, 20:19   #2  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Is this an effective source? Or is there a better one? It's a bit of a crazy function, slower than it has to be, but it won't be hard to convert.
foxyshadis is offline   Reply With Quote
Old 3rd March 2006, 21:30   #3  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I once was about to ask for an optimization of HQDering, but DeHalo_Alpha came out at about that point so I didn't go through wth the request. Besides, I figure you script experts already have too much on your plates to add the optimization of an obsolete function on it. That's why I'm only requesting this conversion.
The official thread on here is this one. I'm not sure if mf posted an updated version at his forum or not but since it's been down forever it doesn't matter.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 3rd March 2006, 22:07   #4  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Do you mind if I change the semantics slightly? It's pretty messy about smoother parameters, when it makes a lot more sense to just pass in a smoothed clip. Like

hqdering(200,smoother=RemoveGrain(mode=4))

(Default is same as before, of course.)

Code:
######
##
## HQDering v0.1 by mf
##
## Applies derining by using a smart smoother near edges (where ringing occurs) only.
##
## Usage: Import("HQDering-v0.1.avs")
##        HQDering()
##
####

function HQDering(clip input, int "strength", int "overall", clip "smoother") {

 strength = Default(strength, 255)	# strength, 0-255
 overall  = Default(overall, 0)		# overall smoothing, 0-255
 smoothed = defined(smoother) ? smoother : input.Deen("a3d",4,15,15,20)	# filter that smooths

 normalmask=input.mt_edge(thY1=3, thY2=255, mode="sobel", chroma="none")

 amplifiedmask=normalmask.Levels(0, 3.3, 90, 0, 255).Blur(1.0)

 thickmask=normalmask.mt_inflate().mt_inflate().mt_inflate().Levels(0, 3.3, 90, 0, 255)
  \ .Blur(1.0).mt_inflate().mt_inflate().mt_inflate().Levels(0, 3.3, 255, 0, 255)
  \ .mt_inflate().mt_inflate()

 ringingmask=mt_lutxy(amplifiedmask.mt_invert(), thickmask, expr="x y * 255 /").Levels(60, 3.0, 140, overall, strength)

 mt_merge(input, smoothed, ringingmask)

}

Last edited by foxyshadis; 4th March 2006 at 00:55.
foxyshadis is offline   Reply With Quote
Old 3rd March 2006, 22:32   #5  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Thanks a lot, I really appreciate it .

About the semantics change: it's great, much more logical. The appropriate call for HQDering(strength=255, smoother="Unfilter", params="-50, -50") would now be HQDering(255,smoother=Unfilter(-50,-50)), right?


[edit]I guess not, because with that call it gives me a "there is no function called Deen" error. The smoother=... parameter is probably being ignored.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.

Last edited by Chainmax; 3rd March 2006 at 22:42.
Chainmax is offline   Reply With Quote
Old 3rd March 2006, 23:55   #6  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Interesting, I didn't notice since I have Deen, but it'll still try to evaluate it even if you don't use it. One of those leaky abstractions I forgot about. Replace smoothed =... with:

Code:
smoothed = defined(smoother) ? smoother : input.Deen("a3d",4,15,15,20)
I've edited the above to reflect this.
foxyshadis is offline   Reply With Quote
Old 4th March 2006, 00:42   #7  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Now I get a "there is no function named mt_mask" error.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 4th March 2006, 00:55   #8  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Gah! Why do I always do that. mt_edge becomes mt_mask when I type it out. Sorry about that.
foxyshadis is offline   Reply With Quote
Old 4th March 2006, 01:53   #9  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Now it works, thanks .
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.

Last edited by Chainmax; 4th March 2006 at 03:59.
Chainmax is offline   Reply With Quote
Old 4th March 2006, 03:04   #10  |  Link
DryFire
Perpetually Lost
 
Join Date: Sep 2005
Posts: 93
Another thanks from me.

Should we expect to see a speed increase?
DryFire is offline   Reply With Quote
Old 4th March 2006, 03:32   #11  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
I'll see whether I can whip something up quickly; I have to figure out what he was aiming for and find a faster way to get there. If nothing else, a partial speedup should be easy.
foxyshadis is offline   Reply With Quote
Old 4th March 2006, 04:01   #12  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
And here we go again ...

Available:

TTempSmooth( [radius] , [threshold_high] , [threshold_low] , [Analyze-Clip] )

Wanted:

The spatial equivalent.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 4th March 2006, 04:01   #13  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
HQDering() was an almost perfect dehaloer: it removed it quite well and sharpened the picture to boot. Too bad it created aliasing and the parameters I'm using aren't nearly as nice .
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 5th March 2017, 02:38   #14  |  Link
Max73
Registered User
 
Join Date: May 2010
Location: The Netherlands
Posts: 4
Thanks FoxyShadis!
After more than 10 years this HQDering does its job pretty well!

HQDering applied after moderate unsharp mask did it for me, after few days of fiddling around with a lot of alternatives. This sequence managed to bring up details in a small resolution video (the source video was 496x384 with average to poor quality, and already some ringing artifacts, plus xvid light encoding artifacts).

LimitedSharpenFaster(Smode=1,strength=12,radius=1,Lmode=1,wide=true,ss_x=1.5,ss_y=1.5)
LimitedSharpenFaster(Smode=1,strength=28,radius=2,Lmode=1,wide=true,ss_x=1.5,ss_y=1.5) #careful with haloing ! but Smode = 1 is the only true good equalization
LSFmod(Smode=1,ss_x=1.4,ss_y=1.4,strength=34, edgemode=1)
HQDering(strength = 192) #decent ringing removal (haloiong)
ColorYUV(off_y=4, gain_y=0, cont_y=0, cont_u=0,cont_v=0)
Levels(0, 1.08, 255, 0, 255, coring=false, dither=true)
ColorYUV(off_y=-2, gain_y=0, cont_y=28, cont_u=24,cont_v=24)
QTGMC(InputType=1, Preset="slow", EZDenoise=2.0)
Max73 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.