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 20th July 2016, 20:22   #2121  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
r2069 is out, and this build should be fun I encourage you all to take a look at it, as it brings some serious enhancements to MT, and then some. Let's see...

- First and foremost, I sincerely hope I can put issue #37 behind me, and unless somebody proves otherwise, plugins should now be able to reliably specify their MT-mode using the SetCacheHints() mechanism (for an example, see the usage of CACHE_GET_MTMODE here). This means, there is no need any more to use IScriptEnv2, which is still unstable. With this method there is also no need for plugins to differentiate between Avs 2.6 and Avs+, and it allows you to specify different MT modes for your filter depending on the construction parameters. With one word: use this, not IScriptEnv2.

- The calculation of the final MT mode got a lot smarter. For filter calls which create a hierarchy of nested filters, it is often incorrect or at least sub-optimal to use the MT-modes as specified directly. Avs+ will smartly make adjustments in such cases to ensure reliable results. Unless of course the filter or the user used the “force” option in SetFilterMtMode(), so don't force unless reeeeally necessary (e.g. because of a bug in a filter).

- The behavior of MT_SERIALIZED (mode 3) changed. While the earlier implementation caused all filters that are called from the serialized filter to be also serialized, now it only serializes the one and only filter that it is specified for. This has a couple of important consequences:
-- If you have a mode 3 filter towards the end of your script, the speed penalty is much-much less, since earlier basically your whole script went into mode 3, whereas now other filters can still execute in parallel. The placement of mode 3 filters in your script just got un-critical!
-- This also means it is now a really bad idea to have a big lock/mutex inside your GetFrame() instead of marking it as mode 3, because your plugin will exhibit the old behavior and you won't be able to benefit from the potential improvements at all.
-- There is also a downside: The new mode 3 theoretically does not provide the same amount of MT-protection as the old one. However, I'm not sure it matters to many plugins at all. If it does, the old mode will be re-introduced as mode 4. So keep me up-to-date!

- Avs+ will now automatically recognize source filters. If it sees a source filter which has no MT-mode specified at all, it will automatically use mode 3 instead of the default MT mode. This is great for source filters as in their case it rarely hurts performance and they often need mode 3 anyway, and it will help yet unclassified source filters perform correctly without any user action. One step closer to the "it just works" target.

- Avs+ received a logging facility. You can enable it using SetLogParams(target, level) at the beginning of your script. 'target' can be either "stderr", "stdout", or a path to a file. Level is LOG_ERROR/LOG_WARNING/LOG_INFO/LOG_DEBUG (not strings), with increasing verbosity. Log messages can be output by scripts using LogMsg(msg, level). I went for Log() initially but it was already taken by the math function.

- If logging is enabled, Avs+ will output log messages by itself too. It will automatically log errors, and will issue warnings and notes to the user to inform him about potential problems, buggy plugins, suboptimal settings etcetera. There are a couple of these log messages and they come in various colors. How many can you find? Gotta catch 'em all!


Edit: Despite my obvious enthusiasm, this build is still a test build. Please treat it as such.
__________________
AviSynth+

Last edited by ultim; 23rd July 2016 at 10:00. Reason: logging level constant naming clarification
ultim is offline   Reply With Quote
Old 20th July 2016, 20:24   #2122  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 856
Quote:
Originally Posted by ultim View Post
*r2069
__________________
Win10 (x64) build 17134 | GPU Caps Viewer v1.39.0.0
NVIDIA GeForce GT 640 (GK107) 2047MB/DDR3 | (R398.11)
NTSC | DVD: R1 | BD: A
Sparktank is offline   Reply With Quote
Old 20th July 2016, 20:30   #2123  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by Sparktank View Post
*r2069
lol, thx
__________________
AviSynth+
ultim is offline   Reply With Quote
Old 20th July 2016, 20:34   #2124  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 856
This is definitely going to be fun to try out over the next while.

Really like where the future is headed.

Thanks to everyone for getting involved.
__________________
Win10 (x64) build 17134 | GPU Caps Viewer v1.39.0.0
NVIDIA GeForce GT 640 (GK107) 2047MB/DDR3 | (R398.11)
NTSC | DVD: R1 | BD: A
Sparktank is offline   Reply With Quote
Old 20th July 2016, 21:11   #2125  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Posts: 3,878
Quote:
Originally Posted by ultim View Post
Avs+ received a logging facility. You can enable it using SetLogParams(target, level) at the beginning of your script. 'target' can be either "stderr", "stdout", or a path to a file. Level is LOGLEVEL_ERROR/WARNING/INFO/DEBUG (not strings), with increasing verbosity. Log messages can be output by scripts using LogMsg(msg, level). I went for Log() initially but it was already taken by the math function.
Just tried the SetLogParams(target, level) function, very cool:


However, I had to use "SetLogParams("stdout", 4), "LOGLEVEL_DEBUG" was not recognised.
Groucho2004 is offline   Reply With Quote
Old 20th July 2016, 21:19   #2126  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by Groucho2004 View Post
Just tried the SetLogParams(target, level) function, very cool:


However, I had to use "SetLogParams("stdout", 4), "LOGLEVEL_DEBUG" was not recognised.
Ah, my bad. It is actually LOG_ERROR/WARNING..., not LOGLEVEL_... I corrected the post above. I mixed it up with the naming used by the C++ code. Thx!
__________________
AviSynth+
ultim is offline   Reply With Quote
Old 20th July 2016, 21:20   #2127  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Posts: 3,878
Quote:
Originally Posted by ultim View Post
Ah, my bad. It is actually LOG_ERROR/WARNING..., not LOGLEVEL_... I corrected the post above.
That works, thanks.
Groucho2004 is offline   Reply With Quote
Old 21st July 2016, 07:29   #2128  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,605
You provided r2069 as a whole subdirectory (r2069-MT-test) in your "builds" base directory; its download returned a 51.3 MB ZIP, due to including both MSVC Redist installers. I guess you might add a 7zip archive of this directory, excluding both runtimes, in the "builds" base directory, so that people who already installed the runtimes may download a smaller archive instead.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 21st July 2016, 08:08   #2129  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 1,640
Quote:
Originally Posted by ultim View Post
and unless somebody proves otherwise, plugins should now be able to reliably specify their MT-mode using the SetCacheHints() mechanism (for an example, see the usage of CACHE_GET_MTMODE here)
If i understand properly, i just have to re-define the SetCacheHints function of my filter class, is it ?
This SetCacheHints function will be afterward use by avisynth core, i don't have to use it myself in my filter ?
jpsdr is online now   Reply With Quote
Old 21st July 2016, 12:08   #2130  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 1,640
I've done it for nnedi3, but i can't do this for nnedi3_rpow2 because this last one is not a class filter, only the function create exist. We'll have to wait a stable IScriptEnvironment2 to set its MT mode for this last one. It is disable for now, waiting, but shouldn't prevent it to work, because there's still the mutex for safety.
jpsdr is online now   Reply With Quote
Old 21st July 2016, 12:19   #2131  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by jpsdr View Post
If i understand properly, i just have to re-define the SetCacheHints function of my filter class, is it ?
This SetCacheHints function will be afterward use by avisynth core, i don't have to use it myself in my filter ?
Correct. Just override the function, and return your MT mode when called with CACHE_GET_MTMODE.
__________________
AviSynth+
ultim is offline   Reply With Quote
Old 21st July 2016, 12:23   #2132  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by jpsdr View Post
I've done it for nnedi3, but i can't do this for nnedi3_rpow2 because this last one is not a class filter, only the function create exist. We'll have to wait a stable IScriptEnvironment2 to set its MT mode for this last one. It is disable for now, waiting, but shouldn't prevent it to work, because there's still the mutex for safety.
Then there is no need to specify an MT mode for nnedi3_rpow2. Its MT-mode will be determined dynamically based on the other filters it creates. With different words, don't use IScriptEnvironment2 for nnedi3_rpow2 even when it becomes stable, because you only need to set the MT mode for class filters. No need to wait for anything.
__________________
AviSynth+

Last edited by ultim; 21st July 2016 at 12:25.
ultim is offline   Reply With Quote
Old 21st July 2016, 12:44   #2133  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 996
ultim, thanks for the new mt stuff, does it have any measurable overhead (speedwise) for the already "well-behaving" scripts?
pinterf is offline   Reply With Quote
Old 21st July 2016, 14:00   #2134  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 939
Quote:
Originally Posted by Groucho2004 View Post
Just tried the SetLogParams(target, level) function, very cool:


However, I had to use "SetLogParams("stdout", 4), "LOGLEVEL_DEBUG" was not recognised.
Ehm... where is 2.3.1?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 21st July 2016, 14:02   #2135  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi all!
Please advice how install test version?
yup.
yup is offline   Reply With Quote
Old 21st July 2016, 14:11   #2136  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Posts: 3,878
Quote:
Originally Posted by tormento View Post
Ehm... where is 2.3.1?
On my hard drive.
Groucho2004 is offline   Reply With Quote
Old 21st July 2016, 14:15   #2137  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Posts: 3,878
Quote:
Originally Posted by yup View Post
Hi all!
Please advice how install test version?
yup.
Install this and overwrite the files with the ones from r2069.
Groucho2004 is offline   Reply With Quote
Old 21st July 2016, 14:32   #2138  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Groucho2004!
After install, I am get error during check with avsmeter -avsinfo
Code:
AVSMeter 2.3.0 (x86) - Copyright (c) 2012-2016 Groucho2004

Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module:   Cannot determine module
Address:  0x00000001
All Microsoft dll installed.
At wsndows\system32 I am see Avisynth.dll dated 6 July.
yup.
yup is offline   Reply With Quote
Old 21st July 2016, 16:38   #2139  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by pinterf View Post
ultim, thanks for the new mt stuff, does it have any measurable overhead (speedwise) for the already "well-behaving" scripts?
Not in general.

The "already well-behaving" part is tricky though, as it might be that, depending on implementation details in a specific filter, it might behave correctly, while a different one might not under the exact same conditions (same MT mode, same nesting etc.). The new MT "stuff" favors correctness in this sense, not speed. I'd be interested if anybody can show numbers as I don't yet have many, but I think performance degradations, if any at all, should be negligible and rare.
__________________
AviSynth+
ultim is offline   Reply With Quote
Old 21st July 2016, 16:46   #2140  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Posts: 3,878
Quote:
Originally Posted by yup View Post
After install, I am get error during check with avsmeter -avsinfo
Code:
AVSMeter 2.3.0 (x86) - Copyright (c) 2012-2016 Groucho2004

Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module:   Cannot determine module
Address:  0x00000001
All Microsoft dll installed.
At wsndows\system32 I am see Avisynth.dll dated 6 July.
yup.
Define "after install". After installing r2022 or after copying over the r2069 files? Which version(s) do you want to install? What OS?
Groucho2004 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 11:46.


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