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

Thread Tools Search this Thread Display Modes
Old 27th February 2013, 00:31   #1  |  Link
Registered User
ryrynz's Avatar
Join Date: Mar 2009
Posts: 2,971
Combining filters together

I've been fiddling with real time anime Avisynth sharpening for awhile and have popped Psharpen and Hysteria together into a single script which improved performance a little. Awarpsharp2 is another one in the chain and I've read that using an edge mask can help improve Awarpsharp's final result, so I thought about adding that in too and utilizing Hysteria's edge mask.

So far I haven't had any luck so far getting it to work, I get invalid command errors for Awarpsharp or just no change in the picture at all.. any chance someone can help me out?
ryrynz is online now   Reply With Quote
Old 27th February 2013, 15:25   #2  |  Link
Join Date: Jan 2002
Posts: 21,923
Post your script that isn't working as you expect.
Guest is offline   Reply With Quote
Old 10th March 2013, 08:08   #3  |  Link
Registered User
ryrynz's Avatar
Join Date: Mar 2009
Posts: 2,971
SEt wrote on the first post of awarpsharp2

Originally Posted by SEt View Post
you can do advanced edge mask filtering (like MDegrain) before passing it to warp stage to get more stable result.
Since there's an edge mask in hysteria and I use this filter a bit I'd like to try getting this improved more stable result by using awarp with it, which I assume would be aWarp(edge_mask_clip, int "depth", int "chroma")? I haven't been able to get it to work though and I can't find any examples of awarp being used with a mask to help me out, if you could help me do this is would be appreciated.

Unmodified Hysteria code:
function Hysteria(clip orig, float "strength", bool "usemask", int "lowthresh", int "highthresh", \
int "luma_cap", int "maxchg", int "minchg", bool "showmask") {

Assert(orig.IsYV12(), "Hysteria: YV12 input only")

lowthresh = Default(lowthresh, 6)
highthresh = Default(highthresh, 20)
showmask = Default(showmask, false)
strength = Default(strength, 1.0)
str = String(strength)
usemask = Default(usemask, true)
luma_cap = Default(luma_cap, 191)
lc = String(luma_cap)
maxchg = Default(maxchg, 255)
lim = String(maxchg)
minchg = Default(minchg, 0)
thr = String(minchg)

noisymask = orig.mt_edge(thy1=lowthresh,thy2=lowthresh,mode="cartoon")
cleanmask = orig.mt_edge(thy1=highthresh,thy2=highthresh,mode="cartoon")
themask = mt_hysteresis(cleanmask,noisymask).mt_inflate().Blur(1.0).Blur(1.0).mt_deflate()

diffs = mt_makediff(orig.mt_inflate(u=2,v=2),orig).mt_lut("x 128 - "+str+" *")
darkened = mt_lutxy(orig, diffs, "x x "+lc+" > 0 y "+lim+" > "+lim+" y "+thr+" < 0 y ? ? ? -")

usemask? mt_merge(orig,darkened,themask,u=2,v=2): darkened.MergeChroma(orig)

return showmask? themask.Levels(0,1,255,80,255).MergeChroma(orig): last
ryrynz is online now   Reply With Quote

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 01:26.

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