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 17th August 2013, 20:15   #1  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
TCannyMod

Canny edge detection filter for Avisynth2.6x based on tcanny by tritical.

slow (because almost all processings are performed in the floating point), but faster than tcanny about 1400% to 2500%(by the favor of SSE/SSE2 and smart hysteresis algorithm).

binary: TCannyMod-1.2.0.zip
source code: https://github.com/chikuzen/TCannyMod/

requirement:
* Avisynth2.6.0/Avisynth+r1576 or greater
* Microsoft Visual C++ 2015 Redistributable Package
* WindowsVista sp2/7 sp1/8.1/10
* SSE2 capable CPU

EDIT:
2016-05-25 update to 1.2.0
__________________
my repositories

Last edited by Chikuzen; 25th May 2016 at 10:16.
Chikuzen is offline   Reply With Quote
Old 17th August 2013, 20:37   #2  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 287
Quote:
Originally Posted by Chikuzen View Post
Canny edge detection filter for Avisynth2.6x based on tcanny by tritical.

slow (because almost all processings are performed in the floating point.), but faster than tcanny about 1400% to 2000%(by the favor of SSE/SSE2).

binary: tcannymod-0.0.1.zip
source code: https://github.com/chikuzen/TCannyMod/

requirement:
* Avisynth2.6 alpha4 or later
* Microsoft Visual C++ 2010 Redistributable Package
* WindowsXPsp3/Vista/7/8
* SSE2 capable CPU
Nice , am I right if I'm guessing this as step 1, before porting this to [VapourSynth] GenericFilters ?

And more of a curiosity question, would this plugin be even faster if AVX optimization was added considering it's floating point heavy?
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 17th August 2013, 20:51   #3  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Quote:
Originally Posted by mastrboy View Post
Nice , am I right if I'm guessing this as step 1, before porting this to [VapourSynth] GenericFilters ?
yes.

Quote:
And more of a curiosity question, would this plugin be even faster if AVX optimization was added considering it's floating point heavy?
Dunno.
My machine is old penlyn.
__________________
my repositories

Last edited by Chikuzen; 18th August 2013 at 11:40.
Chikuzen is offline   Reply With Quote
Old 18th August 2013, 00:10   #4  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 697
Chikuzen, if in your VS project settings you deselect any runtime - your plugin will be linked against static runtime, eliminating dependency for the small size cost.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 18th August 2013, 02:42   #5  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Quote:
Originally Posted by Mystery Keeper View Post
Chikuzen, if in your VS project settings you deselect any runtime - your plugin will be linked against static runtime, eliminating dependency for the small size cost.
The reason I do not static link MSVCRT is for security and performance.
It is a foolish act to release a new binary whenever a bug is found in MSVCRT. The developer who likes static link is an irresponsible person who does not consider such a thing.
And in my experience, dynamic linked binaries are a bit faster than static linked.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 18th August 2013, 07:49   #6  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by Chikuzen View Post
Dunno.
My machine is old penryn.
avxintrin-emu.h

I used this when I didn't have an AVX CPU.
LaTo is offline   Reply With Quote
Old 19th August 2013, 04:51   #7  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
update to 0.1.0

* fix some typo
* add new function 'GBlur'
* add new argument 'sobel'
* sigma allows to set to 0 (do not blur before edge detection)
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 21st August 2013, 02:59   #8  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
update to 0.1.1

* fix crash when sigma is too large.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 27th August 2013, 19:38   #9  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
It seems using left Crop before TCannyMod will return error "TCannyMod: Invalid memory alignment".

This script returns error
Code:
BlankClip(1000, 1920, 1080, "YV12")
Crop(4, 0, 0, 0)
TCannyMod()
While this one works
Code:
BlankClip(1000, 1920, 1080, "YV12")
Crop(0, 4, -4, -4)
TCannyMod()
mawen1250 is offline   Reply With Quote
Old 27th August 2013, 19:55   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,305
Quote:
Originally Posted by mawen1250 View Post
This script returns error
Code:
BlankClip(1000, 1920, 1080, "YV12")
Crop(4, 0, 0, 0)
TCannyMod()
Try
Code:
BlankClip(1000, 1920, 1080, "YV12")
Crop(4, 0, 0, 0,align=true)
TCannyMod()
__________________
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 26th March 2016, 12:28   #11  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
updated to v1.0.0
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 27th March 2016, 19:40   #12  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
update to 1.1.0.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 3rd April 2016, 04:50   #13  |  Link
blank000
Registered User
 
Join Date: Mar 2016
Posts: 3
TCannyMod parameter

Hi Chikuzen
I question here.Avisynth wiki

EMask with default settings is
GBlur (sigma=1.5, gmmax=50.0, chroma=0, sobel=false, opt=-1)

Should this be corrected "EMask"
blank000 is offline   Reply With Quote
Old 3rd April 2016, 08:27   #14  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Quote:
Originally Posted by blank000 View Post
Hi Chikuzen
I question here.Avisynth wiki

EMask with default settings is
GBlur (sigma=1.5, gmmax=50.0, chroma=0, sobel=false, opt=-1)

Should this be corrected "EMask"
fixed
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 25th May 2016, 10:19   #15  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
update to 1.2.0

- Set filter mode as MT_NICE_FILTER automatically on Avisynth+ MT.
- Use buffer pool on Avisynth+ MT.
- Disable AVX2/FMA3/AVX code when /arch:AVX2 is not set.
- Disable AVX2/FMA3/AVX code on Avisynth2.6.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 26th May 2016, 10:21   #16  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 1,657
A little question about things like this in your code :
Code:
#if defined(_MSC_VER)
    __cpuid(array, info_type);
#else
    __cpuid(info_type, array[0], array[1], array[2], array[3]);
#endif
What compiler from VS are you switching from ?
Is it Intel compiler, or another ? In what case do you put the Intel compiler ?

jpsdr is offline   Reply With Quote
Old 26th May 2016, 10:37   #17  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Quote:
Originally Posted by jpsdr View Post
What compiler from VS are you switching from ?
Is it Intel compiler, or another ? In what case do you put the Intel compiler ?
It's GCC (and Clang).
That code was written to use it by vapoursynth plugins originally.
Since avisynth's GetCPUFlags() does not support AVX2 and FMA3, I use it on avisynth plugins too.
__________________
my repositories

Last edited by Chikuzen; 26th May 2016 at 11:19.
Chikuzen is offline   Reply With Quote
Old 29th January 2017, 14:43   #18  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,031
Don't know if this is the right place to post (or maybe in the avs+ topic?) but I get an "Avisynth open failure: system exception - access violation" when just loading the plugin (on latest dev avs+ r2397). The strange thing is that this happens only on x86 because the x64 version seems to work fine (at least it load the plugin).
mp3dom is offline   Reply With Quote
Old 30th January 2017, 06:38   #19  |  Link
kgrabs
Registered User
 
Join Date: Jan 2017
Posts: 28
actually i got an access violation too, after upgrading to Avisynth+r2172 MT i386 from Avisynth+r1576, that went away after i removed tcannymod.dll from my autoload folder
kgrabs is offline   Reply With Quote
Old 30th January 2017, 17:58   #20  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,095
I think the plugin uses IScriptEnvironment2 avs+ interface, that is avs+ version dependent, and has been changed since the last build
pinterf 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:47.


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