版面规则
提问时请注意:尽量详细描述操作过程、AVS脚本内容等,最好能写出片名,只贴图有时无法看出问题原因。
提示:发布原创内容请尽量使用附件上传。使用网盘会出现过期失效的问题,请注意。
头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

【翻译完成】MVTools2的doc中文译文

2016-06-28 23:19

最近两天看MVTools2的doc,而且刚好最近事情不多,就顺手给翻译了。有些专业术语,可能并不能很好的对应中文,就用中括号注在了后面。我本身也比较菜,所以可能会有翻译出错的情况。如果可以,还请各位大神帮助修订。

本文档为MVTools v2.5.11.20原英文文档的中文翻译版本。
版本号:v1.2
最新修订日期:2016.07.12
翻译完成日期:2016.06.30
翻译者:Acciente
特别说明:对于专业词汇,使用中括号在译文后标注了原文。“版本修订”部分无翻译的必要性,但为保持文档完整性,将原文整理入此文档中。
转载请注明原文档作者以及翻译者。
PDF版附件下载:
MVTools翻译.rar
(702.75 KiB) 下载 279 次

目录:
I)关于MVTools
Ia)关于MVTools 版本2
II)函数说明
III)示例
IV)声明(请不要略过此部分,但是我们也不强制你阅读它)
V)版本修订
VI)下载


摘要:
作者:Manao, Fizick(Alexander Balakhnin), Tsp, TSchniede, Set
版本:2
下载链接:http://avisynth.org.ru/mvtools/mvtools2.html#download
分类:其他插件
要求:YV12或YUV2色彩空间
许可:GPL
上次由 Acciente 在 2016-07-12 21:08,总共编辑 7 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

关于MVTools

2016-06-28 23:20

I)关于MVTools
AviSynth 2.5版本的MVTools插件是一个进行视频运动侦测与补偿的一套工具。运动补偿可以用来进行高强度时域降噪,高级视频帧率转换,画面修复以及其他处理。

这个插件包含运动侦测的服务函数[server-function] MAnalyse和几个使用运动补偿的用户函数[client-function]如MCompensate,MMask等等。前者对图像进行分析生成运动矢量,后者使用这些矢量进行包含运动补偿的处理。

插件使用区块匹配[block-matching]算法进行运动侦测。(与MPEG2和MPEG4等使用的算法类似。)在图像分析阶段,这个插件将一帧画面分割成小区块,接着试图在这一帧的前后帧寻找最接近的区块。相匹配的区块之间的位移形成了运动矢量。区块之间的相似度主要通过这两个区块的绝对差异总和[sum of absolute differences, SAD]来计量。SAD是一个用来描述运动侦测质量的值。MAnalyze输出的结果是一个以某种特殊方式包含运动矢量的画面。(译者注:在音频属性的部分也包含了信息,所以不可以结合MP_Pipeline使用。)

在运动补偿阶段,插件的用户函数[client-function]读取运动矢量信息,并且使用它们来移动区块,构成运动补偿画面(或者实现其他完全或部分的运动补偿,又或者进行画面差值)。在运动补偿画面中,相对于当前画面,每个匹配的区块都会位于相同的位置。因此,我们可以在高速运动的画面下进行高强度时域降噪,而不必担心产生鬼影[ghosting]等副作用。(因为当运动侦测完美时,运动补偿画面和当前处理画面中,物体的主体和边缘都是完美重合的。)这个插件可以通过运动补偿,为当前帧创造出前后相邻的画面,并通过内部函数进行降噪。另外,你也可以通过使用运动补偿画面和原始画面来制作交织画面[interleaved clip],然后使用外部滤镜进行降噪,输出降噪后的画面。(查看后文示例)

当然,运动侦测和补偿并不完全理想和精确,在某些复杂的场景下例如渐变、超高速运动、或者往复运动时,运动侦测的结果可能是完全错误的,从而使得运动补偿画面呈现分块状,或者得到难看的画面。物体有遮盖时[occlusion]以及开始反向运动时[reverse opening],也会使得运动的侦测变得极为困难。包含大量运动补偿的复杂AviSynth脚本会消耗大量的内存,而且处理非常缓慢。这个插件并不简单浅显,事实上是非常复杂的。请在适宜的场合下使用,并且在使用时调整它的参数。在Doom9 AviSynth板块,有许多关于使用运动补偿的讨论,例如:old MVTools thread, true motion thread, new MVTools thread。你可以在这里阅读到关于此文档的一些补充,也可以在这里提问。如果你对运动侦测和补偿非常感兴趣,那么你可以在网上搜集到大量关于此主题的科学出版物。

注意:这个插件还在开发中。当前的版本在使用上存在一些限制。只有逐行的YV12、YUV2画面是被支持的。对于其他色彩空间的画面,请将它们转换为这两者。对于隔行的视频,尝试使用Bob反交错[Bob-deinterlace]。(也可以使用分场滤镜SeparateFields。无论后续是否使用SelectEven/SelectOdd都可以。)一些复杂的脚本,例如MVBOB,MCBOB,TempGaussMC等使用MVTools进行包含运动补偿的视频反交错。另外,你也可以尝试使用mg262编写的Motion plugin。


Ia)关于MVTools 版本2
MVTools 版本2是一个程序内部和外部的重要升级。MVTools v2.X 分支的主要目标是简明和稳定。(主要是为多核心CPU下的多线程工作进行优化。)同时,也对性能和内存占用进行了优化。

对于版本2,我们去除了对于大多数人来说很难理解的index和MVTools内部缓存,以及一些其他耍小伎俩般内部处理。取而代之的,我们使用普通AviSynth的缓存,并且引入了全新的强制性预处理阶段(在MAnalyse进行运动侦测之前)。在这个阶段,一个全新的函数MSuper将会取得原始画面,接着生成一个包含多级放缩的画面,称之为“super”。(在先前的MVTools版本0.X-1.X中,“super”以伪clip的形式,与index一起在滤镜内部生成和存储。)这个“super”画面,在MAnalyse和后面的用户函数[client-function]中都会使用。

相关语法变化:一些MAnalyse的参数(pel,sharp)移动到了MSuper函数中。

其他外部重要变化:所有记名参数[named parameter]全部改为不记名参数[unnamed parameter]以适应AviSynth的last参数传递,并且全部需要手动指定(无默认值)。

在v2.0引入了针对YUV2的快速平面处理。

从v2.2开始,MVTools.dll重命名为MVTools2.dll。从v2.3开始,所有的函数由MVxxx重命名为Mxxx,例如MVAnalyse重命名为MAnalyze。因此,你可以在旧脚本中继续使用旧MVTools 1.x,同时在新脚本中使用MVTools 2.x而不需要更改插件调用[loadplugin]操作。

我有些倾向于移除一些陈旧的函数,例如MVDenoise和MVFlowFps2

全面的更改记述,详见“版本修订”部分。

大致上,新MVTools 2.0应该有与v1.11.4类似的处理结果。我们计划在v2.1及以后进行算法改进。

注意:v2当前处于测试阶段。(它通常应该还算稳定。)欢迎汇报错误以及提供建议(新功能申请)。
最后注意:MVTools v1.x分支已停止开发与技术支持。(by Fizick)
上次由 Acciente 在 2016-07-01 9:47,总共编辑 3 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

函数说明 server-function部分

2016-06-28 23:20

函数说明 server-function部分
通用参数
使用运动矢量的滤镜拥有一些共同的参数。这些参数为:场景变换的检测阈值,和ISSE MMX控制。它们都需要使用由MAnalyse生成的一个或者几个运动矢量。

thSCD1(整数):这个参数决定了一个区块[block]被视为在上一帧与当前帧发生改变的检测阈值。当一个区块[block]发生改变时,表明对它的运动侦测事实上是不相关的。这会在某些情况下发生,例如场景变更。因此,这个参数用来调整场景变换检测引擎的触发阈值。如果升高这个参数的值,那么将会减少“变化区块”的数量。对于高噪点或者闪烁的画面,这种做法会很有效。这个阈值会与SAD(见上文描述)作比较。对于完全匹配(即完全一样)的两个区块,SAD=0。然而,在实际的操作中,几乎没有完全匹配的区块。造成这种结果的原因有:复杂的运动(如放缩、旋转、变形),离散的像素采样[discrete pixels sampling],以及噪点。假设我们有两个8x8的区块来进行比较,区块中的每个像素的差值都是5。在这种情形下,SAD的值将会为8x8x5=320。(如果将thSAD1设为400,那么此时这个区块便不会被认作是“变化区块”。)如果这个区块是4x4的,那么SAD值就会被计算为80;如果是16x16的,那么SAD值就会被计算为1280。事实上,这个参数会随着区块大小自动放缩。在使用时,请以8x8的区块大小来设定。参数默认值是400。(v1.4.1及以后版本)

thSCD2(整数):这个参数决定了有多少比例的区块被判定为“变化区块”时,这一帧就会被判定为场景变更。参数的取值范围为0到255。0代表0%,255代表100%。默认值为130(代表51%)

isse(整数):是否启用ISSE、MMX和其他CPU指令集优化的选项。默认值是True。如果你的CPU不支持这种优化,它就会被禁用。(你也没办法开启它们。)

planar(真或假):一个用来指定特殊的YUV2输入与输出的参数。它将YUV2的交织画面[interleaved]拆分成3个平面(Y、U、V)并存储在内存中。以这种方式,我们可以避免在滤镜内部处理过程中的多次交织[interleaved]与平面[planar]的转换。(这种转化会拖慢速度)你可以使用函数Interleaved2planar函数(来源于RemoveGrain 插件by kassandro)将YUV2原始画面转化为planar形式;处理后,再用Planar2interleaved函数转回普通YUV2格式。这种特殊planar形式的YUV2画面,在RemoveGrain(by kassandro)插件,MaskTools2插件(by Manao)和一些其他插件中也被支持。在AviSynth2.6中不需要使用这种操作方法,因为2.6版本原生支持YV16。当输入为YV12画面时,此参数将被忽略。注意:super画面永远是planar格式。此参数的默认值为False。


MSuper
MSuper (clip, int "hpad", int "vpad", int "pel", int "levels", bool "chroma", int "sharp", int "rfilter", clip "pelclip", bool "isse", bool "planar")

读取原始画面,并生成梯度缩放的“super”画面。“super”画面将会在MAnalyse和运动补偿滤镜(即client-functions)中被使用。我们使用音频部分的属性来存储“super”画面的参数。(准确的说,是num_audio_samples这个参数。)因此,在“super” 画面中,音频部分被砍掉了。这也是我们在接下来的后续处理滤镜中,需要将原画面[clip]也输入的原因。你可以亲自看看“super”画面的样子。(它是正常的画面格式。)

hpad:在画面的左右边缘进行填充。小填充是为了让接近画面边缘的区块得到更好地运动侦测。(在MVTools v2.0的版本以前,内部运算使用vpad=运动侦测区块大小。现在不强制使用这个值,但是推荐使用。)默认值为8。

vpad:在画面上下边缘进行填充。默认值为8。

pel:此参数决定了运动侦测的精确程度。取值可以为1,2或4。1代表精确度为1像素,2代表精确度为半个像素,4代表精确度为四分之一个像素。在2或4的情况下,运动侦测时会使用空间插值。(这会让它更加精确,但是运算更加缓慢,而且并不是所有情况下都能得到更好的结果。)默认值是2。(v1.4.10及以后版本)

levels:这个参数决定了“super”画面中的梯度数量。MAnalyse会使用所有梯度大小的画面进行运算。而对于后面的处理滤镜,即client-function,只需要一个最大的[finest]画面即可。默认值:0(自动,所有可能的梯度放缩均被生成。)

chroma:如果设定为True,那么色度平面(U、V)也会被运算。(设定为False就只运算亮度平面Y。)默认值:True。

sharp:子像素[subpixel]插值[interpolation]算法指定。针对pel=2或4时使用。0代表柔和[soft]插值(bilinear),1代表双立方[bicubic]插值(4 tap Catmull-Rom),2代表更加锐利的Wiener插值(6 tap,类似于Lanczos)。默认值为2。

rfilter:形成梯度缩放画面时使用的平滑[smoothing]和减半[reducing(halving)]滤镜。
0代表简单的4个像素取平均,类似unfiltered SimpleResize滤镜(旧方法);
1代表类似ReduceBy2的三角形[triangle(shifted)]滤镜,提供更大的平滑效果(减少锯齿);
2代表类似BilinearResize的三角形[triangle]滤镜,提供更大的平滑效果;
3代表quadratic滤镜,提供更大的平滑效果;
4代表类似BicubicResize(b=1,c=0)的立方[cubic]滤镜,提供更大的平滑效果。
默认值是2(从v2.3.1版本以后)。你也可以尝试使用一些外部滤镜来处理“super”画面,特别是较为粗糙的底部部分。(需要通过适当的切割[crop]和拼接覆盖[overlay])

pelclip:在pel>1时,可以选择通过此参数输入一个放大的原画面,用来替代内部滤镜产生的插值画面。位于pel值整倍数的行和列的像素必须是原像素,其他像素是插值像素。
对于pel=2时的示例:LanczosResize(width*2,height*2,src_left=0.25, src_top=0.25)(注意:对于Y平面来说,这样的缩放写法是正确的,而对于YUV2和YV12来说,这样的写法并不正确,这是由于色度像素left align而不是center align导致的。在Y平面尺度下,对于YUV2画面应该改为src_left=0.5,对于YV12,还要再将src_top=0.5也更改)
EEDI2放大滤镜在这里很有用。
默认值为未定义[not defined]。
(译者注:这里并不是所有的放缩滤镜都能够满足要求:“位于pel值整倍数的行和列的像素必须是原像素,其他像素是插值像素。”对于常见的放缩滤镜,如果除原点外,其他整点处的权值为0,那么结果就会使得中央像素权值为1。否则若其他整点处有权值,那么通过normalize使总权值为1后,原点处的权值不为1,结果是位于pel值整倍数的行和列的像素不再是原像素。可以查看此网页来确定放缩滤镜是否符合要求。http://svn.int64.org/viewvc/int64/resam ... html此处补充by mawen1250)


MAnalyse
MAnalyse (clip super, int "blksize", int "blksizeV", int "levels", int "search", int "searchparam", int "pelsearch", bool "isb", int "lambda", bool "chroma", int "delta", bool "truemotion", int "lsad", int "plevel", bool "global", int "pnew", int "pzero", int "pglobal", int "overlap", int "overlapV", string "outfile", int "dct", int "divide", int "sadx264", int "badSAD", int "badrange", bool "isse", bool "meander", bool "temporal", bool "trymany")

这个函数以区块匹配[block-matching]算法分析“super”画面,然后输出一个包含运动矢量的特殊画面。我们引入了一些多级[multi-level]搜索算法(从最粗糙的画面到最精确的画面)。这个函数会使用零矢量,也会使用某区块相邻区块的运动矢量来帮助此区块进行运动矢量的计算。对于每个运动矢量,我们对这个矢量相关的两个区块计算SAD,接着,将这个矢量改变一点,再次计算SAD,以此类推。在这些被计算的矢量中,得到的SAD值最小的,成为最终的矢量计算结果。(然而,这种计算方法有可能破坏运动的连贯性。)

super:MSuper函数生成的“super”画面。

blksize:每个区块的水平大小。值可以为4,8,16,32(默认值为8)。区块越大,受到噪点的影响就会越小,运算速度也会更快,不过结果的精确性将会降低。

blksizeV:每个区块的竖直大小。默认值与水平大小相等。其他可选值:当blksize=8时,可选4;当blksize=16时,可选8或2;当blksize=32时,可选16。

levels:正值代表搜索运动矢量时使用的梯度级数。零或者负值代表搜索运动矢量时,由粗糙向精确,不使用(即忽略)的梯度级数。一般绝对值越小,搜索结果越好。我们将这个变量设为可调整,是出于学习与调试的目的。有时候,通过调整levels可以避免巨大向量(或者错误向量)的出现。默认值为0,即所有的缩放梯度都被使用。(从v2.5版本往后)

search,searchparam,pelsearch:search参数决定了在每一级画面的运动矢量搜索方式。searchparam是用来控制搜索强度、范围等的附加参数。pelsearch是用来决定在最精细的一级画面中使用的搜索方式。
search=0:使用“OneTimeSearch”。searchparam决定了两个尝试矢量的间隔[step]。如果searchparam大于1,间隔[step]将会被逐行[progressively]优化。
search=1:使用“NStepSearch”。N由searchparam设定。这是最广为人知的MV搜索算法。
search=2:对数[Logarithmic]搜索,也称作Diamond Search。searchparam指定搜索初始步数[initial step search]。它也会被逐行优化[refined progressively]。
search=3:全面搜索[Exhaustive search],searchparam指定了搜索半径radius。正方形搜索区域边长为2*radius+1。这种算法很慢,但是在以SAD计算的意义上,会给出最好的结果。
search=4:六边形[Hexagon]搜索,searchparam指定了搜索范围。(与x264中hex相似)
search=5:不均匀多重六边形[Uneven Multi Hexagon]搜索,searchparam指定了搜索范围。(与x264中umh相似)
search=6:纯水平方向全面搜索[pure Horizontal exhaustive search],searchparam指定了搜索半径。搜索水平宽度为2*radius+1。
search=7:纯竖直方向全面搜索[pure Vertical exhaustive search],searchparam指定了搜索半径。搜索竖直宽度为2*radius+1。
默认值:search=4,searchparam=2,pelsearch=pel

isb:一个真假型参数。用来指定矢量搜索是先前帧到当前帧,还是当前帧到后续帧。isb的全称是IS Backward,中文含义为“是否向后”。当isb=false时,代表搜索先前帧到当前帧;当isb=true是,代表搜索后续帧到当前帧。默认值false。

chroma:如果设为true,那么色度平面也会进行运动矢量计算。如果设为false,则只计算亮度平面。默认值true。

delta:设定参考的时域范围。默认值为1,代表运动矢量将会在当前帧与一个相邻帧之间进行搜索(向前或向后由isb参数指定)。如果设定为2,那么运动矢量将会在当前帧,隔一帧的相邻帧之间进行搜索。如果delta设定为0或者负值,那么将会使用一个固定的帧[fixed reference frame]进行参考,帧序号为delta的绝对值。在这种情况下,isb的值将会被忽略。只有很少的几个函数可以使用这种固定参考帧,如MComensate,MFlow,MMask,MShow。

有一些高级的参数可以用来保证运动矢量侦测中运动的连贯性。有些通过SAD计算得来的最匹配的两个区块,在某些情况下并不能用来描述物体真实的运动情况。(即有可能出现错误的匹配。)例如,这两个区块可能分别两个位于一个画面的两个不同的角落,或者位于两个不同的周期运动物体上。“True motion”参数尝试保持运动的连贯性,并排除一些由错误匹配造成的矢量随机指向的情况。对于部分运动补偿[partial motion compensation]和插值[interpolation],这个非常重要。有一些参数是实验性的,并且在下一个版本中可能被移除。请汇报你的实验结果。

truemotion:这个参数用来指定是否启用有关True motion的一系列参数的预设值。设为True将会进行true motion搜索(高矢量连贯性[high vector coherence])。设为False则基于SAD决定最佳匹配区块。默认值是True。(从v1.4.10版本往后)任何情况下,你都可以独立地调整有关true motion的参数。

lambda:设定运动矢量的连贯区间[coherence of the field of vectors]。设定值越高,矢量的连贯性就越大。然而,如果设定值过高,便有可能舍去最佳匹配的运动矢量。对于8x8的区块,强烈建议将值设在400-2000的范围内。在内部处理中,这个值是运动矢量方差值的SAD惩罚函数系数[coefficient for SAD penalty of vector squared difference],并会x256。
默认值:当truemotion=false时为0;当truemotion=true时为1000*blksize*blksizeV/64

lsad:lambda使用的SAD限制。当进行运动矢量侦测的SAD值大于这个参数时,局部的lambda值将会被降低。这种操作可以防止得到糟糕的侦测结果,但是也同时降低了运动矢量连贯性。对于True motion,建议将值设定在1000以上。内部计算时,将会以8x8的区块大小为参照自动放缩这个值。(从v2.0.11版本往后)
默认值:当turemotion=false时为400,当truemotion=true时为1200。

pnew:与最佳运动矢量计算相关的惩罚函数系数(放缩到256倍)。只有满足如下情况,一个新的运动矢量才会被视为比先前的运动矢量更好:当前正在计算的运动矢量(SAD+SAD*pnew/256)的值比当前最佳运动矢量的SAD值还要小,那么当前计算的运动矢量被替换为最佳的运动矢量。通过这种方式,我们可以避免某一个SAD比先前最佳矢量略微好一点点,但运动方向却完全不同的新矢量被替换为新的最佳矢量。默认值:当truemotion=false时为0,当truemotion=true时为50。

plevel:lambda级别缩放模式[level scaling mode]的惩罚因子[penalty factor]。取0时代表无缩放[no scaling],取1时代表线性缩放,取2时代表以依靠梯度等级的二次方缩放。注意:在低缩放尺度下,运动矢量会小一些。默认值:当truemotion=false时为0,当truemotion=true时为1。

global:侦测全局运动(对每一个缩放梯度),并且将其结果作为一个附加判定因子。只有画面的全局整体平移会被侦测(不包括放缩和旋转)。True代表启用,False反之。默认值:当truemotion=false时为false,当truemotion=true时为true。

pzero:与最佳运动矢量计算时关于零矢量的惩罚函数系数(放缩到256倍)。与pnew的思路类似,它可以可以避免某一个SAD比先前最佳矢量略微好一点点的零矢量被替换为新的最佳矢量。(lambda在零矢量上不起作用。)默认值与pnew相等(从v1.11版本往后)。

pglobal:与全局[global]最佳运动矢量计算相关的惩罚函数系数(放缩到256倍)。(lambda参数对全局运动侦测不起作用。)默认值为0。

overlap:区块水平重叠值。必须是偶数,并且小于区块大小(对于MCompensate函数,必须小于blksize/2)。在运动侦测中,区块移动的最小步进[step]为blksize-overlap。N个区块将会覆盖宽度为((blksize-overlap)*N + overlap)的画面。尝试将overlap的值设定为blksize/4到blksize/2。overlap的值设定的越大,将会进行越多block的运算,进而会使得处理速度降低。默认值为0。
支持overlap的函数有:MFlow,MFlowInter,MFlowFps,MShow,MMask,MCompensate,MDeGrain1,MDeGrain2,MDeGrain3。

overlapv:区块竖直重叠值。默认值与overlap相等。对于YV12,必须为偶数,且小于区块大小。

outfile:指定输出运动矢量数据的文件名称。这个数据可以被一些外部滤镜使用,也可以在二次编码[second pass]时调用MVTools时使用等等。
生成的文件具有二进制文件头。(MVAnalysisData结构,请查看MVInterface.h源码。)数据排列顺序如下:帧数,每个区块的矢量数据(Vx,Vy,SAD),下一个可用帧的序号,本帧的矢量数据等等。默认值:空空字符串[string],即不输出数据。

dct:使用离散余弦变换[DCT](frequancy spectrum)进行区块的SAD运算。它能够优化运动矢量侦测,尤其是在亮度闪烁和渐变的情况下。
0:普通平面[spacial]区块,不使用DCT;
1:使用区块DCT取代平面[spacial]数据。(对8x8的区块比较慢,对于其他大小的区块更慢。)
2:混合平面和DCT数据,权值由相关帧的平均亮度差值决定。
3:区块自适应性切换,针对每个区块选择使用平面[spacial]运算值或是平面运算值与DCT运算的平均值。(实验性,稍微快速一点)
4:区块自适应性切换,针对每个区块选择使用平面[spacial]运算值或是平面运算值与DCT运算的加权平均,其中DCT值的权值更大。(实验性,稍微快速一点)
以下是在v1.9.5.3增加的模式,需要sadx264 0-7,使用最快的SATD函数,只处理亮度平面。
5:使用SATD替代SAD处理luma平面。
6:使用SATD算法,其余与2相同。
7:使用SATD算法,其余与3相同。
8:使用SATD算法,其余与4相同。
9:类似2,使用SAD的权值进行SATD的运算,保证SAD和SATD的等价。
10:类似3/4,只在亮度强烈变化时,令SATD使用与SAD相等的权值。
默认值:0

divide:将一个区块切分为4个子区块来进行后处理[post-processing]。
0:不切分。
1:将区块四分,并将原区块的运动矢量值直接分配给四个子区块。
2:将区块四分,并计算与相邻两个区块[2 neighbors]的中值,分配给子区块。
默认值为0。区块大小blksize的设定和overlap值必须能够使得区块被四分。

sadx264:如果允许,则使用x264的SAD函数代码。
0:自动检测CPU并进行最佳选择。
1:使用MMX 16x16,16x8,8x8,8x4,4x4(8x16,4x8只在色度平面使用)。
2:使用MMX 16x16,16x8,8x8,8x4(8x16,只在色度平面使用)分配到32 Byte 区块。
3:使用MMX 16x16,16x8,8x8,8x4(8x16,只在色度平面使用) 分配到 64 Byte 区块,对 Pentium M效果最佳。
4:使用SSE2 16x16,16x8(无特殊分配[special alignment])。
5:使用SSE2 16x16,16x8分配到64 Byte区块(适合在Core上使用)。
6:使用SSE3 16x16,16x8(似乎只在 Pentium 4E & Core1上会更快)。
7:使用SSSES3 16x16,16x8,分配到64 Byte区块(适合在Core2上使用)。
模式8-12只是用来进行debug的。否则使用dct>4。
8:使用SSD mmx,在任何模式下与1相同。
9:使用SATD mmx,在任何模式下与1相同。
10:使用SATD SSE2,在任何模式下与2相同。
11:使用SATD SSSE3,在任何模式下与2相同。
12:使用SATD SSSE3,在8xY上与PHADD共同使用,在任何模式下与2相同。
默认值为0。设为-1或者>=13来使用v1.9.4版本中的旧SAD算法,同时完全关闭x264 SAD函数。

badSAD:SAD阈值,用来设定触发针对劣质运动矢量的二次扩大搜索。这个值将会关于8x8的区块自动进行放缩。默认值为10000。(设定为此值即关闭此功能。)推荐值为1000-2000。

badrange:二次扩大搜索使用的搜索半径。默认值为24。(即24个像素单位)对于在二次搜索中使用UMH算法搜索,请使用正值;若使用全面搜索[Exhaustive search],请使用负值。

meander:交替[alternate]由左向右和由右向左以列[row]进行区块的扫描[scan]。默认值为True(从版本v2.5.1)往后。

temporal:使用先前帧运动矢量的时域[temporal]预测单元[predictors]。默认值为False。(与SetMTMode不兼容)

trymany:尝试在多个预测单元周围开始搜索(而不是从最优梯度级别开始)。[try to start searches around many predictors(besides finest level)]。默认值为False。

尝试使用MShow来查看侦测的运动区域和调整参数。

注意:当pel=2时,MAnalyse在分析以fieldbased为标识的,并且经过SeparateFields处理过的视频时,会自动微调修正矢量。因为topfield和bottomfield在分离后,会产生细微的上下位移。如果你不希望滤镜自动微调,那么使用AssumeFrameBased。
上次由 Acciente 在 2016-07-12 21:05,总共编辑 6 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

函数说明 client-function部分

2016-06-28 23:20

函数说明 client-function部分
MCompensate
MCompensate (clip source, clip super, clip vectors, bool "scbehavior", float "recursion", int "thSAD", bool "fields", float "time", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

对当前帧做一个全面的运动补偿。(即使用运动补偿来生成当前帧。)进行了运动侦测的每一个区块,都会通过计算得到的运动矢量,由参考帧的位置移动到当前帧的位置,形成一个由运动补偿得来的当前帧。

super:由MSuper生成的梯度缩放画面。

vectors:由MAnalyse生成的运动矢量结果。

scbehavior:此参数控制场景切换时的滤镜工作方式。设定为True时,则当前帧画面保持不变;设定为False时,当前帧画面被直接替换为参考帧。默认值为True。

recursion:这个参数是一个权值设定。默认为0。当对某一帧进行运动补偿时,需要使用这个帧的参考帧。而这个权值指定了参考帧的构成中,使用运动补偿的比例。也就是说,当这个值设定为100时,参考帧完全由参考帧的参考帧通过运动补偿形成。当权值设定为1-99时,参考帧由原参考帧本身和运动补偿参考帧加权平均而成。当你不确定这个参数的功效时,请不要调整这个参数。

thSAD:设定进行运动补偿的SAD阈值。如果某个区块的SAD值超过了阈值,那么生成的画面中,此区块将会直接使用源,而不进行运动补偿。默认值为10000(几乎就是关闭了)。

fields:当pel=2或4时,且此参数设定为True时,针对隔行视频,区块的移动将会被附加一个竖直方向的半像素大小的偏移。进行反交错[deinterlace]的时候使用它。(不是在降噪的时候使用。)默认值为False。

time:运动补偿的比例。取值范围为0.0-100.0的小数[float]。当取值为0时,完全为参考帧画面,当取值为100时,进行全面的运动补偿。默认值为100.0。

遮盖区块[overlapped blocks]以window block summation的方式来处理(类似FFT3DFilter的处理方式),以此来降低画面产生块状的副作用[blocking artefact]。


MMask
MMask (clip source, clip vectors, float "ml", float "gamma", int "kind", int "Ysc", float "time", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

通过运动矢量数据生成一个与输入画面相同大小的mask。mask同时包含亮度和色度平面上的数据。mask的像素取值范围为0-255。

kind:这个参数用来指定mask的类型。
kind=0:以运动矢量的模长来生成mask。由于所使用的算法可靠性更强,所以比起MaskTools里面的MotionMask函数,生成的mask质量更好。mask中值为0代表完全没有运动(运动矢量模长为零)。运动矢量的模长越长(代表着运动越剧烈),那么对应mask的像素值就越大(最大为255)。模长对mask像素值的映射由ml参数控制。
kind=1:以SAD值的大小来生成mask。这种mask可以用来查看画面中的哪些部分运动矢量质量较低。(内部处理中,使用blocksize*blocksize/4作为ml的标准化[normalization]因子。)
kind=2:生成一个occlusion mask。[to build an occlusion mask (bad blocks due to rupture, tensile). Currently, some normalized sum of positive blocks motion differences is used. It can be scaled with ml.]
kind=3:以区块的水平位移大小来生成mask。当区块水平位移为0时,mask对应的像素值大小为128。如果沿水平方向有负向位移,则生成值小于128,反之大于128。可以用ml参数进行位移对像素值的映射缩放。
kind=4:以区块的竖直位移大小来生成mask。当区块竖直位移为0时,mask对应的像素值大小为128。如果沿竖直方向有负向位移,则生成值小于128,反之大于128。可以用ml参数进行位移对像素值的映射缩放。
kind=5:将运动矢量的x,y方向值分别放入U,V两个平面中。可以用ml参数进行位移对像素值的映射缩放。

ml:控制位移大小对像素值的映射缩放。当矢量模长大于等于ml时,mask对应输出值为255。较小的矢量模长会对应到较小的像素输出值。

gamma:用来定义输入值(即矢量模长)到输出值(即mask像素值)的指数关系。当gamma=1.0时,为线性映射。当gamma=2.0时,为二次方映射。

time:运动补偿的比例。取值范围为0.0-100.0的小数[float]。当取值为0时,完全为参考帧画面,当取值为100时,进行全面的运动补偿。默认值为100.0。(译者注,原doc就是这样写的,对应这个新版本的mvtools中MMask也确实有这个参数,然而看起来起不了任何作用。姑且先翻译出来。)

Ysc:场景变更时的mask值。

默认参数:kind=0,ml=100,gamma=1.0,Ysc=0。
(译者注:这里使用矢量位移的模长来对应mask值。当有两个相同内容,但大小不同的画面时,比如DVD和BD的画面,对应的矢量模长在BD中会比DVD中要大。请适当调整模长对mask值的映射。)


MSCDetection:
MSCDetection (clip source, clip vectors, int "Ysc", int "thSCD1", int "thSCD2", bool "isse")

通过运动矢量数据,建立场景变化的检测画面。画面包含亮度[luma]和色素[chroma]平面的数据。如果未遇到场景变换,则输出一个各像素值均为0的画面。如果遇到场景变化,则输出画面的各像素值为Ysc。Ysc的默认值为255。


MShow:
MShow (clip super, clip vectors, int "scale", int "sil", int "tol", bool "showsad", int "number", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

生成一个指示区块运动的画面。即将运动矢量图形化叠加在原画面上。(从v2.0.11版本往后。)(译者注:效果其实挺炫酷的。)

scale:放大[enlarge]运动矢量,目的是为了提高精确度。(当pel>1且scale=1时,你将看不到小于一个像素大小的变动[variation]。)(译者注:在当前版本下,设定scale>1时就会造成avspmod报错。)

sil:设定多级画面运动矢量的查看。设定值越高,则查看的时越粗糙的运动矢量侦测。

tol:一个容忍阈值[tolerance threshold]。如果运动矢量的失真超过了tol,则这个运动矢量不会被显示在画面中。

showsad:设定为True时,将画面的平均SAD值以及低质量区块[bad block]数量(基于thSAC1判定)显示在画面中。

number:将此序号的区块标记为白色。默认值:-1。

默认值:scale=1,sil=0,tol=20000,showsad=false。(在此套参数下,所有的运动矢量都将会显示在画面上。)


MDepan:
MDepan (clip, clip vectors, clip "mask", bool "zoom", bool "rot", float "pixaspect", float "error", bool "info", string "log", float "wrong", float "zerow", int "range", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

通过全局的矢量运算,生成一个给Depan插件(by Fizick)使用的特殊画面。这个函数使用高质量区块,并通过迭代过程[iterative procedure]来侦测帧间的全局运动。若满足下列条件之一,则此区块在计算中会被忽略:1、靠近画面边缘,或者被mask遮盖2、高SAD值(阈值由thSCD1设定)3、与相邻区块或是全局的运动不相符。

mask:如果输入了mask,则对应mask的像素值/255为对应区块的权重。像素值全部为0时,即忽略此区块。当mask未被输入时,靠近四侧边缘的4个block会被忽略。(旧v2.4.3版本算法)

zoom,rot:两个参数分别控制函数是否进行缩放和旋转的侦测。

pixaspect:像素长宽比。(标准PALuiys 1.094,标准NTSC使用0.911)

error:最大平均运动差值。[maximum mean motion difference]

函数在进行侦测时,如果遇到巨大的运动误差[error],或者遇到场景变更(由thSCD1和thSCD2参数控制),那么全局运动侦测结果将被归零。

info:显示出全局运动信息来进行debug。

log:设定log文件路径名。

wrong:这个参数设定了一个阈值,将会把与相邻区块差异过大的区块在侦测中忽略。

zerow:定义零矢量的权值。(为了减少零矢量对全局侦测的影响)

range:侦测全局运动时向前和向后各请求range帧。

默认值:zoom=True,rot=True,pixaspect=1.0,error=15.0,info=False,wrong=10,zerow=0.05,range=0。

对于交错视频的侦测,必须要先使用SeparateFields。(对于MAnalyse和MDepan来说。)


MFlow:
MFlow (clip source, clip super, clip vectors, float "time", int "mode", bool "fields", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

这个函数以像素为单位做运动补偿操作(类似于MCompensate,但是这个以区块为单位)。我们原本的运动矢量是以区块为单位侦测的。为了计算每个像素的运动矢量,我们根据像素所属的区块以及相邻的区块,进行双线性插值[bilinear interpolation],得到这个像素的运动矢量。接下来,我们根据求得的像素运动矢量,将对应的像素由参考帧位置移至当前帧位置,生成一个运动补偿而成的当前帧。通过这种方式生成的运动补偿画面,不会产生块状瑕疵,对降噪来说很好用。然而,生成的画面可能会产生变形瑕疵(译者注:实际感觉,就像画面融化了一样)。对于这个函数,强烈建议在进行运动侦测的时候,开启truemotion。运动补偿可以是完全的,也可以是部分的(对于中间过程)。

super:MSuper函数生成的“super”画面。

vectors:MAnalyze函数生成的运动矢量信息。

time:运动补偿的比例。取值范围为0.0-100.0的小数[float]。当取值为0时,完全为参考帧画面,当取值为100时,进行全面的运动补偿。默认值为100.0。

mode:
当mode=0时,每个像素都会被移动。这是主要的工作模式,也是默认值。
当mode=1时,一种debug模式,生成了非常奇怪的画面。[Shift pixels from every place of source (reference). It is debug (learning) mode with some empty spaces (with null intensity). It can be used for occlusion mask creation.]

fields:当pel=2或4时,且此参数设定为True时,针对隔行视频,区块的移动将会被附加一个竖直方向的半像素大小的偏移。进行反交错[deinterlace]的时候使用它。(不是在降噪的时候使用。)默认值为False。


MFlowInter:
MFlowInter (clip source, clip super, clip mvbw, clip mvfw, float "time", float "mL", bool "blend", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

运动补偿插值函数。与旧版本中的MVInterpolate函数功能相似,但不完全相同。函数要求输入向后[backward]的运动矢量“mvbw”和向前[forward]的运动矢量“mvfw”,以此来生成当前处理帧的差值画面。这个函数基于像素单元处理,使用MFlow的处理方法。内部处理中会生成occlusion mask(即MMask kind=2)和权重因子,并通过这两个来降低输出画面的瑕疵。强烈建议开启truemotion运动侦测。

super:MSuper函数生成的“super”画面。

mvbw,mvfw:由MAnalyse函数生成的向后[backward]和向前[forward]的运动矢量信息。

time:两帧之间插值的位置。(以百分比表示,默认值为50,即在两帧正中插值。)

mL:mask数值放缩参数。若将此参数减小,则会生成一个更强的occlusion mask。默认值为100。

blend:如果设定为True,则会在场景变更时进行画面融合[blend],类似ConvertFps。如果设定为False,则会在场景变更时重复[repeat]上一帧,类似ChangeFps。默认值True。


MFlowFps:
MFlowFps (clip source, clip super, clip mvbw, clip mvfw, int "num", int "den", int "mask", float "ml", bool "blend", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

通过插值手段更改视频的总帧数,来调整视频的帧率(保证播放时长不变)。这个函数通过使用向前[forward]和向后[backward]的运动矢量“mvfw”、“mvbw”,在两帧之间的某位置进行插值,进而改变帧数。这个函数基于像素精度运算,就像MFlow和MFlowInter。内部处理中会生成occlusion mask(即MMask kind=2)和权重因子,并通过这两个来降低输出画面的瑕疵。强烈建议开启truemotion运动侦测。

super:MSuper函数生成的“super”画面。

mvbw,mvfw:由MAnalyse函数生成的向后[backward]和向前[forward]的运动矢量信息。

输出画面的fps以分数的形式表示。即fps=num/den

num:输出画面的fps分子[numerator],默认值为25。

den:输出画面的fps分母[denominator],默认值为1。对于二倍NTSC帧率(约为2*29.97),设定num=60000,den=1001。对于二倍NTSC FILM帧率(约为2*23.976),设定num=48000,den=1001。当num或者dem等于0时,输出画面的帧率为输入画面帧率的二倍。(从v1.8.1版本往后)

mask:处理使用的mask模式。
mask=0:普通的向前与向后的occlusion mask。(在v1.4.x版本以前使用,处理速度最快。)
mask=1:一个类似的mask,但是将occlusion区域替换为静态零矢量[static zero vectors]。(类似于v1.5.x版本中的算法)
mask=2:额外使用相邻帧的运动矢量,以此来减少occlusion区域里产生的晕轮[halo]副作用。(v1.8版本,运算最慢)
默认值为2。

ml:mask数值放缩参数。若将此参数减小,则会生成一个更强的occlusion mask。默认值为100。

blend:如果设定为True,则会在场景变更时进行画面融合[blend],类似ConvertFps。如果设定为False,则会在场景变更时重复[repeat]上一帧,类似ChangeFps。默认值True。


MBlockFps:
MBlockFps (clip, clip super, clip mvbw, clip mvfw, int "num", int "den", int "mode", float "ml", bool "blend", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

这个函数使用基于区块的运动补偿来进行画面插值,由此改变视频帧率(改变总帧数,不改变播放时长)。这个函数通过使用向前[forward]和向后[backward]的运动矢量“mvfw”、“mvbw”,在两帧之间的某位置进行插值,进而改变帧数。在生成输出画面的过程中,内部会生成向前[forward]和向后[backward]的mask以及时域权重因子[time weighted factors]。(算法来自于旧v1.9.12版本MVTools的MVInter函数。)这个函数的处理速度通常比MFlowFps快,但是当overlap参数没有设定好时,可能会造成画面的块状瑕疵。强烈建议开启truemotion运动侦测。一些位于画面右侧和下侧边缘的像素,如果没有完全被区块覆盖,则会通过画面融合来生成[frames blend]。

super:MSuper函数生成的“super”画面。

mvbw,mvfw:由MAnalyse函数生成的向后[backward]和向前[forward]的运动矢量信息。

输出画面的fps以分数的形式表示。即fps=num/den

num:输出画面的fps分子[numerator],默认值为25。

den:输出画面的fps分母[denominator],默认值为1。对于二倍NTSC帧率(约为2*29.97),设定num=60000,den=1001。对于二倍NTSC FILM帧率(约为2*23.976),设定num=48000,den=1001。当num或者dem等于0时,输出画面的帧率为输入画面帧率的二倍。

mode:处理模式
mode=0:从前一帧和后一帧各区一半进行运动补偿插值。(处理速度最快)
mode=1:静态中值[static median]。
mode=2:动态中值[dynamic median]。
mode=3:在后移mask下的前移[shift forward]区块与在前移mask下的后移[shift backward]区块进行时域加权。(当前的默认模式)
mode=4:模式3与移动区块[shifted blocks]的occlusion mask的简单时域平均[simple static time average]的混合处理。
mode=5:使用occlusion mask(debug使用)。
mode=6-8:类似3-5,但是使用SAD mask替代occlusion mask。

ml:mask数值放缩参数。若将此参数减小,则会生成一个更强的occlusion mask。默认值为100。

blend:如果设定为True,则会在场景变更时进行画面融合[blend],类似ConvertFps。如果设定为False,则会在场景变更时重复[repeat]上一帧,类似ChangeFps。默认值True。


MFlowBlur:
MFlowBlur (clip, clip super, clip mvbw, clip mvfw, float "blur", int "prec", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

实验性的简单时域模糊处理函数。它可以用来产生电影效果[FILM-effect](模仿有限的快门时间)。这个函数使用向前和向后的运动矢量“mvfw”、“mvbw”,在帧间[intermediate]某时刻来产生和叠加[overlay]多个部分运动补偿的像素,并在当前帧周围产生周期性[interval]模糊[blur]。它使用基于像素的运动补偿(就像MFlow)。强烈建议开启truemotion运动侦测。

super:MSuper函数生成的“super”画面。

mvbw,mvfw:由MAnalyse函数生成的向后[backward]和向前[forward]的运动矢量信息。

blur:帧间的模糊间隔[inverval],开快门时间(ipen shutter time)。(以百分比计算,默认值为50。)

prec:模糊处理的像素精度。补偿模糊[compensated blurred]像素的最大步进[step]。默认值为1(最精确)。


MDeGrain1, MDeGrain2 and MDegrain3
MDeGrain1 (clip, clip super, clip mvbw, clip mvfw, int "thSAD", int "thSADC", int "plane", int "limit", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

MDeGrain2 (clip, clip super, clip mvbw, clip mvfw, clip mvbw2, clip mvfw2, int "thSAD", int "thSADC", int "plane", int "limit", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

MDeGrain3 (clip, clip super, clip mvbw, clip mvfw, clip mvbw2, clip mvfw2, clip mvbw3, clip mvfw3,int "thSAD", int "thSADC", int "plane", int "limit", int "limitC", int "thSCD1", int "thSCD2", bool "isse", bool "planar")

在运动补偿下进行时域降噪。先前帧和后续帧的画面,在进行对当前帧的运动补偿后,将会在SAD控制的权值因子下进行画面平均操作[average]。这个函数支持像素遮盖[overlapped blocks]模式。遮盖区块[overlapped blocks]以window block summation的方式来处理(类似FFT3DFilter的处理方式),以此来降低画面产生块状的副作用[blocking artefact]。

MDeGrain1的时域范围为1,即使用对前一帧和后一帧的运动矢量。MDeGrain2的时域范围为2,使用前面两帧和后面两帧的运动矢量。MDegrain3同理。使用的时域参考范围越广,处理速度越慢,但是效果越好(降噪力度更强)。

super:MSuper函数生成的“super”画面。

mvbw,mvfw:由MAnalyse函数生成的向后[backward]和向前[forward]的运动矢量信息。

thSAD:这个参数用来指定SAD阈值。对于SAD值超过thSAD的区块,在平均[average]处理中的权值为0。低SAD值的运动补偿区块的权值更高。权重的其他部分从源画面中取得。输入的thSAD值必须是根据8x8区块大小进行放缩。(译者注:当区块改为4x4时,应该使用1/4大小的thSAD值)如果thSAD值设定过低,那么可能会得到断断续续[staggered]的降噪结果;如果设定过高,则会产生鬼影[ghosting]等副作用。默认值为400。

thSADC:在色度平面使用的SAD阈值。默认值与thSAD相等。如果输入了这个参数,则thSAD用于亮度平面,thSADC用于色度平面。

plane:设定处理的平面。
plane=0:只处理亮度平面Y。
plane=1:只处理色度平面U。
plane=2:只处理色度平面V。
plane=3:处理UV两个色度平面。
plane=4:处理全部平面。
默认值为4。

limit:亮度平面的最大像素值改变量限制。(类似于DeGrainMedian插件和SSETools插件中的LimitChange函数,用来减小副作用。)默认值为255,即无限制。

limitC:色度平面的最大像素值改变量限制。默认值等于limit。


MRecalculate:
MRecalculate (clip super, clip vectors, int "thSAD", int "smooth", int "blksize", int "blksizeV", int "search", int "searchparam", int "lambda", bool "chroma", bool "truemotion", int "pnew", int "overlap", int "overlapV", string "outfile", int "dct", int "divide", int "sadx264", bool "isse")

使用不同的“super”,或者不同的MAnalyze参数来对先前计算得出的运动矢量进行精炼运算[refine],使其质量更高。进行多次矢量运算,能够使运动侦测具有更强的稳健性[stable or robust]。精炼运算将只会在最精细的level画面上进行。函数将通过对旧运动矢量进行插值处理,然后作为进行新运动矢量侦测的预测值。同时SAD也会被重新计算。只有超过SAD阈值thSAD的区块会被重新侦测。输入的thSAD应当以8x8大小的区块为基准,手动进行放缩。默认值为thSAD=200。高质量运动矢量将不会被调整,但是SAD值将会被替换为新值。

smooth:这个参数用来指定粗糙(大)区块切分为较小区块的方法。0表示使用最近区块的运动矢量。1表示以四周相邻的区块进行双线性插值[bilinear interpolation]。默认值为1。

其他参数与MAnalyse中的含义相同。默认值与MAnalyse的参数默认值相同。
上次由 Acciente 在 2016-07-01 9:49,总共编辑 6 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

示例

2016-06-28 23:22

III)示例

显示运动矢量(向前):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
vectors = MSuper().MAnalyse(isb = false)
MShow(vectors) # 源通过last变量隐式传递到MShow

显示运动矢量(向后):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
vectors = MSuper().MAnalyse(isb = true)
MShow(vectors)

使用 MMask:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
vectors = MSuper().MAnalyse(isb = false)
MMask(vectors)

与Depan插件一起使用MDepan来处理交错视频(DepanStabilize函数示例):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
AssumeTFF().SeparateFields() # 设定正确的场序
vectors = MSuper().MAnalyse(isb = false)
globalmotion = MDepan(vectors, pixaspect=1.094, thSCD1=400)
DepanStabilize(data=globalmotion, cutoff=2.0, mirror=15, pixaspect=1.094)
Weave()

配合occlusion mask通过运动补偿对画面的块状区域进行柔化处理:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
super = MSuper()
vectors = MAnalyse(super, isb = false)
compensation = MCompensate(super,vectors) # 或者使用MFlow函数
# 用高强度的柔化[blur]或者去区块[deblock]函数生成一个柔化画面
blurred = compensation.DeBlock(quant=51) # 在这里使用一个去区块函数[deblock]
badmask = MMask(vectors, kind = 2, ml=50)
overlay(compensation,blurred,mask=badmask) # 或者使用MaskTools中更快速的MaskedMerge函数

用MFlowInter重新生成源里面烂掉的帧:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
super = MSuper()
backward_vectors = MAnalyse(super, isb = true, delta=2)
forward_vectors = MAnalyse(super, isb = false, delta=2)
inter = MFlowInter(super, backward_vectors, forward_vectors, time=50, ml=70)
# 假设第50和第60帧是烂帧
trim(0,49) ++ inter.trim(49,-1) \
++ trim(51,59) ++ inter.trim(59,-1) ++ trim(61,0)

通过MFlowFps改变帧率:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
# assume progressive PAL 25 fps source
super = MSuper(pel=2)
backward_vec = MAnalyse(super, isb = true)
forward_vec = MAnalyse(super, isb = false)
MFlowFps(super, backward_vec, forward_vec, num=50, den=1, ml=100) # 得到50fps

进行面向实时播放的帧率倍增处理:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
# 假设源为逐行的 PAL 25 fps 或 NTSC Film 23.976
super = MSuper(pel=1,hpad=0,vpad=0,chroma=false)
backward_vec = MAnalyse(super, blksize=32, isb = true, chroma=false, searchparam=1,search=0)
forward_vec = MAnalyse(super, blksize=32, isb = false, chroma=false, searchparam=1,search=0)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0)

进行最佳质量的帧率倍增处理(运算速度较慢):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
# 假设源为逐行的 PAL 25 fps 或 NTSC Film 23.976
super = MSuper(pel=2)
backward_vec = MAnalyse(super, overlap=4, isb = true, search=3)
# 使用区块覆盖[block overlap],半像素精度以及全面搜索
forward_vec = MAnalyse(super, overlap=4, isb = false, search=3)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last))

使用MFlowBlur生成高质量的运动模糊效果:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
super = MSuper()
backward_vectors = MAnalyse(super, isb = true)
forward_vectors = MAnalyse(super, isb = false)
MFlowBlur(super, backward_vectors, forward_vectors, blur=15)

使用外部滤镜进行降噪(需要3帧,上一帧、当前帧、下一帧):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
super = MSuper()
backward_vectors = MAnalyse(super, isb = true)
forward_vectors = MAnalyse(super, isb = false)
forward_compensation = MFlow(super, forward_vectors, thSCD1=500) # or use MCompensate
backward_compensation = MFlow(super, backward_vectors, thSCD1=500)
# 生成交替出现的三帧序列
interleave(forward_compensation, last, backward_compensation)

DeGrainMedian() # 在这里使用你喜欢的时域(或空域-时域)降噪滤镜

selectevery(3,1) # 返回滤镜处理后的中心[central]画面(非运动补偿画面)

使用预处理画面进行更加可靠的运动侦测,然后在未预处理的画面上进行运动补偿(以降噪为预处理例子):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
# 使用降噪(柔化)或者去闪烁[deflicker]滤镜进行预处理
prefiltered = blur(1.0)
super = MSuper(levels=1) # 对于MCompensate一级就足够
superfilt = MSuper(prefiltered) # 对于MAnalyse使用全部的梯度画面
backward_vectors = MAnalyse(superfilt, isb = true)
forward_vectors = MAnalyse(superfilt, isb = false)
# 使用未预处理的画面进行运动补偿
forward_compensation = MCompensate(super, forward_vectors)
backward_compensation = MCompensate(super, backward_vectors)
# 生成交替出现的三帧序列
interleave(forward_compensation, last, backward_compensation)

DeGrainMedian() # 在这里使用你喜欢的时域(或空域-时域)降噪滤镜

selectevery(3,1) # 返回滤镜处理后的中心[central]画面(非运动补偿画面)

在亚像素精度和包含区块覆盖[overlapped blocks]下使用MDegrain2进行降噪:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
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)

在亚像素精度和包含区块覆盖[overlapped blocks]下使用MDegrain1对交错视频进行降噪:
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
fields=AssumeTFF().SeparateFields() # or AssumeBFF
super = MSuper(fields)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=2)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=2)
MDegrain1(fields, super, backward_vec2,forward_vec2,thSAD=400)
Weave()

用MDegrain2i2函数对交错视频进行降噪:
function MDegrain2i2(clip source, int "overlap", int "dct")
{
overlap=default(overlap,0) # 重叠值[overlapped value] (在blksize=8下可取0-4)
dct=default(dct,0) # 对轻微闪烁的源使用dct=1
fields=source.SeparateFields() # 拆分场
super = fields.MSuper()
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=overlap, dct=dct)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=overlap, dct=dct)
backward_vec4 = super.MAnalyse(isb = true, delta = 4, overlap=overlap, dct=dct)
forward_vec4 = super.MAnalyse(isb = false, delta = 4, overlap=overlap, dct=dct)
fields.MDegrain2(super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
Weave()
}

AVISource("video.avi")
mdegrain2i2(4,0)

使用外部亚像素精度插值画面的示例:
# 加载使用边缘检测插值功能的Eedi2插件(by tritical)
LoadPlugin("Eedi2.dll")
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
# 生成一个扩大采样(放大)的画面
ups = EEDI2(field=1).LanczosResize(2*width(last), 2*height(last), src_left=0.25)
super = MSuper(pel=2, pelclip=ups)
bv = MAnalyse(super, isb = true, overlap=4)
MCompensate(super, bv)

如何使用MT插件以及特殊的多线程AviSynth:
# 加载MT插件(by TSP)
LoadPlugin("MT.dll")
avisource("some.avi")
MT("""
super = MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
""",2) # 2线程

注意:在MVTools v1.8.4.1版本以后,支持多线程AviSynth的SetMTMode(2)模式。版本2的MVTools在运行时会更稳定。与SetTMTMode相同的示例:
SetMTMode(5)
FFmpegSource("some.avi") # avisource在我的电脑上没法与SetMTMode一起运行(原作者)

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)

使用预处理画面对源画面的运动矢量进行精炼[refine](以MFlowFPS为示例):
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
prefiltered = DeGrainMedian() # 一些平滑化处理
super = MSuper(hpad=16, vpad=16, levels=1) # 对于MRecalculate只需要一级画面
superfilt = MSuper(prefiltered, hpad=16, vpad=16) # 对于MAnalyse需要所有的梯度画面
backward = MAnalyse(superfilt, isb = true, blksize=16)
forward = MAnalyse(superfilt, isb = false, blksize=16)
# 以其他区块大小对原运动矢量进行重算
forward_re = MRecalculate(super, forward, blksize=8, thSAD=100)
backward_re = MRecalculate(super, backward, blksize=8, thSAD=100)
MFlowFps(super, backward_re, forward_re, num=50, den=1)

使用planar参数进行对YUV2画面的加速处理:
LoadPlugin("SSEToolsS.dll") # 为了转换函数
AVISource("c:\test.avi") # 或者 MPEG2Source,DirectShowSource,或是前面的处理结果等
Interleaved2Planar() # 将画面转化为planar形式
super = MSuper(planar=true)
bv1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
fv1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
bv2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
fv2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
bv3 = MAnalyse(super, isb = true, delta = 3, overlap=4)
fv3 = MAnalyse(super, isb = false, delta = 3, overlap=4)
MDegrain3(super,bv1,fv1,bv2,fv2,bv3,fv3,thSAD=400,planar=true)
Planar2Interleaved() # 将画面由planar转回普通的YUY2
上次由 Acciente 在 2016-06-30 21:50,总共编辑 3 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

声明

2016-06-28 23:23

IV)声明

这个插件以GNU GPL协议发布,不包含任何的保证。请查看“gpl.txt”。
文档以CreativeCommons BY-SA 3.0协议发布。(本翻译文档遵循相同协议。)

请考虑捐助。

MVTools使用了以下工程的部分代码:
Tom Barry的SimpleResize AviSynth插件中的Resizer(SimpleResize.cpp)。http://www.trbarry.com
XVID MPEG-4 VIDEO CODEC中的Fast DCT(fdct_mmx.asm)。http://www.xvid.org
FFTW library中的DCT general transform(详见fftwlite.h)。(作为dll引用)http://www.fftw.org
x264工程中的SATD(pixel-32.asm,pixel.asm)以及SADx264(sad-a.asm,x86inc.asm,x86inc-32.asm,cpu-32.asm)。http://www.videolan.org/developers/x264.html (Loren Merritt, Laurent Aimar, Alex Izvorski et al)
上次由 Acciente 在 2016-06-30 21:50,总共编辑 2 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

版本修订

2016-06-28 23:23

V)版本修订

2.5.11.22 (26.04.2016 by Fizick)

MflowXXX: aligned to fix strange bug for some odd frame sizes and pel=1.
2.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.
2.5.11.20 (02.04.2016 by Fizick)

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.
2.5.11.3 (19.09.2011 by Fizick)

MFlowInter: fixed planar.
MCompensate: fixed destructor for recursion.
2.5.11.2 beta (20.03.2011 by Fizick)

MCompensate: fixed crash with too small npad, vpad (thanks to '-Vit-'). Optimized MFlow.
2.5.11.1 beta (22.12.2010 by Fizick)

MAnalyse, MRecalculate: fixed pure Horizontal and Vertical search types (fix by 'cretindesalpes').
2.5.11 beta (17.10.2010 by Fizick)

MAnalyse, MRecalculate: added pure Horizontal and Vertical search types (requested by 'Null Null').
MRecalculate: Fixed Hexagon and UMH search types (was processed as Logarithmic).
2.5.10.1 beta (25.06.2010 by Fizick)

MFlowInter: Fixed incorrect transmission of last parameters (blend, etc). Thanks to Laurent de Soras 'Firesledge'. Other interesting updates (dither, time clip, multitheading, multivector) from his MVTools 2 mod16 fork (http://ldesoras.free.fr/prod.html) are under consideration.
MDepan: Fixed bug : if range=1 in MDepan, the debug text (with info=true) was only displayed in the first frame when loading the script. Thanks Boulder for report.
MRecalculate: Fixed bug if pel values are different. Thanks Boulder for report.
2.5.10 beta (8.11.2009 by Fizick)

MAnalyse: try many predictors
MAnalyse: replace third right-top predictor by right-bottom
MAnalyse: exhaustive search at all coarse levels (always), removed full parameter
2.5.9 (4.11.2009 by Fizick)

MAnalyse: restored lambda for coarsest level)
MAnalyse: fixed full=0 default according to doc
2.5.8.1 (26.10.2009 by Fizick)

MDegrain2: fixed limitC (thanks Terranigma for bug report)
2.5.8 (18.10.2009 by Fizick)

MAnalyse: fixed some wrong vectors (thanks to shon26 for bug report)
2.5.7 (09.10.2009 by Fizick)

MAnalyse: fix bug (crash for some frame sizes) (thanks to Mark bug report)
2.5.6 (08.10.2009 by Fizick)

MAnalyse: fix bug (crash for pad>0 and some frame sizes) with levels (thanks to Mark bug report)
2.5.5 (28.09.2009 by Fizick)

MAnalyse: fix bug (crash for hpad=0) with levels (thanks to Boulder and LaTo for bug report)
MSuper: corrected interpolation at planes borders
MDegrain1,2,3: added limitC parameter
2.5.4 (27.09.2009 by Fizick)

MAnalyse: set default temporal=false according to doc (some problem with SetMTMode(2) was reported by MAG79)
2.5.3 (08.09.2009 by Fizick)

MAnalyse: added temporal predictor of motion vector
MRecalculate: fixed broken v2.5.2
2.5.2 (11.08.2009 by Fizick)

MSuper: separable width and height reducing with assembler iSSE optimization
MAnalyse: limit levels value
2.5.1 (07.08.2009 by Fizick)

MAnalyse: Added meander parameter for blocks scan in rows from left to right and from right to left
Small optimization of YUY2 conversion
2.5.0 (01.08.2009 by Fizick)

MSuper: More full size of sublevels
MAnalyse: Increased number of sublevels (for more long vectors)
MAnalyse: Replaced parameter name level by levels, changed meaning of its positive and negative values
MAnalyse: Disabled lambda for most coarse level
MAnalyse: Full search with large radius at smallest level
2.4.7 (28.07.2009 by Fizick)

MBlockFPS: finally fixed bug for non-zero pad, non-integer number of blocks
2.4.6 (26.07.2009 by Fizick)

MBlockFPS: fixed bug (at right and bottom, repored by Shon26) for non-zero pad, non-integer number of blocks
Fixed possible bug with pixels interpolation at low hierarhical levels
More correct size of sublevels (even luma for YV12)
MShow: change draw vector style to gradient
2.4.5 (11.07.2009 by Fizick)

Added block size 32x32
Replaced avisynth.h with v2.5.8MT by SEt
2.4.4 (08.07.2009 by Fizick)

Merged all code mods by SEt, but:
Replaced avisynth.h v2.5.5 by v2.5.8
2.4.2_mod2 (30.06.2009 by Pavel Skakov aka SEt)

Corrected threading problems, minor optimizations (avisynth.h from avisynth2.5.8MT beta, init vectors as 0)
2.4.2_mod (22.06.2009 by Pavel Skakov aka SEt)

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:

added Average2 iSSE version for pel=4,
Degrain1/2/3 MMX and SSE2 versions,
small optimization of copy8x8 mmx and Horizontal_Wiener SSE,
fixed cpu detection
2.4.3 beta (26.04.2009 by Fizick)

MDepan: added mask (requested by djonline) and planar parameters.
2.4.2 (07.04.2009 by Fizick)

MAnalyze: Fixed valid vector range for case of padding lesser than block size, with program crash (thanks to FuPP for bug report).
2.4.1 beta (24.01.2009 by Fizick)

MDegrain: Fixed weight for high threshold and big block size.
2.4.0 beta (09.01.2009 by Fizick)

MDegrain: Changed degrain weight method to more strong, some internal rewriting.
Fixed documentation.
2.3.1 (14.12.2008 by Fizick)

MSuper: added more smoothing reducing filters rfilter=2,3,4, by default 2.
MAnalyse: fixed bug with plevel parameter (version 2.3.0).
2.3.0 (6.12.2008 by Fizick)

Renamed all functions from MVxxx to Mxxx (some renaming was requested by LaTo, Mystery Keeper, Sagekilla). Error messages is still not updated.
MAnalyse: added pglobal parameter (with small changes), changed default level=1.
2.2.2 (30.11.2008 by Fizick)

MVShow: changes SAD by reduced to block size 8x8, added quantity of bad blocks.
MVCompensate: fixed bug at scene changes (thanks to AVIL for bug report about YUY2).
MVAnalyse: fixed chroma=false (thanks to LaTo for bug report).
Renamed to mvtools2.dll (requested by Naito).
2.2.1 (27.11.2008 by Fizick)

MVAnalyse: fixed wrong scaling of LSAD to block size (thanks to Shon for bug report).
MVCompensate: removed mode parameter, added recursion.
2.1.2 (23.11.2008 by Fizick)

MVAnalyse: removed option mc. Reduced size of block data (increment version of vector stream).
MVDegrain: fixed bug with block size 32x16
2.1.1 (18.11.2008 by Fizick)

MVBlockFps: fixed left border bug
2.1.0 (8.11.2008 by Fizick)

MVFlowFps, MVBlockFps, MVFlowInter: added blend parameter for ChangeFps-like mode at scene changes
MVFlowFps, MVBlockFps: more safe for big nominator and denominator.
2.0.11.2 (6.11.2008 by Fizick)

MVDegrain2,3: fixed crashes at scene changes for YUY2
2.0.11.1 (5.11.2008 by Fizick)

MVAnalyse: added second wide search for bad blocks (badSAD, badrange parameters).
MVAnalyse: added Hexagon and Uneven Multi Hexagon (UMH) search types. Changed (not intentionally :) the default method from Logarithmic to Hexagon.
MVAnalyse: fixed exhaustive search to static center.
MVAnalyse: lsad is now scaled to blksize 8.
MVShow: use super clip, padded output, added number block option.
2.0.9.2 (3.11.2008 by Fizick)

Some performance improving
2.0.9.1 (20.10.2008 by Fizick)

More memory-optimal MVFlowXXX functions for pel=1
Disabled plugin debug mode
Added Russian documentation
2.0.9.0 alpha (13.10.2008 by Fizick)

Implemented more functions without idx: MVSCDetection, MVDepan, MVFlowInter, MVBlockFps, MVFlowBlur, MVDegrain3, MVRecalculate
Fixed crashes with MVSuper(chroma=false)
Some small changes and fixes for v2.0 of course :)
Documentation for v2.0
2.0.7.0 alpha (02.10.2008 by Fizick)

Implemented functions without idx: MVSuper, MVAnalyse, MVFlowFps, MVFlow, MVCompensate, MVShow, MVMask, MVDegrain1, MVDegrain2
All functions (besides MVAnalyse) got planar parameter for YUY2 planar input and output. Default = false (i.e. normal interleaved YUY2), slower.
All (mandatory) clip parameters lost their names, and mvbw=vb is not correct syntax now. Use unnamed syntax instead.
2.0.0.3 alpha (28.09.2008 by Fizick)

First 2.0 branch public alpha with MVSuper function to kill idx.
MVAnalyse and MVDegrain1 are implemented only.
1.11.4.4 (15.10.2008 by Fizick)

Restore old internal cache size growing as before v1.11.4.2 (some crashes reported).
1.11.4.3 (08.10.2008 by Fizick)

MVDenoise: fixed error of v.1.11.4 with luma correction.
MVCompensate: fix potential memory leakage (in constructor).
1.11.4.2 (26.09.2008 by Fizick)

MVAnalyse: cut unused compensation memory space from vector clip (mc parameter).
Decreased internal cache size growing.
All MVFlow functions: fixed old bug with pixels for pel=4.
MVAnalyse: added rfilter parameter (smooth method).
MVBlockFps: added YUY2 and pelclip support.
Tiny stability fixes for MT.
1.11.0.1 beta (08.09.2008 by Fizick)

New MVBlockFps for simple fps change (almost realtime :-).
MVAnalyse: more smooth method of frame hierarchical level reducing (like ReduceBy2) for smoothing at every level.
MVAnalyse: Added pzero parameter of zero vector cost for more coherent motion vectors (now switched ON by default, set to 0 if you need in old algo).
MVAnalyse: Decreased pelsearch internal clipping from pel to 1 (asked by somebody for speed).
MVFlowFps,MVFlowFps2, MVFlowInter: removed thSAD parameter.
All functions: Removed mmx parameter.
1.10.2.1 (28.08.2008 by Fizick)

MVDegrain1-3: fixed old rounding error resulted in some chroma tint (some thanks to Didee for bugreport, but it could be more persevering in official MVTools forum thread :)
Made doc about pelclip more accurate (hopely).
1.10.2.0 beta (27.08.2008 by Fizick)

Debugged and renamed MVRefine back to new MVRecalculate :).
MVAnalyse: changed LSAD threshold from hard by soft for a little more coherent motion at bad areas.
MVAnalyse: fixed old bug for (rarely used) different horizontal and vertical overlap sizes.
1.10.1.0 not public (22.08.2008 by Fizick)

Change MVRecalculate by more general function (MVRefine) which can re-estimate vectors.
1.10.0.0 not public (18.08.2008 by Fizick)

Added MVRecalculate function to update SAD (as requested by Didee).
Fixed possible memory leaks (thanks to josey_wells for note)
Other changes of v1.9.6-1.9.7 branch by josey_wells are still not merged - too many work to analyse new code and numerous cosmetic rewriting, so based on v1.9.5.7
1.9.6.x-1.9.7.x series branch (01.08.2008-26.08.2008 by josey_wells)

Added MVAnalyseMulti, MVDegrain, MVMultiExtract functions with internal multitheading (that does not require any special AviSynth, SetMTMode or MT)
Some bug fixes (memory leaks), code consolidation (rewriting) for stability and performance improvements. Also there is a multitude of changes due to the addition of threading class, semaphore class, critical section class, thread files for MVDegrain, MVAnalyseMulti as well as factoring out common code for MVDegrain into a single base class moving out common code etc. There are no changes of algorithms. See messages at forum since August 2008 for download, syntax and discussion.
1.9.5.7 public beta (03.07.2008 by Fizick)

Fixed Overlap_2xY_mmx
Added (incomplete?) list of used projects to doc.
1.9.5.6 (02.07.2008 by TSchniede)

Improved my, added Overlap_2xY_mmx, optimized CheckMV2 and LumaSAD.
1.9.5.5 (28.06.2008 by TSchniede)

Improved default 2xY SAD and added new faster 2xY SAD.
1.9.5.4 (27.06.2008 by TSchniede)

Ported CPU detection from x264.
Now using x264 SAD autoddetect is default
Merge with 1.9.5.1, re-enabled 32x16 mode (only default functions)
1.9.5.3 (26.06.2008 by TSchniede)

Imported SSD and SATD functions.
access using sadx264 > 7 or dct > 4.
1.9.5.2 (24.06.2008 by TSchniede)

Buffered source block in aligned area before calculating SAD.
This fixes crashes if source block was unaligned due to overlaped blocks.
Worst case was < 1% slower, most of the time it further increases performance.
1.9.5.1 public beta (21.06.2008 by Fizick)

Merge v.1.9.5 changes by TSchniede.
1.9.5 (21.06.2008 by TSchniede), based on v.1.9.3

MVAnalyse: added sadx264 option.
Internal modifications - aligned memory of luma&chroma planes and modified MVTools to the interface of the SAD functions used in x264.
minor bugfix (deactivate DebugPrint possible)
1.9.4.1 beta (12.06.2008 by Fizick, released 21.06.2008)

Fixed bug for pel=4 with sharp=2 (thanks to Pustovetov for report and fix).
MVCompensate: added block size 16x2 (bug reported by AVIL).
1.9.4 not public beta (08.06.2008 by Fizick)

MVAnalyse and other: added block size 32x16 (requested by MAG79).
1.9.3.1 (05.06.2008 by Fizick)

MVIncrease: was broken (as noted by MAG79).
1.9.3 (20.04.2008 by Fizick)

MVAnalyse: fixed bug for pelclip (broken since v1.8.5).
MVDegrain: added thSADC as chroma threshold (request by Terranigma).
1.9.2 (29.01.2008, all bugs were found by josey_wells)

MVDegrain3: fixed bug in code for 16x8 block; fix typo (MVDegrain2 instead of MVDegrain3).
MVAnalyse: fixed old bug in NStepSearch.
1.9.1 beta (15.12.2007 by Fizick)

MVAnalyse: Increased speed (by 20%) of global motion estimation (other algo).
MVAnalyse: Added assembler optimization for small blocksizes SAD (speed by 50%).
MVMask: Added kind=5 motion colormap as x,y components of motion vector shown in U, V color planes.
1.9.0 (04.12.2007 by Fizick)

Added MVDegrain3.
1.8.6 (02.12.2007 by Fizick)

Added components x,y motion vector mask kind=3,4 to MVMask (requested by Terka).
1.8.5.1 (12.11.2007 by we:)

Merge v1.8.4.3 and v1.8.5 changes, added MT example.
1.8.4.3 (05.10.2007 by Tsp)

Implemented internal cache buffer miss detection with buffer growing (as suggested by IanB).
1.8.5 (05.11.2007 by Fizick)

Added pelsearch parameter as search parameter (radius) at finest level (request by Terranigma).
Decreased internal buffer to decrease memory usage, with some changes in critical sections.
Added block size 16x2 (requested by ab_99).
1.8.4.2 (25.10.2007 by Tsp)

Added critical section in frame refining to fix rare bug in multi-threaded processing.
1.8.4.1 (23.10.2007 by Tsp)

Implemented thread-safe internal buffer access for correct multithreaded processing with SetMTmode(2) in Avisynth MT version (for multi CPU).
1.8.4 (22.08.2007 by Fizick)

"divide" now works with "overlap".
1.8.3 (17-20.08.2007 by Fizick)

MVFlowFps: renamed "mode" parameter to "mask".
MVFlowFps2: added "mask" parameter.
MVFlowFPS, MVFlowFPS2: Restored default values num=25, den=1 (as was in version 1.7 and early)
MVDegrain1, MVGegrain2 - added "limit" parameter.
1.8.2 beta (30.07.2007 by Fizick)

MVAnalyse: corrected (increased) search radius at finest level for pel>1.
Added pel=4 option for quarter pixel precision.
Renamed clip2x parameter to pelclip.
1.8.1 beta (28.06.2007 by Fizick)

MVAnalyse: added postrocessing motion vectores by dividing blocks into subblocks to decrease zone of motion vectors interpolation.
MVFlowFps: added "mode" parameter to select processing method at occlusion areas (and speed).
Some internal changes (padding in MVAnalysisData, header to vector stream frames, etc).
1.8.0 beta (22.06.2007 by Fizick)

MVFlowInter, MVFlowFPS, MVFlowFPS2, MVMask: improved occlusion mask by extent
MVFlowInter, MVFlowFPS: decreased objects halo at occlusion areas by using motion vectors of adjacent frames
MVFlowInter, MVFlowFPS: disabled SAD mask and thSAD parameter
MVShow: fixed drawn positon of vectors
MVFlowFPS, MVFlowFPS2: Changed default output fps to double of input (default num, den = 0)
Added error messages on missed vector clips
1.7.0 beta (05.06.2007 by Fizick)

MVAnalyse: added blksizeV and overlapV parameters for non-square blocks 8x4 and 16x8.
1.6.4 (30.05.2007 by Fizick)

MVAnalyse: modified vectors order for Enhausted search (expanding squares).
MVAnalyse: fixed bug with dct=3.
MVFlowFps, MVFlowFPS2, MVFlowInter: now blend frames with bad motion estimaton (at scenechanges, flashes).
MVFlowFps, MVFlowFPS2: fixed bug with thSAD parameter (and correspondent mask).
1.6.3 (06.05.2007 by Fizick)

MVDepan: more compatible with DepanEstimate (range parameter, etc).
1.6.2 (11.11.2006 by Fizick)

MVAnalyse: changed DCT=2 mode to global luma dependent.
1.6.1 beta (25.10.2006 by Fizick)

MVAnalyse: added experimental DCT mode to improve motion estimation at luma flicker and fades (fast for blksize=8 only).
1.5.8 beta (14.10.2006 by Fizick)

Many functions: added clip2x parameter to use 2X upsampled clip instead of internal subpixel interpolation for pel=2
MVFlowFps, MVFlowFps2: added thSAD parameter; use local blending of neighbour frames pixels in regions with bad motion vectors
MVFlowFps, MVFlowFps2: may use motion vectors for any frames delta
MVFlowFps, MVFlowFps2: fixed a bug for video with big nominators and denominators (thanks to Trixter for report)
MVCompensate: added experimental fields parameter to compensate fields shift of fieldbased video for pel=2
MVAnalyse: changed pnew parameter to relative of SAD
1.5.3 beta (01.10.2006 by Fizick)

MVAnalyse: improved zero motion estimation for fieldbased video for pel=2
Merged v1.4.12-1.4.13 changes
Temporary restored MVIncrease, MVChangeCompensation, MVDenoise (with compensation stored in vector clip)
1.5.1 beta (05.09.2006 by Fizick)

Merged v1.4.11 changes
1.5.0 beta (23.08.2006 by Fizick)

Corrected vector predictors interpolation (from coarse to fine scale) for overlap>0.
MVFlowInter: added thSAD parameter.
MVFlowInter: local blending of neighbour frames pixels in regions with bad motion vectors.
Removed compensation storage in vector clip
Removed functions MVIncrease, MVChangeCompensation, MVDenoise (it used compensation in vector clip, and did not support overlapping).
Removed mode=2 loop option of MVCompensation, mode=0 is processed as mode=1 now.
Added thSAD parameter to MVCompensation for safe (dummy) compensation as requested by Didee
1.4.13 (28.09.2006 by Fizick)

Fixed bug with possible wrong frames pointers in core (MVClip.Update), hided by caching (thanks to IanB for advice)
1.4.12 (25.09.2006 by Fizick)

Seems fixed bug with frames caching in MVDenoise (and possible in MVDegrain) (thanks to il9ad for report)
1.4.11 (06.09.2006 by Fizick)

Corrected vector predictors interpolation (from coarse to fine scale) for overlap>0.
Fixed bug with pitch for overlap=0, YV12 in MVDegrain1 (thanks to Boulder for report)
1.4.10 (18.08.2006 by Fizick)

Corrected right and bottom borders processing in MVCompensate for arbitrary frame sizes.
Changed defaults in MVAnalyse: pel=2, truemotion=true, sharp=2.
1.4.9 (14.08.2006 by Fizick)

Fixes a bug in MMX optimization of overlap mode in MVDeGrain, MVCompensate for YUY2 with blksize=8 (thanks to TSchniede for report).
1.4.8 (31.07.2006 by Fizick)

Added some MMX optimization of overlap mode in MVDeGrain, MVCompensate.
Fixed a bug with last (not processed) rows in MVDeGrain.
1.4.7 (25.07.2006 by Fizick)

Decreased overlap gridness in MVDeGrain1, MVDeGrain2, MVCompensate.
Added example with MVDeGrain1 for interlaced.
1.4.6 (24.07.2006 by Fizick)

Decreased denoising in MVDeGrain1, MVDeGrain2.
Plane parameter in MVDeGrain1, MVDeGrain2 now works :)
1.4.5 (22.07.2006 by Fizick)

Added plane parameter to MVDeGrain1, MVDeGrain2.
1.4.4 (19.07.2006 by Fizick)

Corrected default thSAD=400 in MVDeGrain1, MVDeGrain2.
Fixed a bug with V color plane in MVChangeCompensate.
1.4.3 (17.07.2006 by Fizick)

Decrease overlap gridness in MVDeGrain1, MVDeGrain2.
1.4.2 (16.07.2006 by Fizick)

Fixed a memory access bug in MVDeGrain1, MVDeGrain2. Thanks to krieger2005 for report.
1.4.1 (23.06.2006 by Fizick)

Changed MVDeGrain1, MVDeGrain2 mode to SAD weigthing.
Chanded thSCD1 default from 300 to 400.
1.4.0 (19.06.2006 by Fizick)

Added MVDeGrain1, MVDeGrain2 limited averaging denoisers.
Corrected thSAD scale in MVDenoise.
Corrected documentation about SAD.
1.3.1 (11.06.2006 by Fizick)

Added bicubic subpixel interpolation method for pel=2 (with iSSE optinization for sharp=1,2).
Assembler iSSE speed optimization for overlapped block compensation.
1.3.0 (05.06.2006 by Fizick)

Implemented overlapped block motion compensation to MVCompensation(mode=1).
Changed default to mode=1 in MVCompensation as the most universal.
Added sharp subpixel interpolation method for pel=2.
Fixed bug for blksize=16 with YUY2.
(To-do list: assembler SSE speed optimization for new compensation and interpolation methods.)
1.2.6 beta (21.05.2006 by Fizick)

Added option to write motion vectors data to log file as requested by Endre.
1.2.5 (08.05.2006 by Fizick)

Decreased zero vector weight, iteration accuracy in MVDepan
1.2.4 (07.04.2006 by Fizick)

Fixed bug v.1.2.3 with info mode in MVDepan
1.2.3 (31.03.2006 by Fizick)

Implemented MVDepan for interlaced source separated by fields;
added optional MVDepan log file.
1.2.2 beta (01.03.2006 by Fizick)

Fixed frame shift bug of v1.2.1 with mmx YUY2 conversion (thanks to WorBry for bug report)
1.2.1 beta (20.02.2006 by Fizick)

Fixed bug of v1.2,
Speed restored,
mmx YUY2 conversion (from avisynth 2.6 function by sh0dan)
But it seems, overlap mode still does not work properly
1.2 beta (17.02.2006 by Fizick)

YUY2 format support (besides MVIncrease), no optimization
1.1.1 (16.02.2006 by Fizick)

Removed DeBlock and Corrector filters (will be separate plugins)
Documented old MVSCDetection function.
Cleaned project from unused source files.
1.1 (non-public build 9.01.2006 by Fizick)

Quite large revision (beta). New option for overlapped block motion estimation in MVAnalyse for usage in MVFlow, MVFlowInter, MVFlowFps for improved motion compensation.
Lookup tables for motion interpolation.
Small correction of displacement value in MVFlowFps2.
1.0.3 (Released 30.12.2005 by Fizick)

Fixed bug with displacement in MVFlowInter, MVFlowFps (introduced in v1.0.2).
1.0.2 (Released 28.12.2005 by Fizick)

Corrected value of displacement in MVFlow (a little).
1.0.1 (Released 24.12.2005 by Fizick)

Fixed memory leakage bug in MVAnalyse with global motion (thanks to AI for report).
Removed penalty for zero vector predictor in MVAnalyse (was introduced in v1.0).
Changed chroma=true as default in MVAnalyse.
1.0 (Released 29.11.2005 by Fizick)

I'm tired of long version numbers :). But the plugin is stil experimental :(.
Restored zero vector predictor in MVAnalyse.
Changed blur time scale in MVFlowBlur (100 is fully open shutter now) as Mug Funky requested.
0.9.13.3 (Released 27.11.2005 by Fizick)

Added global motion (simple method) vector predictor to MVAnalyse.
Vector search is skipped (for speed) if good predictor was found (with SAD < pnew).
Parameter scale in MVShow works properly now.
Disabled some debug and profiling info output (for speed increasing).
Changed default prec=1 (was 2) in MVFlowBlur.
0.9.13.2 (Released 22.11.2005 by Fizick)

Fixed bug in MVFlowFps, MVFlowFps2 for non-integer fps.
0.9.13.1 (Released 21.11.2005 by Fizick)

Fixed bug in MVFlowFps, MVFlowFps2, MVFlowInter, MVFlowBlur (introduced in v0.9.13).
Removed plen parameter from MVAnalyse as not useful.
0.9.13 (Released 20.11.2005 by Fizick)

Added truemotion preset to MVAnalyse.
Added experimental MVFlowFps2.
Change interpolated vector rounding method in all MVFLow... functions.
Edited documentation a little.
0.9.12.4 (Released 15.11.2005 by Fizick)

Changed type of ml parameter in MVMask, MVFlowInter, MVFlowFps from int to float.
Added bound check of ml, time, blur parameters.
Small possible bug fixed (emms).
Partially updated documentation. But I am not sure that sh0dan requested exactly such updating :). It is still not user guide but functions reference.
0.9.12.3 (Released 14.11.2005 by Fizick)

Fixed bug for chroma for width not divisible by 16 in MVMask (introduced in v0.9.11).
Some speed optimizing of MVFlowFps.
Reset size of internal frames buffer to original value 10. Try various versions.
0.9.12.2 (Released 13.11.2005 by Fizick)

Added experimental precise but slow MVFlowBlur function as scharfis_brain requested.
Temporary changed size of internal frames buffer to 5.
0.9.12.1 (Released 12.11.2005 by Fizick)

Added experimental MVFlowFps function.
Disabled MVInter function.
Temporary changed size of internal frames buffer from 10 to 3 for memory usage decreasing. Speed must be tested for complex scripts.
0.9.12 (Released 09.11.2005 by Fizick)

Added MVFlowInter function. MVInter function will be removed in next release (it is worse).
Changed scale of ml parameter for kind=2 of MVMask to more optimal default.
Fixed small bug in Bilinear.asm (strange pixels near right border for pel=2).
0.9.11.1 (Released 06.11.2005 by Fizick)

Added half-pel support to MVFlow.
Increased max quant from 51 to 60 in DeBlock for very strong deblocking .
Corrected documentation.
0.9.11 (Released 04.11.2005 by Fizick)

Improved MVMask: Replaced boolean showsad parameter to integer kind, added occlusion mask option. Changed bilinear resize code to more correct and fast SimpleResize.
0.9.10.1 (Released 01.11.2005 by Fizick)

Fixed bug with chroma and luma small changes in MVInter (rounding error).
Vector interpolation in MVFlow and mask in MVInter are correct now (due to fixing bug in SimpleResize).
0.9.10 (Released 31.10.2005 by Fizick)

Added some true motion (smoothed) estimation options to MVAnalyse
Added function MVFlow for per-pixel motion compensation
Added function MVInter for motion interpolation (very experimental)
0.9.9.1 (Released 20.01.2005 by Manao)

No need anymore of stlport_vcxxxx.dll
0.9.9

Filter added : Corrector
Filter added : MVIncrease
New available blocksize : 16
New parameter in MVAnalyse : chroma
Changes in the core
0.9.8.5

MVCompensate changed : a new parameter, idx, which works as idx in MVAnalyse, and which allows speed up when compensating the same frames several times.
0.9.8.4

ME takes into account the chroma now, as requested by tsp.
0.9.8.3

Added Corrector function, as requested by scharfi.
0.9.8.2

New function MVDepan (added by Fizick) for Depan plugin.
0.9.8.1

Several bugfixes
0.9.8

Yet another little changes in the filters' syntax. The core changed a lot, in order to gain speed were it was possible. However, by default, the speed gain won't be visible, you'll need to configure correctly the analysis filter through its "idx" parameter in order to gain speed ( in the mode "pel" = 2 ).
Bugfixes in MVDenoise, and chroma denoising in MVDenoise.
Now, the filters down the filter's chain tell to the analysis filter if they need the compensation, so you don't have to worry about that at the analysis stage.
0.9.7

Yet again, a lot of rewriting. Interpolating filters are disabled ( for the moment ), all the other filters work and should be considered as stable. Syntax has changed a lot, and will change again before reaching 1.0 ( if it's reached one day ). Changes mainly affect MVAnalyse. New filter : MVChangeCompensate.
0.9.6.2

Fixed bug in MVMask parameters.
0.9.6.1

Lot of bugfixes for the existing filters. MVMask, MVShow, MVCompensate, MVDenoise and MVSCDetection, and MVAnalyse should work . Other may crash unexpectedly.
Now, for the three new filters. Two have nothing to do with motion compensation, but I didn't want to put them in separate binaries, since they'll mainly be used with filters from this package. The third one uses vectors, and integrates somehow the two others.
QDeQuant(clip c, int quant, int level) : takes a clip and quantizes it, using an approximation of the H264 DCT. It filters the three planes ( 4x4 blocks for each of them, so the chroma isn't processed as in H264 ). It's not exactly the H264 DCT because at q1, it's lossless, and a q51 it's not that bad, but you can raise quant over 51. Level is the reference level of the picture. By default it's zero, but it can be set, for example, to 128. The picture is then treates as if pixels were ranging from -128 to 127, hence avoiding errors around 128.
Deblock(clip c, int quant, int aOffset, int bOffset ) : takes a clip, and deblock it using H264 deblocking, as if the picture was made only of inter blocks. This time, quant ranges from 0 to 51 as in H264, and has the same impact. aOffset and bOffset allow to raise / lower the quant when deciding for some internal thresholds. They are set by default to 0. Be warned that the filter should do nothing at quant lesser 16, if aOffset and bOffset are both zero. It's a wanted behavior ( thus it respect the partially the norm ).
EncDenoise(clip c, clip vectors, bool scbehavior, int quant, int aOffset, int bOffset, int thSCD1, int thSCD2) : it merges Deblock, QDeQuant and MVCompensate, taking from them the name and behavior of their parameters. It basically does a h264 encode as if all blocks were 8x8 inter blocks. Reference frame is the previous frame output by the filter ( if it is the correct one, else it's the previous frame of the source ), mvs are those given by mvanalyse on the source. The reference frame is compensated by the vectors, then the residual difference is quantized / dequantized and added to the result of the motion compensation. Finally, the frame is deblocked, and serves as reference for the next one.
0.9.5.3

Mainly a bugfixe ( several filters were affected by a silly bug , and MVCompensate now do padded motion compensation, and compensate also the chroma ( though it rounds the vector to odd coordinates to do so )
A new feature, as asked by Fizick, for mvcompensate : "scbehavior", a boolean set to true by default, will allow you to keep the previous frame over a scenechange if you set it to false.
0.9.5.2

MVMask has two new parameters : showsad (bool) which allows to build the mask of the SAD values instead of the mask of the vectors' length. Ysc allows you to set the value taken by the mask on scene changes
MVCompensate : behavior modification on scene changes. Now, the current frame is left untouched if a scene change was detected.
New filter : MVSCDetection, with one parameter, Ysc, which works as previously.
MVInterpolate, MVConvertFPS and MVBlur are enabled, but may be buggy ( though I wasn't able to make MVConvertFPS crash )
0.9.5

Huge rewritting of the core engine. Vectors are now searched with a precision up to the pixel ( because no other filters can use yet more precise vectors, except MVShow ). The search engine is now fast ( which doesn't mean necessarily that the filters which use it are fast )
A new parameter for MVAnalyse : lambda. See the documentation of the filter to see how it works
MVDenoise works better.
0.9.4

Vectors can be saved to a file. In order to do so, add the parameter filename="C:\foo.bar" to the filter MVAnalyse. If the file doesn't exist, vectors will be saved into it. If it exists, vectors will be read from it. But, be warned :
The file for a whole movie will be around 500 MB
Saving / reading from a file need for the moment a linear access to the frames, so it has to be used only when encoding the movie, not when doing random access in it.
The speed gain is not as great as one may hope, because SADs can't be saved ( it would take too much space ) and so have to be recomputed.
The filter MVDenoise now works on 5 frames, and its parameters are now "thT" and "sadT" ( have a look in the documentation to see how they work ). It works nice ( very good for heavy denoising )
The scene change detection thresholds have slightly changed. Now, a block has changed if its SAD it over thSCD1. The default for thSCD1 is 300, and for thSCD2 it is 130. It orks well ( better than the previous SCD engine ).
0.9.3

Last cleanings in the search of the motion vectors. It should be slightly faster
More search parameters can be set by the user, especially the search algorithm. See the documentation
Server / client implemented. You now first have to use MVAnalyse, and then the filter you want. Look at the documentation and at the examples I'll give alter.
MVCompensate is separated from MVShow ( it's more logic that way ). For the moment, it doesn't move the chroma ( same behavior as MVShow in the latest releases )
Some cleaning in MVBlur / MVInterpolate / MVConvertFPS, but still some work to do. Now, MVBlur blurs around the frame, not between the frame and the previous one.
Half of the work is done for writing vectors to a file. But the resulting file will be large ( around 500 MB - 1 GB I guess ).
MVDenoise is slightly faster ( at least it should )
Copies are optimized inside the filter, thanks to avisynth's copy functions.
MVShow can display the mean SAD of the compensation ( using showsad = true )
0.9.2.1

MVInterpolate makes its come back.
MVConvertFPS should work on the last few frames of the clip
0.9.2

MVInterpolate doesn't exist anymore.
MVBlur and MVConvertFPS have been improved. They also have got new parameters, have a look at the documentation.
MVShow gets back its compensate mode ( MVShow(cm = true) )
0.9.1 - 12.05.2004

First version renamed to MVTools.
0.1-0.6 Released 24.01.2004 - 01.04.2004 by Manao

First public versions MotionVectors (Motion.dll).
上次由 Acciente 在 2016-06-30 21:51,总共编辑 1 次。

头像
Acciente
帖子: 11
注册时间: 2016-06-28 23:11

VI)下载

2016-06-28 23:29

VI)下载

Fizick发布的最新版本:MVTools v2.5.11.22
http://avisynth.org.ru/mvtools/mvtools-v2.5.11.22.zip

上一版本:Download MVTools v2.5.11.20
http://avisynth.org.ru/mvtools/mvtools-v2.5.11.3.zip

早先版本:Download MVTools v2.5.11.3
http://avisynth.org.ru/mvtools/mvtools-v2.5.11.3.zip

Laurent de Soras的MVTools2 mod16 dither版本“Firesledge”:http://ldesoras.free.fr

你可以在论坛中找到64位的“非官方”版本。

旧1.x版本的文档与下载链接:http://avisynth.org.ru/mvtools/mvtools.html

MVTools v0.9.9.1可以在Manao的站点下载:http://manao4.free.fr/
上次由 Acciente 在 2016-06-30 21:52,总共编辑 1 次。

头像
angelcat
帖子: 90
注册时间: 2011-03-19 1:57

Re: MVTools2的doc中文译文

2016-06-28 23:32

吃了夏娜 {:doge}
小夜攪基QQ:1592537325

头像
jackyssion
帖子: 1
注册时间: 2016-04-12 5:46

Re: MVTools2的doc中文译文

2016-06-28 23:38

我什么都不知道
我只知道我需要占楼

回到 “AviSynth”