Found awesome deringer, thought I'd share

This forum is for questions and discussion of all the aspects of handling your footage. If you have questions about capturing/ripping footage, AviSynth, or compression/encoding/converting, look here.

Found awesome deringer, thought I'd share

Postby mirkosp » Tue Jan 05, 2010 11:32 pm

Maybe someone someday will need to dering their animu and won't want to get a blurry output to do so... I know I didn't want to get my sauce blurred much so I looked for a deringer and found this:

Code: Select all
######
##
## 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)

}


Since the avtech doesn't really help anymore for deringing, besides suggesting to use mpeg2source's cpu parameter (which wasn't doing the job, in this case), and the only deringer suggested in the past was blinddehalo3 which blurred too much to get working results. >_<

I'll note here that this deringer, while giving a nice and non-blurry output, can introduce aliasing, especially noticeable at high strength (default is max, btw, you might want to see how low you can go), even more odd looking if you try to chain it twice. Perhaps the odd look might not be there in anime, but since I had to use this on LA footage, it was pretty noticeable. >_< Still better than blurry output, tho.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: Found awesome deringer, thought I'd share

Postby Zarxrax » Wed Jan 06, 2010 11:07 am

Can you actually tell any difference with it?
When mf released that filter years ago, I couldn't tell much difference at all in the comparison images that he posted.
http://forum.doom9.org/showthread.php?t=67532

Also, that function could stand to be updated, as it only even uses a hard-edged mask.
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Re: Found awesome deringer, thought I'd share

Postby mirkosp » Wed Jan 06, 2010 3:06 pm

This is an improved version of it, not the old version anymore. It doesn't even use YV12Layer anymore.
I was able to actually tell a difference... let me get you screenshots. In any case it worked far better than cpu=6 or blinddehalo3.

EDIT:
Ringing:
Image
Deringed:
Image
I used the default settings of hqdering for this example, in actuality I just used strength=100 since nothing more was needed when in the chain with all the other filters (I turned them all down for this example, even bringing cpu back to 0). The ringing is especially noticeable on the ouendan guy on the right.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: Found awesome deringer, thought I'd share

Postby Zarxrax » Thu Jan 07, 2010 11:50 am

Hmm, I can still barely see any difference :p
But I still think the filter could be improved a lot more. I might try taking a look at it sometime.
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Re: Found awesome deringer, thought I'd share

Postby Sora no Honou 空の炎 » Thu Jan 07, 2010 2:47 pm

Looks good. Took me a second to see the difference, but it is there, and with no blurring. Good job seeing this :awesome:
Image
User avatar
Sora no Honou 空の炎
 
Joined: 05 Apr 2009
Location: St. Louis, MO
Status: The Sky Flame

Re: Found awesome deringer, thought I'd share

Postby Sora no Honou 空の炎 » Fri Jan 08, 2010 12:32 am

How can I make it so that I can use this plugin? Is there like a file download or something? I have never had to add an avisynth plugin before. Sorry...
Image
User avatar
Sora no Honou 空の炎
 
Joined: 05 Apr 2009
Location: St. Louis, MO
Status: The Sky Flame

Re: Found awesome deringer, thought I'd share

Postby Scintilla » Fri Jan 08, 2010 7:13 am

Copy the script to a new text file in your text editor of choice, save it in your AVISynth plugins directory with the extension .AVSI, and make sure you have MaskTools 2 (MT MaskTools) and Deen (unless you want to provide a separate clip for the "smoother" argument).

I say this only because the version of the script that's on MF's website is apparently out of date. Otherwise you could just save that file as an .AVSI.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:
User avatar
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

Re: Found awesome deringer, thought I'd share

Postby Pwolf » Sat Jan 09, 2010 1:20 am

what the hell? i can't see anything different between the two pictures other then the "deringed" one is lighter.
ImageImage
ImageImage
Like the AMV .Org App? Think about donating to help me make it better.
User avatar
Pwolf
Friendly Neighborhood Pwaffle
 
Joined: 03 May 2001
Location: Some where in California, I forgot :\

Re: Found awesome deringer, thought I'd share

Postby Emotive » Sat Jan 09, 2010 5:23 am

Pwolf wrote:what the hell? i can't see anything different between the two pictures other then the "deringed" one is lighter.

There is no difference, it's just qualityfag elitists' illusions as usual.
Image
User avatar
Emotive
...the Meditant
 
Joined: 04 Nov 2006

Re: Found awesome deringer, thought I'd share

Postby mirkosp » Sat Jan 09, 2010 8:38 am

Pwolf wrote:what the hell? i can't see anything different between the two pictures other then the "deringed" one is lighter.

I'd try to open each image in its own tab... but either way yeah, the reference screenshot i used doesn't have too much of a noticeable ringing. I'll see about getting a more obvious reference screenshot.

EDIT:
Image

Should be somewhat obvious now. Picked some text with ringing around it.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃


Return to Footage Help

Who is online

Users browsing this forum: No registered users and 1 guest