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 22nd June 2016, 10:47   #1  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
SMDegrain fails at Interleaved2planar

I've been using SMDegrain successfully with SD sources.

Now I'm trying it on a HD source. Not sure what's the difference... but this time it throws this error:

"There is no function named 'Interleaved2planar'"

Searching online, it appears Interleaved2planar is part of SSETools.dll which is part of RemoveGrain 0.9, and all the links are down.
This page needs to be updated for broken links

I really can't stay what's the difference between this video and the others before, but I can't get it to work nor find a working link for SSETools.dll

Any help would be appreciated!
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 11:08   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by MysteryX View Post
I really can't stay what's the difference between this video and the others before
You're probably using RGTools which only supports planar formats.
As for the link for SSETools - It's probably part of the original plugin package for QTGMC() (first post in the QTGMC thread).
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 22nd June 2016 at 11:23.
Groucho2004 is offline   Reply With Quote
Old 22nd June 2016, 11:41   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
Here, removegrain_25_dll_20050501-v0.9.zip with source (~225KB):- http://www.mediafire.com/download/dx...50501-v0.9.zip

Code:
        SSE2Tools_ORDERED_Function_List 

There follows a list of all function names together with CPP style argument specifiers that inform
Avisynth the argument types and optional names. Optional arguments have square brackets surrounding
their name as in [name] and are followed by a type specifier character that gives the type.
Unnamed arguments are not optional. eg "cc[arg1]b[arg2]i" would be two compulsory unnamed clip args,
followed by optional 'arg1' of type bool and optional 'arg2' of type int.

# Argument type specifier strings.
 c - Video Clip
 i - Integer number
 f - Float number
 s - String
 b - boolean
 . - Any type (dot)
# Array Specifiers
 i* - Integer Array, zero or more
 i+ - Integer Array, one or more
 .* - Any type Array, zero or more
 .+ - Any type Array, one or more
#    Etc
###################################


AmplifyDifference  "cc[factor]f[factorU]f[factorV]f[grey]b"
Difference         "cc[frames]i[tolerance]i[above]b[yuv]b"
Interleaved2Planar "c[grey]b"
LimitChange        "cci[limitU]i[limitV]i"
Planar2Interleaved "c[grey]b"
Quadruple          "c[grey]b"
ReduceFluctuations "c[limit]i[limitU]i[limitV]i[reduceflicker]b"
Shrinkby2          "c[grey]b"
TransformColor     "cffffffffff"
Truncate           "cii[lowerU]i[upperU]i[lowerV]i[upperV]i"
EDIT: Kassandro had a nasty habit of including 'secret' or undocumented filters, functions, and arguments.
Dont know if above are all documented, I seem to recall Didee querying Kassandro on his VideoProcessing forum
about 'secret' arguments to some functions in SSETools, thought I saved the pages but cant seem to find them.

EDIT: Above FunctionList generated by RT_Stats included script.
EDIT: Added the descriptor to above FunctionList (for non devs).
__________________
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 June 2016 at 12:33.
StainlessS is offline   Reply With Quote
Old 22nd June 2016, 12:41   #4  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
I really don't get it. Here's a script. It works on 288p videos and requires a bunch of extra filters on 1080p videos. Also, on 1080p, contrasharp=true causes an instant crash.

Code:
P="Encoder\"
Import(P+"AviSynthMT.avsi")
LoadPlugin(P+"LSMASHSource.dll")
LoadPlugin(P+"Dither.dll")
Import(P+"Dither.avsi")
LoadPlugin(P+"MVTools2.dll")
LoadPlugin(P+"masktools2.dll")
Import(P+"smdegrain.avsi")
LoadPlugin(P+"rgtools.dll")

file="288p.mpg"
LWLibavVideoSource(file, cache=False)
AudioDub(LWLibavAudioSource(file, cache=False))
Dither_convert_8_to_16()
SMDegrain(thsad=2000, contrasharp=true, lsb_in=true, lsb_out=true)
DitherPost()
#Prefetch(8)
288p and 480p videos work. 720p and 1080p videos fail !?

If I turn off contrasharp, then it has none of that madness, which means it's taking a different processing path for 480p than for 720p content.

Last edited by MysteryX; 22nd June 2016 at 12:52.
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 12:49   #5  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by MysteryX View Post
Also, on 1080p, contrasharp=true causes an instant crash.
You should know this by now - "causes an instant crash" is useless.

Run the script through AVSMeter. Report the error message.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 22nd June 2016, 12:57   #6  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by MysteryX View Post
If I turn off contrasharp, then it has none of that madness, which means it's taking a different processing path for 480p than for 720p content.
Which is well documented.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 22nd June 2016, 13:06   #7  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
Quote:
Originally Posted by Groucho2004 View Post
You should know this by now - "causes an instant crash" is useless.

Run the script through AVSMeter. Report the error message.
OK. Here's the error

Code:
Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module:   C:\GitHub\NaturalGroundingPlayer\NaturalGroundingPlayer\bin\Debug\Encoder\masktools2.dll
Address:  0x01E689DB

Quote:
Originally Posted by Groucho2004 View Post
Which is well documented.
Vague answers like this aren't very useful.

These extra plugin dependencies are definitely not well documented in the SMDegrain page.

Last edited by MysteryX; 22nd June 2016 at 13:09.
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 13:37   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
I seem to recall that (some version of) Masktools had some kind of fix for Access Violations, not too long ago.
__________________
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 22nd June 2016, 14:05   #9  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,054
Quote:
Originally Posted by MysteryX View Post
OK. Here's the error

Code:
Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module:   C:\GitHub\NaturalGroundingPlayer\NaturalGroundingPlayer\bin\Debug\Encoder\masktools2.dll
Address:  0x01E689DB
What Stainless wrote, I also seem to recall some fix related to that. Try search.

Quote:
Originally Posted by MysteryX View Post
Vague answers like this aren't very useful.

These extra plugin dependencies are definitely not well documented in the SMDegrain page.
Search for the term "HD" on the avisynth.nl page, look at the functions it uses for SD/HD in smdegrain.avsi. Takes 3 minutes to see the differences and consequently the dependencies.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 22nd June 2016, 14:35   #10  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
Quote:
Originally Posted by StainlessS View Post
I seem to recall that (some version of) Masktools had some kind of fix for Access Violations, not too long ago.
I've been searching using Google and can't find it.

It's not on the Wiki page so that will need to be updated. The RemoveGrain 0.9 section also needs to be updated.
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 14:41   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
How bout this:- http://forum.doom9.org/showthread.ph...79#post1657879

Have to dash now to catch bus, but D9 Advanced search "masktools violation".
__________________
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 22nd June 2016, 14:43   #12  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
I found this one and it works
http://forum.doom9.org/showthread.ph...87#post1726387
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 14:55   #13  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
The one I just posted doesn't crash but causes problems somewhere else: "masktools only support planar YUV colorspaces"

The one you posted still crashes.

It crashes on both AviSynth+ and AviSynth 2.6

Last edited by MysteryX; 22nd June 2016 at 14:58.
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 15:08   #14  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
btw, how the heck do you use RemoveGrainSSE2.dll ? RemoveGrainS.dll is the only one that works for me.

Documentation says it requires MSVCR80.DLL

Searching about that DLL says that installing Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update is the solution.

That still doesn't work.
MysteryX is offline   Reply With Quote
Old 22nd June 2016, 22:08   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
The 'S' version is static linked, as opposed to eg SSE2, SSE3 whatever. (I heard that avoid SSE3 is a good idea).
__________________
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 23rd June 2016, 01:50   #16  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
To avoid the crash, I can change this line
Code:
if4     = (w > 1099 ||  h > (lsb_in ? 1199 : 599))                  ? true : false
to
Code:
if4 = false
For HD sources after KNLMeans, however, the noise is subtle and there is far less blurring than with SD sources so it may be best without.

The MT deadlock would be more difficult to pin-point; but then it works on SD sources.
MysteryX is offline   Reply With Quote
Old 23rd June 2016, 02:33   #17  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
OK... SMDegrain on its own works on HD sources.

Part of the problem seems to be that I was running out of memory.

The other part is that... the script runs FASTER in single-threaded mode!

Code:
file="Input.mov"
LWLibavVideoSource(file, cache=True)
AudioDub(LWLibavAudioSource(file, cache=True))
Dither_convert_8_to_16()
Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y", lsb_in=true, tv_range=false)
r = SelectEvery (3, 0)
g = SelectEvery (3, 1)
b = SelectEvery (3, 2)
Dither_convert_rgb_to_yuv (r, g, b, matrix="709", lsb=true, mode=0)
Dither_resize16nr(Width, Height/2, kernel="Spline36", csp="YV24")
KNLMeansCL(D=2, A=2, h=1.1, cmode=true, device_type="GPU", device_id=0, lsb_inout=true)
Dither_resize16nr(Width, Height/2, kernel="Spline36", csp="YV12")
DitherPost(mode=6)
SMDegrain(thsad=2000, prefilter=2)
#Prefetch(4)
Prefetch(4)
Code:
FPS (min | max | average):      0.040 | 33406 | 0.416
Memory usage (phys | virt):     1294 | 1443 MiB
Thread count:                   29
CPU usage (average):            31%
Single thread
Code:
FPS (min | max | average):      0.199 | 0.522 | 0.490
Memory usage (phys | virt):     1249 | 1366 MiB
Thread count:                   25
CPU usage (average):            24%
There seems to be something between SMDegrain and KNLMeans where they don't like each other in MT mode. KNLMeans runs as MT_SERIALIZED


btw I'm using the 2016-01-24 mod version of SMDegrain.

Last edited by MysteryX; 23rd June 2016 at 02:40.
MysteryX is offline   Reply With Quote
Old 23rd June 2016, 13:48   #18  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,165
fixed http://pastebin.com/tTcXNNtw

it was copy past issue in YUY2 in avs 2.6 support code
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 23rd June 2016, 16:06   #19  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
Quote:
Originally Posted by real.finder View Post
fixed http://pastebin.com/tTcXNNtw

it was copy past issue in YUY2 in avs 2.6 support code
Thanks, now it's working!

Btw I just realized two things.

First, this is stupid. I'm converting from RGB back to YV12 and then to YV24!?
Code:
Dither_convert_rgb_to_yuv (r, g, b, matrix="709", lsb=true, mode=0)
Dither_resize16nr(Width, Height/2, kernel="Spline36", csp="YV24")
Second, KNLMeans somehow runs MUCH faster if I move it just before converting back from RGB to YUV! And the quality is considerably better, too.

Here's my script

Code:
file="Input1080p.mov"
LWLibavVideoSource(file, cache=True)
AudioDub(LWLibavAudioSource(file, cache=True))
Dither_convert_yuv_to_rgb (matrix="709", output="rgb48y", noring=true, tv_range=false)
r = SelectEvery (3, 0)
g = SelectEvery (3, 1)
b = SelectEvery (3, 2)
KNLMeansCL(D=2, A=2, h=1.1, cmode=false, device_type="GPU", device_id=0, lsb_inout=true)
Dither_convert_rgb_to_yuv (r, g, b, matrix="709", noring=true, lsb=true, output="YV12")
SMDegrain(thsad=2000, prefilter=2, contrasharp=true, lsb_in=true, lsb_out=true)
DitherPost(mode=6)
InterFrame(Cores=1, Tuning="Smooth", NewNum=60, NewDen=1, GPU=true)
Prefetch(4)
Performance:
Code:
Frames processed:               747 (0 - 746)
FPS (min | max | average):      0.118 | 129914 | 3.987
Memory usage (phys | virt):     1301 | 1399 MiB
Thread count:                   32
CPU usage (average):            40%
Then I have a question about SMDegrain's thsad parameter. Documentation says to keep it low. I find it to work well with 2000 but don't see much difference when I change it. 2000 has worked for me with both SD and HD sources so far but I don't know whether it's the optimal value.

I find SMDegrain to work VERY WELL after KNLMeans. What value do you generally use or recommend for thsad?


Edit: shifting the KNLMeans order gave better result on my HD content but leaves more noise on SD content so it's doing something else

Last edited by MysteryX; 23rd June 2016 at 16:16.
MysteryX is offline   Reply With Quote
Old 23rd June 2016, 17:37   #20  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,190
To partly answer my question about thsad, I just did a test without KNLMeans and it blurred out the output a LOT!!

But by running KNLMeans first, there doesn't seem to be much difference between 1000 or 2000 and the output looks much better than running either one.
MysteryX 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 22:18.


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