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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st February 2015, 16:20   #1  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
TfNLMeans - an AviSynth 2.6 fork of TNLMeans 1.0.3

Anybody (besides me) interested in an AviSynth 2.6 update of the TNLMeans plugin?
here is v1.05.
It is a fork of TNLMeans 1.0.3, which was the most recent version I found.

Changes
+ Compiled for AviSynth 2.6
+ supports YV16, YV24, YV411, Y8 (plus previous YV12, YUY2)
+ integer param. planes added to allow faster luma-only processing
- internal bitblt() function removed, replaced by AviSynth bitblt() calls (I judge these are best optimized)
+ float TfNLMeans_VersionNumber() function added, so future extensions can increment and scripts can check it
+ simple test suite included
+ ... more, see doc

Caveats
I am a beginner regarding VS project and compiler configurations, linkage and other AviSynth options, SSE optimizations and many, many other topics. Please do not expect it is bug free.

Last edited by martin53; 14th November 2015 at 23:37. Reason: Published V1.05
martin53 is offline   Reply With Quote
Old 21st February 2015, 18:10   #2  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Thanks martin53, will test it out and report back if I find anything unusual.

I always liked TNLMeans, the only downside is the speed. Hopefully Groucho2004 can give us an ICL10 build.

So does the f in TfNLmeans stand for fork? Just curious .
Reel.Deel is offline   Reply With Quote
Old 21st February 2015, 18:22   #3  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
So does the f in TfNLmeans stand for fork? Just curious .
Yep - I just lacked fantasy in that moment.
martin53 is offline   Reply With Quote
Old 21st February 2015, 19:45   #4  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Reel.Deel View Post
Hopefully Groucho2004 can give us an ICL10 build.
ICL10 build can be found here.

Quick speed test:

Script:
Code:
SetMTMode(2)
colorbars(width = 1280, height = 720, pixel_type = "yv12").killaudio().assumefps(24000, 1001)
trim(0,499)
fadeio(248)
trim(0,499)
tnlmeans() #tfnlmeans()
Code:
Tritical's 1.0.3 DLL:           2.464 fps
Tritical's 1.0.3 (ICL10):       4.764 fps
Martin53's tfnlmeans:           3.583 fps
tfnlmeans (ICL10):              4.645 fps

Last edited by Groucho2004; 21st February 2015 at 22:33.
Groucho2004 is offline   Reply With Quote
Old 28th February 2015, 18:59   #5  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
AviSynth parallel execution

Please note that, with the update, I removed internal BitBlt code from the plugin, and in order to call AviSynth's BitBlt, AviSynth's environment pointer is stored in a class variable (for the sake of small changes, because the given calls did not forward it as a parameter).
I just learned that this can make MT environments (AviSynth MT, AviSynth+, VaporSynth) crash, and will provide an update to meet MT requirements.

EDIT: correct IScriptEnvironment pointer forwarding is done, but TNLMeans contained extensive caching and uses forbidden read/write class variables. Pffh...

Last edited by martin53; 28th February 2015 at 19:38.
martin53 is offline   Reply With Quote
Old 7th November 2015, 12:24   #6  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
@Groucho2004

I'm interested in testing the ICL 10 version set in post #4 but the dropbox link gives a 404 page. Could you re-upload it?. Thanks in advance.
AVIL is offline   Reply With Quote
Old 7th November 2015, 15:39   #7  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by AVIL View Post
@Groucho2004

I'm interested in testing the ICL 10 version set in post #4 but the dropbox link gives a 404 page. Could you re-upload it?. Thanks in advance.
You can find them (TNLMeans_ICL & TfNLMeans_ICL) here.
Groucho2004 is offline   Reply With Quote
Old 7th November 2015, 19:33   #8  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
Many Thanks!!
AVIL is offline   Reply With Quote
Old 10th November 2015, 20:00   #9  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Will post an update soon. I have nearly no spare time to work on this, but an update is almost ready for months and i decided to complete the last 5%.
The update will, in contrast to the published version, be fully MT friendly in almost all modes - only Bx|By>1 is not supported. Last bug I need to fix is Y8 format.
martin53 is offline   Reply With Quote
Old 10th November 2015, 23:25   #10  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
i can't wait for this mt friendly release
Mounir is offline   Reply With Quote
Old 14th November 2015, 18:04   #11  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Mask With Merge or Hard Switching?

I added a mask option to the filter, so the pixels to be processed can be restricted for speed improvement.
Please comment if the filter mask should just output the filtered pixel if the mask pixel value is > 0, or if the output should be a merge between the input and filtered value for mask values 1...254?

The merge option needs one more check even if the mask is binary. An additional mt_binarize() or Levels() filter is needed for hard switching behaviour.

Without the internal blend option, an additional merge() is needed if soft borders between filtered and unfiltered pixels are desired.

In my personal opinion soft blending (need for binarized mask if desired) is better.
martin53 is offline   Reply With Quote
Old 15th November 2015, 10:44   #12  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by Mounir View Post
i can't wait for this mt friendly release
See 1st post v1.05
martin53 is offline   Reply With Quote
Old 15th November 2015, 12:03   #13  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
IMHO is better that the filtered output will be blended with the input proportionally at the corresponding value in the mask.

Zero value in the mask means, copy input to output (and do not process input), 255 value means output filtered value and, in the rest of values, output a proportional blend of input-filtered.

Then, if I want hard switching, I would prepare a mask with only 0 and 255 values.
AVIL is offline   Reply With Quote
Old 15th November 2015, 12:50   #14  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
Your new version binaries do not load in my system (I lack of any libraries it said). ICL 10 version of former plugin by Groucho2004 loads fine. I understand they are no linked the same (the size isn't the same either).
AVIL is offline   Reply With Quote
Old 15th November 2015, 17:11   #15  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by AVIL View Post
Your new version binaries do not load in my system (I lack of any libraries it said). ICL 10 version of former plugin by Groucho2004 loads fine. I understand they are no linked the same (the size isn't the same either).
This is compiled with Visual Studio 2015, Groucho2004 compiled with the 2007 Intel compiler.

Since you probably have not yet installed another SW built with this Visual Studio version, you may need a Microsoft library:

Usually, Microsoft compiled SW requires that users install a runtime library. Registered SW publishers can include it in their installers, but else MS wants that it is not republished but downloaded directly from their servers.
martin53 is offline   Reply With Quote
Old 15th November 2015, 18:03   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
M53, you could compile static linked, as /MT (multi-threaded) rather than /MD (multi-threaded dll) and avoid having to have the runtimes.
I have not even seen another plug that uses VS2015 runtimes, yet.

/MT in "Configuration Properties/C/C++/Code Generation/Runtime Library"
__________________
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 15th November 2015, 19:13   #17  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
M53, you could compile static linked, as /MT (multi-threaded) rather than /MD (multi-threaded dll) and avoid having to have the runtimes.
I would not recommend that for DLLs built with VS versions > 7.1. See here.
There is an excellent all-in-one runtime installer.
Groucho2004 is offline   Reply With Quote
Old 15th November 2015, 20:35   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanx Grouchy, I musta missed that thread somehow.
__________________
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 15th November 2015, 21:05   #19  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Groucho2004 View Post
I would not recommend that for DLLs built with VS versions > 7.1. See here.
There is an excellent all-in-one runtime installer.
mmm I didn't know that. With AviSynthShader, I wanted to avoid linking to Visual Studio 2015 runtime, which most people don't have.

It's working... and I'm not clear about the downsides. Are there serious concerns that should make me change it?
MysteryX is offline   Reply With Quote
Old 15th November 2015, 21:46   #20  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
Hi,

I've installed VS 2015 runtime and the plugin don't load. Same message "Module not found. ¿Install missing library?. Rebooting the PC don't resolve the problem.

Last edited by AVIL; 15th November 2015 at 22:02.
AVIL 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 06:35.


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