View Full Version : MaskTools 2.0a48
Pages :
1
2
3
4
5
6
7
8
9
10
11
12
[
13]
pinterf
12th February 2017, 21:13
pinterf
Native mode is broken: http://diff.pics/fJ6BMfn0glF4/1
Nice painting. What function/filter was used? Perhaps clip info, processor type (There are SSE4/SSE2 code paths, even C for non-mod16 leftovers)
pinterf
12th February 2017, 21:22
I try it in VirtualBox with winxp but can't load it by loadplugin(), will get error 0x3e6
and something else, b1 and a48 don't supports yv411 and if anyone work with ntsc dv will need to convert color format just for this, so can we have yv411 supports too?
O.K. yv411 is supported, even in the merge luma=true sse2 speedups. Regarding XP: a special build works under XP for me but I had to omit boost library (there is a conditional directive for this), I don't know what else is affected if I switch it off. Functions mt_infix and mt_polish are giving error message. But I will wait a bit more, to have other issues for a hotfix.
DJATOM
12th February 2017, 22:23
Nice painting. What function/filter was used? Perhaps clip info, processor type (There are SSE4/SSE2 code paths, even C for non-mod16 leftovers)
Sure, script:
v1=DGSource("I:\KEIJO_3\BDMV\STREAM\00001.dgi").ConvertBits(16)
v2=DGSource("I:\KEIJO_3\BDMV\STREAM\00000.dgi").ConvertBits(16)
mask=v1.masktools2_z_mt_edge("prewitt",u=3,v=3)
masktools2_z_mt_merge16(v1,v2,mask,true,false).ConvertToStacked()
Just random 2 videos, it doesn't matter.
Ah, I just renamed new dll to masktools2_z.dll for having old one. CPU - i5-4670k.
pinterf
12th February 2017, 23:10
Sure, script:
v1=DGSource("I:\KEIJO_3\BDMV\STREAM\00001.dgi").ConvertBits(16)
v2=DGSource("I:\KEIJO_3\BDMV\STREAM\00000.dgi").ConvertBits(16)
mask=v1.masktools2_z_mt_edge("prewitt",u=3,v=3)
masktools2_z_mt_merge16(v1,v2,mask,true,false).ConvertToStacked()
Just random 2 videos, it doesn't matter.
Ah, I just renamed new dll to masktools2_z.dll for having old one. CPU - i5-4670k.
Ahh, mt_edge is not yet for 16 bits, I think. I didn't have time to write proper error messages for all 8 bit-only filters to reject 10+ bit clips. 8 bit processing on 16 bit data, nice :)
pinterf
13th February 2017, 22:35
:goodpost:
just wonder, the existing script that use 0-255 range (in lut or other) will work in more than 8 bit? or we will need to edit hundreds of .avsi?
I was thinking of the problem, let's see a sample expression, that streches the range 16-235 to 0-255 for luma, and 16-240 -> 0-255 for the chroma.
8 bit: new_x = (x - 16) / 219 * 255, where 219 = 235-16
10 bit: new_x = (x - 64) / 876 * 1023 where 876= 940-64
16 bit: new_x = (x - 4096) / 56064 * 65535 where 56064 = 60160-4096
For an mt_lut/mt_lut16 the reverse polish expression is:
expr8 = "x 16 - 219 / 255 *"
expr10 = "x 64 - 876 / 1023 *"
expr16 = "x 4096 - 56064 / 65535 *"
Provided you have generic script, there are many ifs or conditional Evals.
New#1: With the next masktools version you can use a new #B (or #F) operator that autoscales a 8 bit value for the current bit depth
expr_luma = "x 16 #B - 219 #B / 255 #F *"
expr_chroma = "x 16 #B - 224 #B / 255 #F *"
New#2: You can use predefined constants in your expression script, the above sample can be written as:
expr_luma = "x ymin - ymax ymin - / range_max *"
expr_chroma = "x cmin - cmax cmin - / range_max *"
New constants I have implemented:
bitdepth: automatic silent parameter of the lut expression
range_half --> autoscaled 128 or 0.5 for float
range_max --> 255/1023/4095/16383/65535 or 1.0 for float
range_size --> 256/1024...65536
ymin, ymax, cmin, cmax --> 16/235 and 16/240 autoscaled.
And there are two autoscale operators:
#B Method: bit shifts (use this for YUV) e.g. "235 #B" -> always results in max luma
#F Method: full-span stretch e.g. x/255*65535 for 16 bit rgb)
other samples
expr = "x 40 #B +"
expr = "210 #B" # scale const 210!
expr = "x 16 #B - 219 #B / 255 #B *"
expr = "x ymin - ymax ymin - / range_max *"
expr = "x ymin - ymax ymin - / range_max * range_half 2 / +"
Opinions?
real.finder
14th February 2017, 07:37
pinterf, that seems good to me (but you should wait for others as I don't have many experiences with lut)
I see TheFluff said that vs expr (https://forum.doom9.org/showpost.php?p=1773737&postcount=36) is fast even in 8 bit, did you have look at expr (http://www.vapoursynth.com/doc/functions/expr.html)?
and another thing, cretindesalpes did mt_xxpand_multi.avsi back then, can this be in masktools.dll? I think this will be faster than what cretindesalpes did in .avsi
pinterf
17th February 2017, 09:55
I'm in the middle of porting lut functions for high bit depth, and had to do the realtime calculation for them, which is default when lut tables are too big (but nevertheless implemented optional 16 bit lutxy for hardcore x64 users with plenty of RAM :-) )
Now I know what a JIT could help speedwise, because realtime computing is really not a speed champion. Obviously using JIT would be the next logical evolution step.
TheFluff
18th February 2017, 15:07
https://github.com/vapoursynth/vapoursynth/blob/master/src/core/exprfilter.cpp
blaze077
18th February 2017, 23:43
Thank you for the release, pinterf. :)
martin53
25th February 2017, 11:16
Just for all readers reference:
New masktools2a.48 successor (masktools2 pfmod) thread here (http://forum.doom9.org/showthread.php?t=174333)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.