View Full Version : MVTools without idx
Jawed
20th January 2009, 14:01
For a bit of extra performance/reduction in memory usage when doing pre-filtering on a calm_super clip, specifying levels=1 works for the source_super clip:
source_super = source.MSuper(pel=2, hpad=16, vpad=16, levels=1) # create the source superclip
Jawed
yup
6th February 2009, 07:38
Hi folks!
I use simple script from doc
LoadPlugin("MT.dll")
SetMemoryMax(1024)
SetMTMode(5)
AVISource("sel.avi") # или MPEG2Source, DirectShowSource, некоторый предыдущий фильтр
SetMTMode(2)
super = MSuper(pel=2)
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)
[img=http://img301.imageshack.us/img301/2894/mtmvtoolserrorkd9.th.png] (http://img301.imageshack.us/my.php?image=mtmvtoolserrorkd9.png)
MT 0.7 (I replace avisynth.dll at windows\system32 directory)
MVTools 2.31
Avisynth 2.58
Windows XP SP3
Core 2 Duo 3.16
Source huffyuf encoded.
Please advice.
yup.
yup
6th February 2009, 14:25
Hi!
Folowing script:
LoadPlugin("MT.dll")
avisource("sel.avi")
MT("""
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)
""",2)
work without problem.
yup.
Fizick
7th February 2009, 13:42
yup,
To be precise, it is NOT exact script from the doc.
yup
7th February 2009, 17:02
Fizick!
From doc
SetMTMode(5)
FFmpegSource("some.avi") # avisource не работает с SetMTMode на моих машинах - TSchniede
SetMTMode(2)
super = MSuper(pel=2)
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)
my script
LoadPlugin("MT.dll")
SetMemoryMax(1024)
SetMTMode(5)
AVISource("sel.avi") # или MPEG2Source, DirectShowSource, некоторый предыдущий фильтр
SetMTMode(2)
super = MSuper(pel=2)
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)
I use AVISource instead of FFMpegSource or I could not use LoadPlugin("MT.dll")?
This different thing modified avisynth.dll and plugin mt.dll?
But why second scrip work?
Where trick?
yup.
thetoof
7th February 2009, 17:30
Have you tried with ffmpegsource?
TSchniede clearly says that "avisource doesn't work with SetMTMode on [his] machines"
Fizick
7th February 2009, 19:53
Yup,
i know why MT(""" script work. It must work :)
But I do no know exactly, why the first your script (SetMTMode) does not work. Try to use FFPEGSource, or other codecs. And also try various sadx264 modes. I am not sure.
Please report your results here.
halsboss
7th February 2009, 23:43
had trouble with ffmpegsource, see other thread. see how your own luck holds. avisource seems to work for me don't know why.
cwk
7th February 2009, 23:47
I cannot access Fizick's website: http://avisynth.org.ru/
I get the following error:
The browser could not find the host server for the provided address.
Is anyone else having the same problem?
jeffy
8th February 2009, 00:08
@cwk:
http://forum.doom9.org/showthread.php?p=1246713#post1246713
http://forum.doom9.org/showthread.php?t=144849
cwk
8th February 2009, 15:24
Thanks Jeffy.
ck
yup
9th February 2009, 07:03
Hi Fizick & thetoof!
Thanks to advice.
I downloaded FFMpegsource2
http://ivtc.org/new/beta/FFmpegSource-2.00b4.rar
change AVISource to FFVideoSource in my script and now all work fine.
yup.
Blue_MiSfit
10th February 2009, 01:30
@cwk:
Yes, I also can't get on avisynth.org.ru... :(
~MiSfit
Terranigma
10th February 2009, 15:09
It's working now. :)
McCauley
19th February 2009, 20:01
Hi,
is there a way this script could be converted to MVTools2?
##############################################################################
#Original script by g-force converted into a stand alone script by McCauley #
#latest version from December 10, 2008 #
##############################################################################
function Stab (clip clp, int "range", int "dxmax", int "dymax") {
range = default(range, 1)
dxmax = default(dxmax, 4)
dymax = default(dymax, 4)
temp = clp.TemporalSoften(7,255,255,25,2)
inter = Interleave(temp.Repair(clp.TemporalSoften(1,255,255,25,2)),clp)
mdata = DePanEstimate(inter,range=range,trust=0,dxmax=dxmax,dymax=dymax)
DePan(inter,data=mdata,offset=-1)
SelectEvery(2,0) }
As far as i understand the documentation it is not possible, because of the Lack of certain parameters.
Is there a speed gain to be expected with MVTools2?
Regards and thanks in advance
McCauley
Sagekilla
19th February 2009, 20:40
That script doesn't use MVtools. There's no need to "convert" it to MVTools 2.
McCauley
19th February 2009, 20:58
That script doesn't use MVtools. I am aware of that. But i want to know if there's a speed gain to be expected if it does. Hint: MDepan
There's no need to "convert" it to MVTools 2.That is what i'm asking.
Regards
McCauley
pbristow
19th June 2009, 19:36
Not a question, but a compliment:
I've been working with AVISynth for about 2 years; I've been learning and using MVTools2 for just a few weeks now, reading about and trying out a new filter every few days, and I have to say it is the most thorough, well designed and professional piece of work I've seen in a long time! It's a real joy to study and play with. Congratulations to Fizick and everyone else who helped.
The documentation is excellent too, despite occasional (small) English language errors! =:o} It's brought back my joy in studying complex technical stuff.
Fizick
19th June 2009, 21:55
pbristow,
thanks.
can you can correct (small) English language errors produced by developers from France, Russia, Denmark and Germany ?
;)
After playing with my aWarpSharp i went to optimize something more useful. Here is modified version of MVTools 2.4.2: http://pavelsx.googlepages.com/mvtools-v2.4.2_mod.rar
I did some source/project settings cleanup and optimized primary for MDegrain1/2/3 - depending on your settings you'll probably see 2-15% speedup, results are bit-identical to original 2.4.2.
tedkunich
23rd June 2009, 21:41
After playing with my aWarpSharp i went to optimize something more useful. Here is modified version of MVTools 2.4.2: http://pavelsx.googlepages.com/mvtools-v2.4.2_mod.rar
I did some source/project settings cleanup and optimized primary for MDegrain1/2/3 - depending on your settings you'll probably see 2-15% speedup, results are bit-identical to original 2.4.2.
SEt,
Thanks for the update! I try to get some test results this evening - the only script that I tried so far saw about a 0.5% speed increase with the new filter. (results are not realistic as MDegrain2 was never really the bottleneck)
T
Corrected threading problems, minor optimizations: http://pavelsx.googlepages.com/mvtools-v2.4.2_mod2.rar
tedkunich
30th June 2009, 18:59
Corrected threading problems, minor optimizations: http://pavelsx.googlepages.com/mvtools-v2.4.2_mod2.rar
SEt,
Sorry, forgot to post some numbers last week....
Using Mdegrain2, I saw about a 5% speed increase on my quad core AMD, processing SD material. I'll try out your threadding patches in the next few days, as I still get some locked threads (even after quitting Vdub, I see a Vdub procees still running a 25% CPU).
Thanks,
T
Fizick
2nd July 2009, 18:51
SEt, thanks for your efforts :)
I have some to start revise your mod.
Can I ask, why did you change :
SECTION .rodata data align=16
to
SECTION .rodata align=16
in NASM code?
Because it caused section to be read-write instead of read-only, so the resulting dll had 2 .rodata sections: one read-only and one read-write.
Fizick
7th July 2009, 22:48
I merged all SEt mods in new released v2.4.4, besides avisynth.h (replaced by official v2.5.8) and VC2005 project files (anyway I use Codeblocks with VC Toolkit 2003 :) )
threading problems?
Well, i changed avisynth.h not out of nowhere:
0xffffffff80000000 as i remember C/C++ standard is actually 0x80000000 (unsigned int constant) and promoting it uint64_t leads to 0x0000000080000000 what is incorrect. VS as usual compiles it its own way, but GCC warns about constant truncation.
void Release() { if (refcount==1) InterlockedDecrement(&vfb->refcount); InterlockedDecrement((long *)&refcount); }is definitely not thread safe and
~VideoFrame() { InterlockedDecrement(&vfb->refcount); }is also suspicious (but never actually called).
virtual __stdcall ~IClip() {}
VS silently ignores it and compiles some kind of __thiscall here. Intel warns that __stdcall is ignored and GCC floods you with errors if you don't redefine destructors in all derived classes as __stdcall (seems like calling convention isn't inherited for default destructors).
niiyan
12th July 2009, 15:46
@Fizick
I can't download MVTools v2.4.5.
Fizick
12th July 2009, 18:54
I temporary removed it. I was not sure is any bug in avisynth.h from 2.5.8MT or not.
niiyan
13th July 2009, 15:47
I see. I'll wait until v2.4.5 is back. Thanks.
tormento
21st June 2010, 06:37
Why this project has frozen?
Emulgator
10th August 2010, 10:57
While trying MVTools 2.5.10.1 to interpolate frames (MFlowInter)
it seems to me that changes to thSCD1, thSCD2 and blend are not respected.
Can anybody repeat this ?
Source is a 24p clip where 2 frames had been burnt and cut off.
These were to be interpolated.
blksize=8 gave too many artifacts, so I choose blksize=16
which had helped in the past to have more coherent vectors.
But blksize=16 led to interpretation as a scenechange and in consequence to 2 blended frames.
OK, so I would raise thSCD1 and SCD2, but no change in response.
While setting blend to false, no changes. The 2 inserted frames still stayed blended.
MShow shows vectors before and after, but not for the two frames that mark the gap,
so i guess that MAnalyse throws a scene change here.
#..............................Part of a frame interpolation script based on MVTools 2
blksz=8 # Blocksize for Motion search. Default = 8. 4: many artefacts with poor sources, 16 being smoother.
searchp=32 # Radius for Motion search. Default = 2. KungFu: For Blocksize=16 searchp up to 32 helped.
bld=true # Decides what to do if a Scenechange is detected by the following parameters: true will blend, false will repeat previous frame.
SCDpb=400 # Default = 400. SAD (pixels*luma values) Threshold per Block. A Block exceeding this SAD is considered changed.
## SAD = Sum of Absolute Differences = Number of pixels per 8x8 block (=64) multiplied with their luma difference.
## SCDpb is always given related to 8x8 blocks and scaled internally to match other block sizes. SCDbp is thSCD1 and is evaluated before SCDpf=thSCD2
SCDpf=130 # 0-255, Default=130. Changed Blocks threshold per frame.
## This Threshold sets which minimal percentage of changed blocks a frame has to contain to be considered as a scene change.
#..............................................................................................................End of Input Parameters.................................................................................................................................................................
IsYUY2 ? NOP : IsYV12 ? NOP : ConvertToYV12(IsFieldBased) # MVTools need YUY2 or YV12 !
pixtyp=IsYV12 ? "YV12" : IsYUY2 ? "YUY2" : "Unspported"
source=last
super=MSuper(source, pel=4, rfilter=3)
backward_vectors=MAnalyse(super, blksize=blksz, search=5, searchparam=searchp, isb=true, delta=1, temporal=false, dct=0, divide=0, trymany=false)#delta=framedistance;isb=IS Backward
forward_vectors=MAnalyse(super, blksize=blksz, search=5, searchparam=searchp, isb=false, delta=1, temporal=false, dct=0, divide=0, trymany=false)#search 3:=Exhaustive; 4:=Hex(default); 5:=UMH
#....other inter clips
interthirtythree=MFlowInter(super, backward_vectors, forward_vectors, time=33, ml=70, blend=bld, thSCD1=SCDpb, thSCD2=SCDpf)
#....other inter clips
intersixtyseven=MFlowInter(super, backward_vectors, forward_vectors, time=67, ml=70, blend=bld, thSCD1=SCDpb, thSCD2=SCDpf)
#...other interclips
function framerest(int insertbefore, int insertlength, clip src,[*...other clips...,*] clip thirtythree,[*...other clips...,*] \
clip sixtyseven,[*...other clips...,*] int wide, int high, float framespersec, string pixtyp, int audch, int audbit, int audsamp)
{
insertlength==-1 ? blankclip(length=0, width=wide, height=high, pixel_type=pixtyp, fps=framespersec, stereo=true, sixteen_bit=true, audio_rate=audsamp) : \
#.....other insertlengths....
insertlength==2 ? thirtythree.trim(insertbefore-1,-1) ++ sixtyseven.trim(insertbefore-1,-1) ++ src.trim(insertbefore,-1) : \
#...other insertlengths....
: blankclip(length=0, width=wide, height=high, pixel_type=pixtyp, fps=framespersec, stereo=true, sixteen_bit=true, audio_rate=audsamp)
return(last)
}
interA=framerest(insertbeforeA, insertlengthA, source,[*...other clips..., *] interthirtythree,[*...other clips...,*] intersixtyseven,[*...other clips...,*] width, height, framerate, pixtyp, audch, audbit, audsamp)
insertlengthA!=-1 ? source.trim(0, insertbeforeA-0==1 ? -1 : insertbeforeA-1)++interA++\
#....lots of other interclips here...
: source.trim(insertbeforeA+1, 0)) : source
#MShow(super, forward_vectors)
MShow(super, backward_vectors)
Emulgator
11th August 2010, 09:56
Solution found:
The version 2.5.10.1 mod16a version contained in dither1.3 by Firesledge
has this fixed and respects thSCD changes.
http://ldesoras.free.fr/
Fizick
11th August 2010, 17:04
Emulgator,
I can not confirm your bug report.
This bug was in older version 2.5.10.
Are you sure, that you load latest version 2.5.10.1 from my site?
May be some older version is floated around at your system? How do you load mvtools2.dll?
Emulgator
18th August 2010, 13:25
I loaded mvtools2.dll not by extra call from extra directory, only by autoload from normal plugins directory.
mvtools 1.11.4.5 resides in the same directory.
It may well be that something 2.5.10 was floating around before,
I think I updated to 2.5.10.1 from avisynth.ru and erased the 2.5.10.dll.
As the fault happened I was confirming by "Properties"
and I think I remembered seeing version 2.5.10.1.
(Late Edit: No, I was remembering wrong:
I actually saw 2.5.10 and thought: Maybe the name edit had been forgotten)
But many thanks anyway, Fizick, all is fixed and running now.
Emulgator
27th August 2010, 15:26
Late Edit: It looks like driver error on my side.
I guess the previously downloaded mvtools2.zip containing 2.5.10 had been cached
and coughed up a second time by my browser when I meant to download 2.5.10.1.
I just had the same scenario with DGAVCIndexDI not bringing the just introduced Manual update.
Erasing my Browser cache helped !
I should empty my browser cache more often.
Please accept my apologies.
pbristow
23rd September 2015, 14:11
Hi all,
No mention in this thread of the work done since 2009 by Firesledge? Is there another thread for that? (Couldn't see one when I searched just now, but will try harder...).
(Can't believe how long it's been since I last used/updated my "proper" MVTools2, rather than "cheating" and using the SVP version for basic "smoother video"/"slow-mo" tasks! [EMBARASSED GRIN] )
feisty2
23rd September 2015, 14:16
Nah, mvtools has been updating, it just got no actual thread in this forum
Reel.Deel
23rd September 2015, 14:33
No mention in this thread of the work done since 2009 by Firesledge? Is there another thread for that?
Here's the relevant thread: http://forum.doom9.org/showthread.php?p=1386559#post1386559
pbristow
23rd September 2015, 17:28
Here's the relevant thread: http://forum.doom9.org/showthread.php?p=1386559#post1386559
Hmmm... That's a thread about something that *uses* a fairly recent version; It doesn't say anything about the development.
I was hoping to find something where Firesledge was talking about what he/she/they was/were doing, and thinking of doing next, etc.
I have a suggestion/request, y'see, if Firesledge or anyone else) is interested in picking it up...? I'd like to be able to use 1-pixel high blocks (i.e. set blksizeV = 1). Ideally, I'd also like to use that with a very high block width, e.g. 32, 64 or even 128 pixels... But that's less important than the single-pixel height.
The intended application is to stabilise VHS transfers with wobbly verticals, by:
(a) averaging out the horizontal offset between copies of the same scan line from multiple captures, or
(b) using clues from the lines above and below,
(c) using clues from previous and following frames,
(d) combining (b) and (c).
Now, I've done some promising rough tests by doubling the source height first with PointResize, processing with blksizeV = 2, and downsizing again afterwards, but the processing is slow. Avoiding the duplicated calculations in the block-match, and/or excessive numbers of basically redundant block-searches for the same line, could help speed it up a lot.
Fizick
2nd April 2016, 15:47
Released MVTools v2.5.11.20.
•Fixed Mflow broken in 2.5.11.2, fixed several other small bugs.
•MBlockFps: added support of overlap, renamed parameter thres to ml.
•MCompensate, MMask: added partial time compensation.
•Masked functions: improved occlusion mask.
•MBlockFPS, MMask - added option to use SAD as occlusion mask.
•Documented (after Firesledge) negative delta values (v.2.2.1 quick hack for static scene compensation and motion tracking) and fixed some functions accordingly.
Avisynth 2.6 header, but no new color formats.
stax76
2nd April 2016, 16:02
I know it's very difficult but a merge of all flavors and builds would be awesome. Out of the 34 x64 plugins included with StaxRip x64 only ffms2 and KNLMeansCL support both AviSynth+ x64 and VapourSynth x64 as single DLL.
chainik_svp
3rd April 2016, 13:33
BTW svpflow plugin code contains an intermediate abstraction layer to separate the core logic from *synth interface, so the same sources're used to build both Avisynth and Vapoursynth plugins.
It's more like a demo version now and may not be suitable for a complicated plugins but it's totally enough for MSuper/MAnalayse/M***Fps.
pinterf
5th April 2016, 11:32
Fizick, download link to the new version is available only from the Russian page http://avisynth.org.ru/mvtools/mvtools2-rus.html
Fizick
6th April 2016, 18:37
Anyboby else have a problem with english page ?
Boulder
6th April 2016, 18:48
Nope, seems to work fine for me.
pinterf
6th April 2016, 20:24
Must be the company proxy. It works from home.
Fizick
22nd April 2016, 22:06
v2.5.11.21 (22.04.2016 by Fizick)
•MflowXXX: remove limit of motion vectors length (was 127/pel).
•MMask: possible vector scaling for kind=3,4,5.
The vector length limit problem was discussed (without me :) ) here:
http://forum.doom9.org/showthread.php?t=165075
It was not bug but feature (documented). :)
Vectors always was stored as short , but previous versions used interpolation (resize) code with BYTE (char) as unity. Now it is short int.
Groucho2004
22nd April 2016, 22:27
v2.5.11.21 (22.04.2016 by Fizick)
MflowXXX: remove limit of motion vectors length (was 127/pel).
MMask: possible vector scaling for kind=3,4,5.
Thanks!
jackoneill
26th April 2016, 08:15
1) avisynth.org.ru appears to be dead? It loads "Default Web Site Page".
2) In v2.5.11.3, in MVDepan.cpp, line 711:
int nf = (backward) ? ndest: ndest; // set next frame number as data frame if backward
One of those should be either ndest+1 or ndest-1, right? Also, the comment contradicts the comment at line 549. Which one is correct? Due to 1) I was unable to check if this was fixed in the latest version.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.