What filter do I need? Is this artifact halo?

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Fri Mar 25, 2011 9:01 am

For the dehalo_alpha, it's all of them, though you might want to adjust them a bit. I wrote the explanation in my earlier post:
mirkosp wrote:Please note that there are more instances of dehalo_alpha at a low strength and with different radii values because they are targeted at different halos and because different strength parameters give different results, so it is often better to call it more times at a lower strength than it is to just increase the strength.
This is in my experience, at least.
About the mergechroma... basically, a rule of thumb in avisynth is that if there's a clip parameter, it's going to be assumed as being "last" (if not specified) in most cases, this being one of such. Last in avisynth is often implied. For instance, when you write a script like

Code: Select all

avisource("my file.avi")
spline36resize(640,480)
What avisynth is reading is prolly along the lines of:

Code: Select all

last = avisource("my file.avi")
last = last.spline36resize(640,480)
return last
Or something like that.
So in the case of mergechroma that I used, what avisynth is seeing is pretty much:

Code: Select all

mergechroma(last.awarpsharp2(depth=48),last)
Thus why it works just fine.
Personally if I don't find enough info on the avisynth wiki (could happen with some external filters), I first check the filter's documentation itself and, if absent or not comprehensive, try to toy around with the filter as a last resort. I didn't really use any parameters that weren't listed on the wiki though, in this case.
At most, what I can suggest you is to follow niiyan's blog's RSS. It's a pretty good way to keep up to date with new filters and related stuff without having to check a lot of places on your own. :dino:
Image

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by Scintilla » Fri Mar 25, 2011 8:07 pm

mirkosp wrote:last.spline36resize(last,640,480)
Pedantic note: using "last" both as the left side of the dot operator and as the first argument to the function is redundant, and I'd be a little surprised if it even ran without an error.

But everything else Mirkosp said is on target.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by Mister Hatt » Sat Mar 26, 2011 6:22 am

That isn't redundant at all really. 99% of the time when you do that you are giving it an actual var name and if you left it out, you would be applying on a different clip. Mirko's usage of last there was to show what avs does internally, not how you'd actually write your code, but if you WERE writing something like that, you do need to have your clip objects called correctly.

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by Scintilla » Sat Mar 26, 2011 9:54 am

I didn't have any issue with the "last =" part of it; I understood why he was writing it out explicitly. My point was that, after that part, using "last" on the left side of the dot operator is just shorthand for using it as the first argument to whatever function comes on the right side. It would have been more correct to say just last = spline36resize(last,640,480).

In fact, I just confirmed that last.Undot(last) throws "Invalid arguments to function UnDot". It seems that if you use a clip plus dot operator before a function, AVISynth will no longer be expecting a clip as the first argument to the function and balk if you try to give it one (unless, of course, it also can accept a clip as its second argument).
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Sat Mar 26, 2011 1:37 pm

that's something I wasn't quite sure of, yeah. Fixed in the post, thanks for pointing it out, Scintilla. :)
Image

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by Mister Hatt » Sat Mar 26, 2011 11:36 pm

That sounds odd to me, I was talking about the method selector (clip.method()) so yeah. It should be fine with last.whatever() and in most contexts this is the correct thing to do when using a named variable on both sides of the assignment operator :S

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Sun Mar 27, 2011 8:19 am

Mister Hatt wrote:That sounds odd to me, I was talking about the method selector (clip.method()) so yeah. It should be fine with last.whatever() and in most contexts this is the correct thing to do when using a named variable on both sides of the assignment operator :S
No, it's that I did last.spline36resize(last,640,480) in the example, but apparently avisynth doesn't like it being called as the clip paramenter too. Seems like you just have to do one or the other.
Image

mikansei
Joined: Mon Mar 21, 2011 2:50 pm
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mikansei » Sun Mar 27, 2011 4:16 pm

>Mister Hatt
Mister Hatt wrote:Either that dehalo setting is off or there is some luma floating going on.
(...) Could also be some luma ghosting from the previous frame or field, a bit hard to tell with only the one shot.
I have uploaded a sample of the video for you to see: http://www.megaupload.com/?d=A2YO6L98
I can't really tell if there luma ghosting or not since I'm not even quite sure what luma ghosting is... although I think I know what you mean.


>Mirkosp

Thank you for the explanation but what does "last" mean in avisynth language and how does it influence a clip parameter?
Thank you also for the link, I will check it out!

I've been tweaking the depth parameter in mergechroma. You said that depth=48 may be possibly overdone, so I tried different depths and I at least I set it really high (depth=100), I didn't appreciate any difference in the resulting image. I tried depth=16 (default) and depth=40 or 48 among others and all of them give the same result. I'm satisfied with it btw. The chroma quality has improved a lot, I think.

About dehalo_alpha... I've observed the image's halos almost disappear completely but the image looses relief. I read Scintilla's miniguide on dehalo_alpha (http://www.aquilinestudios.org/avsfilte ... tml#dehalo) and it mentions it. I guess I have to choose between having more relief and halo or no halo and less relief, right? :)

mikansei
Joined: Mon Mar 21, 2011 2:50 pm
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mikansei » Sun Mar 27, 2011 4:21 pm

Btw, this is the script as of now:

MPEG2Source("D:\sample.d2v")

TFM(slow=2, pp=5, clip2=TDeint(mode=2, type=3))
TDecimate()
DeRainbow()
dehalo_alpha(darkstr=0,brightstr=0.6,rx=2,ry=2)
dehalo_alpha(darkstr=0,brightstr=0.2,rx=2,ry=2)
dehalo_alpha(darkstr=0,brightstr=0.8,rx=2,ry=2)
dehalo_alpha(darkstr=0,brightstr=0.8,rx=1.2,ry=0.45)
dehalo_alpha(darkstr=0,brightstr=0.4,rx=1.2,ry=0.45)
dehalo_alpha(darkstr=0,brightstr=0.6,rx=1.2,ry=0.45)
mergechroma(awarpsharp2(depth=40))
Tweak(sat=1.2)
Crop(8, 2, -8, -0)
Spline36Resize(640,480)

The DVD is NTSC region 2.
In still have to add the antialising. In former test I've done, when converted to mp4 and played on full screen I see aliasing on the video.

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: What filter do I need? Is this artifact halo?

Post by mirkosp » Sun Mar 27, 2011 8:00 pm

Uhm... it's kinda harder to explain than it is to understand, but you could sat that last in avisynth means the clip as it is returned by the line immediately before the line where you call last. Let's try with an example... say we want to do some simple antialiasing:

Code: Select all

spline36resize(last.width*2,last.height*2).nnedi3(nns=2).turnleft.nnedi3(nns=2).turnright.spline36resize(last.width,last.height)
running interpolators like that on a supersampled clip is a pretty common way to antialias, and you'll see that to do the supersampling I could just use the info from last. Since last is always the line before the one I am on, I know that doubling its width and height will supersample by 2 and if I call again with last's width and height I'll get back to the original resolution.
I made this example because it shows well that last refers always to the line before the one you're on and not just to whatever comes immediately before it. To get back to the original resolution, you'd have to halve width and height if last referred to what's on the left of the dot operator too, but it doesn't as I think I was able to explain.
Anyway, you can use last in a number of ways depending on what you have to do... I guess you'll be able to figure this on your own the more you'll write scripts based on needs.
Image

Locked

Return to “AviSynth Help”