just had a flash of inspiration. it's obvious, really.
the main problem with making a motion compensated deinterlacer with MVtools is you need a good bob to start with, and if you work just with separated fields, the compensation screws up the half-pixel offset that odd and even fields have.
so...
i wondered what would happen if i motion-compensated field-separated video, but got my vectors from a bob?
the result is pretty good! to make things smoother, i've use forward and backward compensation and mixed them together.
it runs surprisingly fast.
however...
there's no protection from bad matches at this very early stage (this can be added pretty easily, but i can't be arsed doing it now - i want this script's concept tested first).
also, chroma doesn't get compensated at the moment (i've just used MVcompensate as is). this could be added as well, or you could do it manually by using my script on 3 clips, Y, U, and V.
here's the script:
Code:
function MVbob(clip c)
{
order=(c.getparity==true)? 1:0
bobd=c.kernelbob(order=order).verticalreduceby2()
fields=c.separatefields()
mvf=bobd.mvanalyse(sx=4,sy=4,pel=1,isb=false)
mvb=bobd.mvanalyse(sx=4,sy=4,pel=1,isb=true)
even1=c.separatefields().selecteven()
odd1a=fields.mvcompensate(mvf).selecteven()
odd1b=fields.mvcompensate(mvb).selecteven()
odd1=mergeluma(odd1a,odd1b,0.5).mergechroma(odd1b,0.5)
even2=c.separatefields().selectodd()
odd2a=fields.mvcompensate(mvf).selectodd()
odd2b=fields.mvcompensate(mvb).selectodd()
odd2=mergeluma(odd2a,odd2b,0.5).mergechroma(odd1b,0.5)
even=interleave(even1,odd1).weave()
odd=interleave(even2,odd2).weave()
interleave(even,odd)
}
hopefully this can give some other people ideas on how to prevent errors leaking through, because as it is now, this script should not be used if you want a good result
[edit]
hehe... this thing eats camera pans for breakfast! all it needs is a few kinks ironed out and it'll be rocking.