Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th August 2015, 10:30   #561  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by LouieChuckyMerry View Post
Now having done so, and after staring at the Dependency Walker GUI for a goodly stretch while dreaming of deciphering the hieroglyphics therein, I was ready to return here seeking more help. Then my eye caught feisty2's comment and, after repeating it slowly a few times until my mental switch flicked, I installed Microsoft Visual C++ Redistributable 2012 and solved the problem.
Next version I'll add hints for these MS VC Restributable issues so the user can try these before consulting Dependency Walker.
Groucho2004 is offline   Reply With Quote
Old 17th August 2015, 02:16   #562  |  Link
LouieChuckyMerry
Registered User
 
LouieChuckyMerry's Avatar
 
Join Date: Feb 2014
Posts: 355
Quote:
Originally Posted by Groucho2004 View Post
Next version I'll add hints for these MS VC Restributable issues so the user can try these before consulting Dependency Walker.
That would certainly make AVSIntoTool even more useful. Perhaps you'd consider a dedicated GUI button, bright and obvious, for "Tools/Plugin Info..." .
LouieChuckyMerry is offline   Reply With Quote
Old 10th April 2016, 18:34   #563  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
can someone make makstools 2 linked with avstp in order to control the number of threads or even turn multithreaded off

I think this will solve QTGMC slowdown issue and avs mt crashes
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 10th April 2016, 21:21   #564  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 135
Quote:
Originally Posted by real.finder View Post
can someone make makstools 2 linked with avstp in order to control the number of threads or even turn multithreaded off

I think this will solve QTGMC slowdown issue and avs mt crashes
The problem was solved on avisynth+ by wildly rewriting its internal buffering code, so I sort of doubt fixing a plugin will do it on its own for vanilla.
AzraelNewtype is offline   Reply With Quote
Old 11th April 2016, 09:26   #565  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by AzraelNewtype View Post
The problem was solved on avisynth+ by wildly rewriting its internal buffering code, so I sort of doubt fixing a plugin will do it on its own for vanilla.
it still there http://forum.doom9.org/showthread.ph...02#post1744902
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 11th April 2016, 12:21   #566  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Masktools 2 doesn't use threading internally and in fact doesn't know anything about it. So linking it against avstp will solve absolutely nothing.
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline   Reply With Quote
Old 8th September 2016, 11:39   #567  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Think I know the answer to this already but,

Is there any way to expand (as in mt_expand()) white on black mask only in 1 direction, ie expand white upwards, or , white downwards ?

(well you can hope, can't you )

EDIT:
I am aware of the horizontal and vertical only modes, maybe some kind of convolution would work, if so could you please give solutions for all four directions.
Results need to be 0,255 only.
EDIT: So only originally black pixels should be affected.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 8th September 2016 at 12:36.
StainlessS is offline   Reply With Quote
Old 9th September 2016, 20:32   #568  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
What, nobody, no idea? EDIT: Clues welcome !
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 9th September 2016 at 21:25.
StainlessS is offline   Reply With Quote
Old 9th September 2016, 23:26   #569  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by StainlessS View Post
maybe some kind of convolution would work...
so only originally black pixels should be affected.
How about mt_expand(mode=something) ?
Quote:
http://manao4.free.fr/mt_masktools.h...pand_mt_inpand
...
mt_expand, mt_inpand
mode select the local neighbourhood. It can take the values :
  • "square" : 3x3 square neighbourhood - isse optimized. [default]
  • "horizontal" : 3x1 horizontal neighbourhood.
  • "vertical" : 1x3 horizontal neighbourhood.
  • "both" : a 3-long cross ( "horizontal" + "vertical" ) neighbourhood. [like default but with rounder corners]
  • a custom mode, where you give a list of coordinates. "0 0 -1 0 1 0" is for example equivalent to "horizontal".
OK, the custom mode documentation is pretty unclear, but this is what I found through trial and error:
Code:
mt_expand(mode=" 1",             chroma="-128") ## shift left
mt_expand(mode="-1",             chroma="-128") ## shift right
mt_expand(mode=" 0  1",          chroma="-128") ## shift up
mt_expand(mode=" 0 -1",          chroma="-128") ## shift down
mt_expand(mode=" 1  1",          chroma="-128") ## shift left+up
mt_expand(mode="-1 -1",          chroma="-128") ## shift right+down
mt_expand(mode=" 0  0  0  1",    chroma="-128") ## expand up
mt_expand(mode=" 0  0  0 -1",    chroma="-128") ## expand down
mt_expand(mode=" 0  0  0  0  1", chroma="-128") ## expand left
mt_expand(mode=" 0  0  0  0 -1", chroma="-128") ## expand right
mt_expand(mode=" 0  0 -1  0  1", chroma="-128") ## expand left+right (same as 'horizontal')
mt_expand(mode=" 0 -1  0  1  0", chroma="-128") ## expand up+down (same as 'vertical')
mt_expand(mode=" 0  0  0  1  1", chroma="-128") ## expand left+up
mt_expand(mode=" 0  0  0 -1 -1", chroma="-128") ## expand right+down
EDIT please ignore this...scroll down

Last edited by raffriff42; 10th September 2016 at 20:20.
raffriff42 is offline   Reply With Quote
Old 10th September 2016, 08:16   #570  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RaffRiff42, you are my hero

Ta very much
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 10th September 2016, 16:35   #571  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
There seems to be a MaskTools bug when using Expand Left as posted in RaffRiff42 post, two posts ahead #570.
This line
Code:
mt_expand(mode=" 0  0  0  0  1", chroma="-128") ## expand left
Assuming that the line is not in error.

This script weirdly exhibits the problem
Code:
BlankClip(pixel_Type="YV12")
Subtitle("Whats the recipe today Jim ...",align=5)
mt_expand(mode=" 0  0  0  0 1", chroma="-128")     # expand left
Greyscale
Load into VDubMod, and repeatedly press one of the refresh keys (F5 or F7)

You will sometime get one of the below results, sometimes the other,





There is something not quite right somewhere

EDIT: XP32. AVS v2.6. Masktools latest on Wiki.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 22nd April 2020 at 21:34.
StainlessS is offline   Reply With Quote
Old 10th September 2016, 16:48   #572  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by StainlessS View Post
There seems to be a MaskTools bug when using Expand Left as posted in RaffRiff42 post, two posts ahead #570.
This line
Code:
mt_expand(mode=" 0  0  0  0  1", chroma="-128") ## expand left
Assuming that the line is not in error.
Since (as the docs state) the numbers represent coordinates, there should be an even number of them.
Here you have (0,0), (0,0), (1,?), with one coordinate incomplete (and the other two being equal).
This probably gives rise to undefined behaviour within MaskTools.
Try "0 0 1 0", or "-1 0 0 0".
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 10th September 2016, 16:52   #573  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanx big G, that explains it just fine
Was drivin' me nuts because I kept gettin' different results.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 10th September 2016, 19:33   #574  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
OK sorry, I had mt_convolution arguments on the brain there.
So mode seems to be a list of (x,y) coordinates, relative to the current pixel (0,0).
The coordinate system is as follows (EDIT: updated in light of Gavino's post #582)
Code:
Above,left
     -1,-1  0,-1 1,-1
     -1,0   0,0  1,0
     -1,1   0,1  1,1
                Below,right
The coordinates can extend beyond what's shown here (±1 horizontal & vertical), to at least ±1000. The list of coordinates can be in any order.

Each pixel is replaced by its local maximum : the brightest pixel in its "local neighborhood," as defined by the mode argument.

For example, mt_expand(mode="0 0 -1 0") defines a local neighborhood of two pixels: the source pixel itself (0,0) and the one to its left (-1,0). In the output, bright areas will appear to "expand" to the right.
(end of edit)

So my previous post should have been something like:
Code:
mt_expand(mode="-1  0",           chroma="128") ## shift right
mt_expand(mode="-1  0   0  0",    chroma="128") ## expand right

mt_expand(mode=" 0  1",           chroma="128") ## shift up
mt_expand(mode=" 0  1   0  0",    chroma="128") ## expand up

mt_expand(mode=" 0 -1",           chroma="128") ## shift down
mt_expand(mode=" 0 -1   0  0" ,   chroma="128") ## expand down

mt_expand(mode=" 1  1",           chroma="128") ## shift left+up
mt_expand(mode=" 1  1   0  0",    chroma="128") ## expand left+up

mt_expand(mode="-1 -1",           chroma="128") ## shift right+down
mt_expand(mode="-1  -1   0  0",   chroma="128") ## expand right+down

mt_expand(mode=" 1  0   0  0  -1  0", chroma="128") ## expand left+right (same as 'horizontal')
mt_expand(mode=" 0  1   0  0   0 -1", chroma="128") ## expand up+down (same as 'vertical')

Last edited by raffriff42; 14th September 2016 at 01:50.
raffriff42 is offline   Reply With Quote
Old 10th September 2016, 20:02   #575  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
You are still my hero Raff, we got it sorted now.

You might want to copy over the fixed list to the original post.

EDIT: You seem to have missed out
Code:
	mt_expand(mode=" 1  0",               chroma="-128") ## shift left
	mt_expand(mode=" 1  0   0  0",        chroma="-128") ## expand left
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 10th September 2016 at 20:33.
StainlessS is offline   Reply With Quote
Old 10th September 2016, 23:46   #576  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Didn't miss it - omitted it on purpose! My trick seems to have worked!

OK let's have some demo images, and experiment with mt_square, mt_diamond and mt_circle
These func's generate strings you can use as mode arguments. So there's no longer any need for...
Code:
mt_expand.mt_expand.mt_expand.mt_expand.mt_expand.mt_expand # ...etc



Code:
BlankClip(width=260, height=120, pixel_type="YV12", color=$0)
Subtitle("M A S K\n-  -  -  -", size=Height/3, align=5, text_color=$ffffff, lsp=0)
AddBorders(8, 8, 8, 8, $ffffff)
AddBorders(48, 32, 48, 32, $0)

return Interleave(
\   EvalShow2("""# (input)""")
\ , EvalShow2("""mt_expand(mode="0 -1  0 0", chroma="-128") # down""")
\ , EvalShow2("""mt_expand(mode="0 0 -1 -1 -2 -2 -3 -3", chroma="-128") # down-right x3""")
\ , EvalShow2("""mt_expand(mode=mt_square(radius=4, zero=true), chroma="-128")""")
\ , EvalShow2("""mt_expand(mode=mt_diamond(radius=4, zero=true), chroma="-128")""")
\ , EvalShow2("""mt_expand(mode=mt_circle(radius=4, zero=true), chroma="-128")""")
\ , EvalShow2("""mt_expand(mode=mt_square(radius=16, zero=true), chroma="-128")""")
\ , EvalShow2("""mt_expand(mode=mt_diamond(radius=16, zero=true), chroma="-128")""")
\ , EvalShow2("""mt_expand(mode=mt_circle(radius=16, zero=true), chroma="-128")""")
\ )

### execute a script snippet and show it on screen
function EvalShow2(clip C, string s)
{
    C
    Eval(s)
    Subtitle(s, size=12, align=1) 
    return Last
}

Last edited by raffriff42; 16th March 2017 at 22:56. Reason: (fixed image links)
raffriff42 is offline   Reply With Quote
Old 11th September 2016, 02:57   #577  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by raffriff42 View Post
These func's generate strings you can use as mode arguments. So there's no longer any need for...
Code:
mt_expand.mt_expand.mt_expand.mt_expand.mt_expand.mt_expand # ...etc
What?

The mt_expand chain is good because the square and diamond modes are SIMD-optimised, whereas the custom modes aren't. (And obviously using a chain is O(n) whereas specifying all the pixels is O(n^2), so even if SIMD optimisations weren't relevant, you still lose out.)

Just for comparison, mt_expand_multi(sw=10,sh=10) runs about 477 times as fast as mt_expand(mode=mt_square(radius=10)) on my old and flaky laptop (815.2 fps versus 1.709 fps).

There's also a constant-time algorithm for the specific case of rectangular erosion and dilation, but practically speaking, the O(n) algorithm is fast enough for reasonable radii.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!

Last edited by colours; 11th September 2016 at 03:00.
colours is offline   Reply With Quote
Old 11th September 2016, 03:12   #578  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Very sexy

But how would cope with something like,
Code:
HALO_L   = 3                             # Left Halo width in pixels
HALO_R   = 4                             # Right Halo width in pixels
HALO_T   = 5                             # Top Halo height in pixels
HALO_B   = 6                             # Bot Halo height in pixels
Above, as now implementing the subtitle detector.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 11th September 2016 at 03:14.
StainlessS is offline   Reply With Quote
Old 11th September 2016, 05:00   #579  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
@colours, I spoke before testing it. You are right of course, thank you.

@StainlessS, this seems to be accurate ± one pixel:
(EDIT rewritten with mt_expand_multi, part of Dither_tools)
Code:
#M=mt_expand(255, 0, 
#\       mt_rectangle(
#\           Round(0.5*(HALO_L+HALO_R)), 
#\           Round(0.5*(HALO_T+HALO_B))), 
#\       chroma="copy") ## 32fps
M=mt_expand_multi(
\       sw=Round(0.5*(HALO_L+HALO_R)),
\       sh=Round(0.5*(HALO_T+HALO_B)),
\       chroma="copy") ## 220fps
M=M.UUOffsetF(HALO_R-HALO_L, HALO_B-HALO_T)

## test - show semitransparent mask
return Overlay(M, mode="lighten", opacity=0.75) 

## shift a clip up-down and left-right (sub-pixel shift)
function UUOffsetF(clip C, float offh, float offv) {
    return C.BilinearResize(Width, Height, -offh, -offv, Width, Height)
}
Here is a function to work with half-size custom masks for an approximate 10x speedup. (EDIT deleted it; use above)
StainlessS, you could hack this for your needs.
Note the built-in "free" blurring; you're gonna want that, or something like it. (EDIT use GaussianBlur or something)

Last edited by raffriff42; 16th March 2017 at 22:52. Reason: (fixed image links)
raffriff42 is offline   Reply With Quote
Old 11th September 2016, 05:44   #580  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Dear me !!!
You seem to have the bull by the horns

I cant actually feather until after detection with RT_YInRangeLocate(), so we need full size masks.

I'll have another look in the morrow, got to get some sleep before I fall down.

EDIT: Rethink, maybe I can.
Edit, nah, forget that.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 11th September 2016 at 21:33.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:42.


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