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 28th April 2012, 21:12   #61  |  Link
Anacletus
Registered User
 
Anacletus's Avatar
 
Join Date: Mar 2005
Posts: 50
Hi chainik_svp,

would you mind explaining how to translate this standard MDegrain2 call in order to take advantage of your plugins?

Code:
AviSource("something.avi")
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
If i understand correctly i should use something like this for MDegrain1?

Code:
AviSource("something.avi")
super = SVSuper("{pel:2, gpu:1}")
vectors = SVAnalyse(super, "{gpu:1,block:{w:8,h:8,overlap:2}}")
forward_mv = SVConvert(vectors, false)
backward_mv = SVConvert(vectors, true)
super_mv = MSuper(pel=1, hpad=0, vpad=0)
MDegrain1(super_mv, backward_mv, forward_mv, thSAD=400)
I'm missing if there the possibility to use more motion vectors as for MDegrain2 or if this is unnecessary with SVP plugins..

Can you please point me to the right direction?

Thanks
Anacletus is offline   Reply With Quote
Old 28th April 2012, 22:07   #62  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Quote:
Originally Posted by Anacletus
Can you please point me to the right direction?
I think -Vit- already gave a clue how to emulate "delta=2".

Again, I'm not trying to completely replace MVTools, so MDegrain and other things are not in my interests now
But it's not a big deal to add "delta" param so if someone thinks it'll be useful I could do that.

Last edited by chainik_svp; 28th April 2012 at 22:16.
chainik_svp is offline   Reply With Quote
Old 28th April 2012, 23:40   #63  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
My delta=2 method works fine, but don't try to simplify the fVec2 line, I believe it would be an error:
Code:
fVec2 = Interleave(vecs2e.SVConvert( isb=false ), vecs2o.SVConvert( isb=false )) # Correct
fVec2 = Interleave(vecs2e, vecs2o).SVConvert( isb=false )  # Error
That's because SVAnalyse generates forward vectors offset by 1 from MVAnalyse so SVConvert shifts the forward vectors back by one. However, with a delta of 2 they need shifted back by 2, so the SVConvert goes inside the Interleave. May not matter for the bVec3 line, but I suggest just to leave it as is in my original post.

---

For delta=3 do this:
Code:
params_string = "{gpu:0}"  # plus any other SVAnalyse settings
vecs30 = super.SelectEvery(3,0).SVAnalyse( params_string )
vecs31 = super.SelectEvery(3,1).SVAnalyse( params_string )
vecs32 = super.SelectEvery(3,2).SVAnalyse( params_string )
fVec3 = Interleave( vecs30.SVConvert(isb=false), vecs31.SVConvert(isb=false), vecs32.SVConvert(isb=false) )
bVec3 = Interleave( vecs30.SVConvert(isb=true ), vecs31.SVConvert(isb=true ), vecs32.SVConvert(isb=true ) )
Never tested that but it's just the same process.

And here's a function to generate MVTools vectors using SVAnalyse and an arbitrary delta. It requires GScript. I've only tested it a little:
Code:
# Use SVAnalyse with a given delta and convert vectors to MVTools format
# Returns a single vector clip containing interleaved forward and backward vectors.
# Example:
#   vec3 = super.SVAnalyseConvert( 3, "{gpu:0, pel:2}" ) # delta=3
#   fVec3 = vec3.SelectEven()
#   bVec3 = vec3.SelectOdd()
#
function SVAnalyseConvert( clip super, int "delta", string "params_string" )
{
    delta         = default(delta, 1)
    params_string = default(params_string, "{gpu:0}")

    GScript("""
    if (delta == 1) {
	vecs = super.SVAnalyse( params_string )
        return Interleave( vecs.SVConvert(isb=false), vecs.SVConvert(isb=true) )
    }
    else {
        cf = ""
        cb = ""
        sD = string(delta)
        for (i=0, delta-1) {
            sI = string(i)
            Eval( "vecs"+sD+sI+"=super.SelectEvery("+sD+","+sI+").SVAnalyse( params_string )" )
            cf = cf + "vecs"+sD+sI+".SVConvert(isb=false)"
            cb = cb + "vecs"+sD+sI+".SVConvert(isb=true)"
            if (i != delta-1) {
                cf = cf + ","
                cb = cb + ","
            }
        }
	return Eval( "Interleave(Interleave("+cf+"),Interleave("+cb+"))" )
    }
    """)
}
___

And yes, I guess a delta parameter would be nice!

Last edited by -Vit-; 28th April 2012 at 23:45.
-Vit- is offline   Reply With Quote
Old 29th April 2012, 15:46   #64  |  Link
Anacletus
Registered User
 
Anacletus's Avatar
 
Join Date: Mar 2005
Posts: 50
Quote:
Originally Posted by chainik_svp View Post
Again, I'm not trying to completely replace MVTools, so MDegrain and other things are not in my interests now
Fair enough, thank you

@-Vit-
Thank you too
Anacletus is offline   Reply With Quote
Old 2nd May 2012, 12:09   #65  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Quote:
Originally Posted by Bernardd View Post
So in my script i have deleted all Refine params_strings with default values. This line " refine: [ { thsad: 200, search: { type: 4, distance: 4, satd: false }, penalty: { pnew: 50 } } ]" has been deleted. I expect no frame picture change, but i have a little change.
A-ha! Why "distance: 4"? Default value is pel value from SVSuper.
chainik_svp is offline   Reply With Quote
Old 2nd May 2012, 12:42   #66  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
-Vit-
I guess a delta parameter would be nice!

Ver. 1.0.4
look at special.delta param in SVAnalyse
Code:
{block:{...}, main:{...}, refine:{...}, special:{delta:2}}
chainik_svp is offline   Reply With Quote
Old 2nd May 2012, 14:53   #67  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Hi Chainik,

I apologize, my Refine line is not with whole default values. But always

output for this
SVAnalyse( super, """{ gpu: 0, vectors: 3, block: { w: 16, h: 16, overlap: 0 },
main: { levels: 0,
search: { type: 4, distance: -10, sort: true, satd: false,
coarse: { type: 4, distance: -10, satd: true, trymany: false, bad: { sad: 1000, range: -24 } } },
penalty: { lambda: 10.0, plevel: 1.5, lsad: 8000, pnew: 50, pglobal: 50, pzero: 100, pnbour: 50, prev: 0 } } ,
refine: [ { thsad: 200, search: { type: 4, distance: 2, satd: false }, penalty: { pnew: 50 } } ] }""")


is not same as output for this
SVAnalyse( super, """{ gpu: 0, vectors: 3, block: { w: 16, h: 16, overlap: 0 },
main: { levels: 0,
search: { type: 4, distance: -10, sort: true, satd: false,
coarse: { type: 4, distance: -10, satd: true, trymany: false, bad: { sad: 1000, range: -24 } } },
penalty: { lambda: 10.0, plevel: 1.5, lsad: 8000, pnew: 50, pglobal: 50, pzero: 100, pnbour: 50, prev: 0 } }
}""")


Bernard

Last edited by Bernardd; 2nd May 2012 at 15:02.
Bernardd is offline   Reply With Quote
Old 2nd May 2012, 14:57   #68  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Bernardd
You don't have any refinement defined in second case. I repeat: default refinement will be with "refine: [ {} ]" string.
chainik_svp is offline   Reply With Quote
Old 2nd May 2012, 16:49   #69  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Thank Chainik,

I apologize, I have not understand fast. Now it is OK.

Second question, when i restore old Super 8 movies to return Framerate from 16.667 fps to 25, i have tried "plevel = 10" with algo 23 for minimize blend.

What it is the max plevel value usable ?

Bernard
Bernardd is offline   Reply With Quote
Old 3rd May 2012, 09:15   #70  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Bernardd
What it is the max plevel value usable ?

I've got no idea
But this extremely high "plevel" value means almost zero lambda penalty on all levels except smallest one which leads to less coherent vectors field.
chainik_svp is offline   Reply With Quote
Old 3rd May 2012, 11:12   #71  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Version 1.0.5
Quote:
= added compatibility with GTX680 (and may be with all other Kepler GPUs) - thanks to flagger
chainik_svp is offline   Reply With Quote
Old 3rd May 2012, 21:00   #72  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Thank Chainik,

I understand now why high plevel is able to minimize blend in some case. With less motion coherence, blend is no more necessary to build the best coherent frame.

Bernard
Bernardd is offline   Reply With Quote
Old 8th May 2012, 17:42   #73  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by chainik_svp View Post
-Vit-
I guess a delta parameter would be nice!

Ver. 1.0.4
look at special.delta param in SVAnalyse
Code:
{block:{...}, main:{...}, refine:{...}, special:{delta:2}}
So can we now simply use three SVAnalyse calls with various delta and then SVConvert to get the MVTools-format vectors out? It seems that SVAnalyse produces a lot more stable vector field than MAnalyse so I'd very much like to incorporate it into my own functions as an alternative

And thanks for all your hard work, there is never too much development these days
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 8th May 2012, 21:14   #74  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Quote:
Originally Posted by Boulder View Post
So can we now simply use three SVAnalyse calls with various delta and then SVConvert to get the MVTools-format vectors out?
That's the plan But someone obviously should try it and report

thanks for all your hard work, there is never too much development these days
thanks!

Last edited by chainik_svp; 8th May 2012 at 22:16.
chainik_svp is offline   Reply With Quote
Old 11th May 2012, 03:30   #75  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
I haven't tried svp yet but i'd be intereted as it us the gpu; basically i want to replace the mvtools part in my script how would i code that ?

my script:
Quote:
SeparateFields()
a=last
mot=removegrain(11,0).removegrain(20,0).DepanEstimate(range=2)
take2=a.depaninterleave(mot,prev=2,next=2,subpixel=2)
clean1=take2.TMedian2().selectevery(5,2)

sup1 = clean1.minblur(1).removegrain(11,0).removegrain(11,0)
\ .mt_lutxy(clean1,"x 1 + y < x 2 + x 1 - y > x 2 - y ? ?",U=2,V=2)
\ .msuper(pel=2,sharp=0)
sup2 = a.msuper(pel=2,levels=1,sharp=2)

bv22=sup1.manalyse(isb=true, truemotion=true,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=3,DCT=2)
bv21=sup1.manalyse(isb=true, truemotion=true,global=true,delta=1,blksize=8,overlap=4,search=5,searchparam=3,DCT=2)
fv21=sup1.manalyse(isb=false,truemotion=true,global=true,delta=1,blksize=8,overlap=4,search=5,searchparam=1,DCT=2)
fv22=sup1.manalyse(isb=false,truemotion=true,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=1,DCT=2)
interleave(a.mcompensate(sup2,fv22),a.mcompensate(sup2,fv21),a,a.mcompensate(sup2,bv21),a.mcompensate(sup2,bv22))

selectevery(5,2)
sup3 = last.msuper(pel=2,sharp=2)
bv33=sup3.manalyse(isb=true, truemotion=true,global=true,delta=3,blksize=8,overlap=4,search=5,searchparam=3,DCT=2)
bv32=sup3.manalyse(isb=true, truemotion=true,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=3,DCT=2)
bv31=sup3.manalyse(isb=true, truemotion=true,global=true,delta=1,blksize=8,overlap=4,search=5,searchparam=3,DCT=2)
fv31=sup3.manalyse(isb=false,truemotion=true,global=true,delta=1,blksize=8,overlap=4,search=5,searchparam=1,DCT=2)
fv32=sup3.manalyse(isb=false,truemotion=true,global=true,delta=2,blksize=8,overlap=4,search=5,searchparam=1,DCT=2)
fv33=sup3.manalyse(isb=false,truemotion=true,global=true,delta=3,blksize=8,overlap=4,search=5,searchparam=1,DCT=2)
last.mdegrain3(sup3,bv31,fv31,bv32,fv32,bv33,fv33,thSAD=499)
Interleave()
weave()
Mounir is offline   Reply With Quote
Old 11th May 2012, 13:50   #76  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Mounir
You script won't use any GPU with SVPflow.
chainik_svp is offline   Reply With Quote
Old 11th May 2012, 14:03   #77  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 317
SVP Is still faster though.
Bloax is offline   Reply With Quote
Old 11th May 2012, 16:58   #78  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Compared with what? With the original Fizick's 2.5.11.3 - yes, with the version from SVP 3.0.6 - not really (except SVPflow has "adaptive search radius" feature of cause).

Mounir
Do you really need "dct=2" and different search options for forward and backward MVs?
If not then central part of the script could be something like this:
Code:
sup1 = clean1.minblur(1).removegrain(11,0).removegrain(11,0)
\ .mt_lutxy(clean1,"x 1 + y < x 2 + x 1 - y > x 2 - y ? ?",U=2,V=2)
\ .SVSuper("pel:2, scale:{up:0}")

search_params="block:{w:8,overlap:3}" #or whatever

v21=sup1.SVAnalyse("{"+search_params+"}")
v22=sup1.SVAnalyse("{"+search_params+",special:{delta:2}}")

bv22=v22.SVConvert(isb=true)
bv21=v21.SVConvert(isb=true)
fv21=v21.SVConvert(isb=false)
fv22=v22.SVConvert(isb=false)

sup2 = a.msuper(pel=2,levels=1,sharp=2)
interleave(a.mcompensate(sup2,fv22),a.mcompensate(sup2,fv21),a,a.mcompensate(sup2,bv21),a.mcompensate(sup2,bv22))

selectevery(5,2)
sup3 = last.msuper(pel=2,sharp=2,hpad=0,vpad=0)

# SVAnalyse accepts MSuper with zero padding!
v31=sup3.SVAnalyse("{"+search_params+"}")
v32=sup3.SVAnalyse("{"+search_params+",special:{delta:2}}")
v33=sup3.SVAnalyse("{"+search_params+",special:{delta:3}}")

bv33=v33.SVConvert(isb=true)
bv32=v32.SVConvert(isb=true)
bv31=v31.SVConvert(isb=true)
fv31=v31.SVConvert(isb=false)
fv32=v32.SVConvert(isb=false)
fv33=v33.SVConvert(isb=false)

last.mdegrain3(sup3,bv31,fv31,bv32,fv32,bv33,fv33,thSAD=499)

Last edited by chainik_svp; 11th May 2012 at 17:28.
chainik_svp is offline   Reply With Quote
Old 11th May 2012, 18:33   #79  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
@ chainik_svp
Your code return an error for \ .SVSuper("pel:2, scale:{up:0}")
error: i don't know what "clean1" means
Mounir is offline   Reply With Quote
Old 11th May 2012, 20:15   #80  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
o_O I thought it's your script.
Or you've just taken it from somewhere and you've got no idea how it works?
In the last case I suggest to ask -Vit- for assistance with all this stuff like "delta" and mdegrain.

Last edited by chainik_svp; 11th May 2012 at 20:18.
chainik_svp is offline   Reply With Quote
Reply

Tags
frame doubling, frame rate conversion, mvtools, opencl

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 00:03.


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