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
Prev Previous Post   Next Post Next
Old 19th January 2012, 21:48   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Conditional Filtering Problem

Here an example from Avisynth docs,

Advanced Conditional Filtering Part II

Code:
global sep="."
global combedthreshold=25

Function IsMoving() {
        global b = (diff < 1.0) ? false : true
}

Function CombingInfo(clip c) {
        file = "interlace.log"
        global clip = c
        c = WriteFile(c, file, "a", "sep", "b")
        c = FrameEvaluate(c, "global a = IsCombed(clip, combedthreshold)")
        c = FrameEvaluate(c, "IsMoving")
        c = FrameEvaluate(c, "global diff = 0.50*YDifferenceFromPrevious(clip) + 0.25*UDifferenceFromPrevious(clip) + 0.25*VDifferenceFromPrevious(clip)")
        return c
}

v=Avisource("F.AVI")

CombingInfo(v)
The above works OK.
And here, the example following which is supposed to just get rid of the globals (EDIT: diff, a, and b).

Code:
global sep="."
global combedthreshold=25

Function IsMoving(float diff) {
        return (diff >= 1.0)
}

Function CombingInfo(clip c) {
        file = "interlace.log"

        c = WriteFile(c, file, "a", "sep", "b")
        c = FrameEvaluate(c,"
                diff = 0.50*YDifferenceFromPrevious() + 0.25*UDifferenceFromPrevious() + 0.25*VDifferenceFromPrevious()
                b = IsMoving(diff)
                a = IsCombed(combedthreshold)
        ")
        return c
}

v=Avisource("F.AVI")

CombingInfo(v)
This second example produces this:

Code:
I don't know what "a" means.I don't know what "b" means
false.false
false.false
false.false
false.false
false.false
false.false
false.false
false.false
false.false
false.false
false.false
false.true
Which is identical to the first output but with the addtional "I dont know" line.
Question is, is there a way to eradicate the "I dont know" line (EDIT: & why is it there?).

What I'm trying to do is experimental, something like this:-

Code:
Function ChooseClip(float df) {
 return df>0.5?7:df>0.25?6:df>0.125?5:df>0.0625?4:df>0.03125?3:df>0.015625?2:df>0.0078125?1:0 
}

Function MakeClopCmd(clip c,string File) {
        c = WriteFile(c, File, "Ix", """ "," """, "current_frame", append=false)
        c = FrameEvaluate(c,"
                df=YDifferenceFromPrevious()
                Ix=ChooseClip(df)
        ")
        return c
}

v=Avisource("F.AVI")

MakeClopCmd(v,"Clop.txt")
Idea of which is to choose a clip based on a conditional, in this case eg, variable Deblock_DeBlock()'s based on YDifferenceFromPrevious, via ClipClop() Filter.

Thanx in advance.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 19th January 2012 at 23:21.
StainlessS is offline   Reply With Quote
 

Tags
conditional

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 17:54.


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