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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th February 2018, 20:51   #281  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by ajp_anton View Post
Code:
function testing(clip c,bool info)
{ ... }

sourcefilter
testing(info=true)
error: invalid arguments.
Works if I make the argument "info" optional, or skip the argument name when calling the function.
It has always worked that way, non optionals have to be provided in given order and without naming, just giving in function prototype in quotes will accept as optional, but, must use eg x=Default(x,true) internally, else crash when not supplied.
__________________
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 February 2018 at 23:58.
StainlessS is offline   Reply With Quote
Old 11th February 2018, 21:08   #282  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
Quote:
Originally Posted by StainlessS View Post
It has always worked that way, non optionals have to be provided in given order and without naming, just giving function prototype in quotes will accept as optional, but, must use eg x=Default(x,true) internally, else crash when not supplied.
May I ask why? Is it intentionally left this way, or can/will it be changed?

And I just realized I posted this in the wrong topic (thought I was in the avs+ topic...). A mod can move these posts if they want.
ajp_anton is offline   Reply With Quote
Old 11th February 2018, 21:42   #283  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Is it intentionally left this way, or can/will it be changed
1) yes.
2) unlikely.

Non optionals are compulsory, and in compulsory order, so apart from anything else, names in those cases are superfluous.

EDIT: Names are used so as to accept optional defaults, and specify out-of-order optionals where is convienient.
__________________
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; 12th February 2018 at 01:45.
StainlessS is offline   Reply With Quote
Old 26th February 2018, 09:48   #284  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Fix mt_convolution 10-16 bit mode for SSE2/SSSE3-only processors

Download masktools2 v2.2.14

Code:
Changelog
**v2.2.14 (20180225)
- Fix: mt_convolution invalid instruction on processors below SSE4.1
Thanks for zub35 for the report
pinterf is offline   Reply With Quote
Old 2nd July 2018, 15:01   #285  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
New release.
Download masktools2 v2.2.16

This version is partly an update for handling 32 bit float the same way as Avisynth+ r2728 does.

And there are some quite significant new features.

Special thanks to real.finder for his ideas and testing.
I hope a couple of scripts will benefit from the changes, both quality and speedwise.

Changelog
Code:
**v2.2.16 (20180702)
- mt_merge new parameter hint for chroma placement when luma=true and 4:2:0/4:2:2
  String 'cplace': possible values "mpeg1" or "mpeg2" (default)
  Parameter is effective only for 420 and 422 formats, otherwise ignored.
  Default "mpeg1" is using fast 2x2 pixel (1x2 for 4:2:2) averaging when converting a 4:4:4 mask to a 4:2:0 or 4:2:2 format (old behaviour)
  420 schema:
   +------+------+
   | 0.25 | 0.25 |
   |------+------|
   | 0.25 | 0.25 |
   +------+------+

  "mpeg2" is using 2x3 (1x3 for 4:2:2) pixel weighted averaging when converting a 4:4:4 mask to a 4:2:0 or 4:2:2 format
  420 schema:
   ------+------+-------+
   0.125 | 0.25 | 0.125 |
   ------|------+-------|
   0.125 | 0.25 | 0.125 |
   ------+------+-------+

- 32 bit float U and V chroma channels are now zero based (+/-0.5 for full scale). Was: 0..1, same as luma
  Since internal format changed, use Avisynth+ r2724 or newer for this masktools2 2.2.16.
  Affected predefined expression constants when plane is U or V: 
  cmin and cmax (limited range (16-128)/255 and (240-128)/255 instead of 16/255.0 and 240/255.0
  range_max: 0.5 instead of 1.0
  new: introduce range_min: -0.5 for float U/V chroma, 0 otherwise
  range_half (0.0 instead of 0.5)
  (range_size remained 1.0)
- New expression syntax for Lut expressions: autoscale any input (x,y,z,a) bit depths to 8-16 bits for internal 
  expression use. The primary reason of this feature is the "easy" usage of formerly written 8 bit optimized expressions.

  New parameters for lut functions: 
    String "scale_inputs": "all","allf","int","intf","float","floatf","none", default "none"
  and 
    Boolean "clamp_float": default false, but treated as always true (and thus ignored) when scale_inputs involves a float autoscale.
  and 
    Boolean "use_expr": default 0, calls fast JIT-compiled "Expr" in Avisynth+ for mt_lut, lutxy, lutxyz, lutxyza
    0: no Expr, use slow internal realtime calc if needed (as before)
    1: call Expr for bits>8 or lutxyza
    2: call Expr, when masktools would do its slow realtime calc (see 'realtime' column in the table above)

  Extends and replaces experimental clamp_xxxx keywords.
pinterf is offline   Reply With Quote
Old 2nd July 2018, 23:34   #286  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Thank you for the new release!
FranceBB is offline   Reply With Quote
Old 4th July 2018, 02:25   #287  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
seems both use_expr=1 and use_expr=2 are same (both use_expr=1)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 4th July 2018, 07:36   #288  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Decisions for a single 1D mt_lut:
use_expr=1 (when bit depth is more than 8 bits): pass expression to Avs+ Expr filter for 10 or more bits
use_expr=2 (when no LUT is used) this is only for 32 bit float. 8-16 bit uses LUT, for 1D it has enough memory for the table.

Checked for a 16 bit clip.

For short expressions such as a simple "x 2 *" passing it to Expr is even faster than LUT.
For more complex ones 1D LUT is still faster, it depends.
pinterf is offline   Reply With Quote
Old 4th July 2018, 13:59   #289  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
Decisions for a single 1D mt_lut:
use_expr=1 (when bit depth is more than 8 bits): pass expression to Avs+ Expr filter for 10 or more bits
use_expr=2 (when no LUT is used) this is only for 32 bit float. 8-16 bit uses LUT, for 1D it has enough memory for the table.

Checked for a 16 bit clip.

For short expressions such as a simple "x 2 *" passing it to Expr is even faster than LUT.
For more complex ones 1D LUT is still faster, it depends.
isn't use_expr=2 for use expr all times (8-32 bits) in avs+? even so I note use_expr=2 work with 16 bit now! (at least in the scripts I did edited) and option that use expr all times is needed if it not existing
__________________
See My Avisynth Stuff

Last edited by real.finder; 4th July 2018 at 14:19.
real.finder is offline   Reply With Quote
Old 4th July 2018, 14:32   #290  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by real.finder View Post
isn't use_expr=2 for use expr all times (8-32 bits) in avs+? even so I note use_expr=2 work with 16 bit now! (at least in the scripts I did edited) and option that use expr all times is needed if it not existing
Readme* says:
Possible values:
0: uses lut and internal realtime calculation
1: Expr, when bit depth>=10 or lutxyza
2: When masktools would use realtime calc

E.g. for use_expr=2:
8-16 bit lut is still LUT
8-12 bit lutxy is passed to Expr
14-16 and 32 bit lutxy is passed to Expr

E.g. for use_expr=1:
8 bit lut is still LUT
10-16 and 32 bit lut is Expr
8 bit lutxy is still LUT
10-16 and 32 bit lutxy is passed to Expr

The "feature matrix" in readme shows 'realcalc' bit depth limits for th different lut versions. When realcalc working mode kicks in, Expr is used instead for use_expr=2

*Masktools2 page on avisynth.nl is not yet updated

Last edited by pinterf; 4th July 2018 at 14:43.
pinterf is offline   Reply With Quote
Old 4th July 2018, 18:36   #291  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
I see

so what about use_expr 1 will be When masktools would use realtime calc

2 will be when more than 8 bit

3 always use expr in avs+

edit: or 1 mean always and 2 mean more than 8 and 3 mean if realtime
__________________
See My Avisynth Stuff

Last edited by real.finder; 4th July 2018 at 19:22.
real.finder is offline   Reply With Quote
Old 5th July 2018, 07:48   #292  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
What is the point of "always"? Use then Expr directly. It should be even a little faster because Expr is now Invoked and compiled from each GetFrame and not only once, during the filter construction.
pinterf is offline   Reply With Quote
Old 5th July 2018, 08:50   #293  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
What is the point of "always"? Use then Expr directly. It should be even a little faster because Expr is now Invoked and compiled from each GetFrame and not only once, during the filter construction.
the point is make less lines in scripts, since there are no expr() in normal avs
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 5th July 2018, 09:21   #294  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
And pass even an 8 bit 1D lut to Expr? (I have started updating Expr in Avs+ to be able to work like LUT which is faster for some 1D or 2D cases, but had no time to continue and finish atm.)
pinterf is offline   Reply With Quote
Old 5th July 2018, 14:10   #295  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
And pass even an 8 bit 1D lut to Expr? (I have started updating Expr in Avs+ to be able to work like LUT which is faster for some 1D or 2D cases, but had no time to continue and finish atm.)
if it faster (Especially with avx2) or even less ram then why not?

and it will make things easier for testing too
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 5th July 2018, 14:16   #296  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by real.finder View Post
if it faster (Especially with avx2) or even less ram then why not?

and it will make things easier for testing too
It's not perfect
pinterf is offline   Reply With Quote
Old 10th July 2018, 10:50   #297  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
New version, download masktools2 2.2.17

Code:
**v2.2.17 (20180710)
- mt_convolution: check plane dimensions to exceed convolution horizontal/vertical size
- lut functions: plane order to RGBA from BGRA like in Expr.
  expr parameters y-u-v-a naming matches now to r-g-b-a
- for luts: use_expr=3: always send expression(s) to Expr
pinterf is offline   Reply With Quote
Old 5th September 2018, 12:58   #298  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
New version, download masktools2 2.2.18

Thanks tyaniw for the report

Code:
**v2.2.18 (20180905)
- mt_merge: fix right side artifacts for non-mod16 width, AVX2 and luma=false (regression in 2.2.16)
- mt_adddiff: fix 32 bit chroma (still used 0.5 centered chroma instead of 0.0)
pinterf is offline   Reply With Quote
Old 9th September 2018, 01:42   #299  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Thank you for the new version.
Works fine on Windows XP. ^_^
FranceBB is offline   Reply With Quote
Old 8th December 2018, 12:17   #300  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Donetsk
Posts: 58
pinterf
Hi. Where has disappeared in the last versions 2.2.17 & 2.2.18 mt_convolution? Some scripts, for example, BalanceBorders.avs, which use mt_convolution, produce an error
Tempter57 is offline   Reply With Quote
Reply


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 21:04.


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