Log in

View Full Version : Can't get RemoveSpotsMC to work


VideoFanatic
27th November 2012, 14:29
Jenyok - I can't get RemoveSpotsMC() to work. I copied all the RemoveSpots scripts from this post (http://forum.doom9.org/showthread.php?p=1591371#post1591371) and onwards into a file called RemoveSpots.avsi. I've got this script: http://pastebin.com/KNLvYrHZ

I've made sure I have all the plugins mentioned in the top of the script but I'm getting the following error:

error: LoadPlugin: unable to load "C:\PROGRAM FILES (x86)\AVISYNTH 2.5\PLUGINS\RemoveGrainT.dll", error=0x7e
(RemoveSpots.avsi, line 46)

PROCESS EXITED WITH ERROR CODE: 1

I downloaded RemoveGrainT-1.0 and put the RemovGrainT.dll in the correct location. I also tried with RemoveGrainTSSE2.dll and changed the code but got the same error message, this time it said the problem was with RemoveGrainTSSE2.dll

StainlessS
27th November 2012, 17:07
RemoveGrainT.dll shows in VS6 Dependancy Walker as needing:-

MSVCR80.dll (Visual CPP 2005 Runtime)
AVSRecursion.dll

Probably missing AVSRecursion dll in system32, 0x7e is a "Missing Module" error. (EDIT: Not in plugins dir, remove if in there)

EDIT: If 64 bit, then I think maybe SysWOW64 instead of system32, perhaps someone in the know can correct me.

VideoFanatic
27th November 2012, 17:23
OK thanks. I have Windows 7 64-bit and I already have Microsoft Visual C++ 2005 Redistributable installed. Is that the program you were talking about?


I looked in System32 and SysWOW64 and I don't have MSVCR80.dll but I downloaded AVSRecursion.dll and put it there. Where can I get MSVCR80.dll?

StainlessS
27th November 2012, 17:29
Microsoft Visual C++ 2005 Redistributable OK for MSVCR80.dll
AVSRecursion.dll http://avisynth.org/warpenterprises/

Both in SysWOW64 (on 64 bit, verified as correct, system32 on 32 bit systems)

VideoFanatic
27th November 2012, 17:32
I already have Microsoft Visual C++ 2005 Redistributable installed (I think this was built into Windows 7 64-bit but MSVCR80.dll is not in SysWOW64. Should I install Microsoft Visual C++ 2005 Redistributable again?

StainlessS
27th November 2012, 17:35
Dont bother, is probably OK, just do AVSRecursion.dll and retry.

VideoFanatic
27th November 2012, 17:38
I just have AVSRecursion.dll in SysWOW64 and I get this error code: PROCESS EXITED WITH ERROR CODE: -1073741819

StainlessS
27th November 2012, 17:51
From elsewhere:

-1073741819 => 0xC0000005 => "Access Violation"

Dont know what to suggest. (For it to get that far, all dependencies are probably fulfilled, ie OK)

EDIT: Make sure that you do not have AvsRecursion.dll in plugins dir.

VideoFanatic
27th November 2012, 17:53
Do you have a copy of the MSVCR80.dll I could download please?

StainlessS
27th November 2012, 17:56
For it to get that far, all dependencies are probably fulfilled, ie OK, dont think it needs that dll. :confused:

Assistance needed from a W7-64 user of RemoveGrainT.

StainlessS
27th November 2012, 18:02
You could do a search on your Program Files directory for MSVCR80.dll (although I still dont think you need it)
as some programs install local copies (in my case, Elecard and Google Earth).

VideoFanatic
27th November 2012, 18:08
I did a search in Program Files and found this:

http://img248.imageshack.us/img248/7668/91018445.png

How do I know which one I need?

There's also this: http://www.dll-files.com/dllindex/dll-files.shtml?msvcr80

StainlessS
27th November 2012, 18:17
The MSVCR80.dll that I have installed in my system32 (XP32) from the 2005 redistributable is 612kb.

Make sure that you have only one RemoveGrainT in your plugins directory ie not vanilla and SSE version at same time.
By the way, I have not got RemoveGrainT installed on my system, never used it (but is waiting for my attention
in my todo queue).

Think you really need a W7-64 user of RemoveGrainT to assist.

VideoFanatic
27th November 2012, 18:26
OK I copied the 612 KB file into SysWow64 but I still get the same error as before! This is a new installation of Windows 7 64-bit I installed several days ago so I'm sure files haven't been deleted, etc.

StainlessS
27th November 2012, 18:30
What program issues this report:- "PROCESS EXITED WITH ERROR CODE: -1073741819 " ?

Have you tried with any other ?

Make a script that only uses the RemoveGrainT dll, so as to verify problem with that alone,
and try several programs to open including eg Windows Media Player or other,
see if you get same result.

EDIT: Empty your plugins dir except for RemoveGrainT and make script using only that dll and
test in several apps.

VideoFanatic
27th November 2012, 19:00
Simple x264 Launcher. I tried HC Encoder to see if it gave a different error message but that just crashed.

VideoFanatic
27th November 2012, 19:39
OK I removed all plugins apart from the following:

DGDecode.dll
mvtools2.dll
RemoveGrainTSSE2.dll
RemoveSpots.avsi
SpotRemover.vdf

I used the following script:

Mpeg2Source("J:\2 = New\1 = Test files\Spots & Interlacing\Raw 1996 March 11 10 Secs.d2v", CPU=6)

RemoveSpotsMC()

Is that bare minimum that you were talking about?

This is the message I get in Simple x264 Launcher:

Creating process:
"X:/Portable Installations/Simple/Simple x264 Launcher v2/toolset/avs2yuv_x86.exe" -frames 1 "J:\video.avs" NUL

error: Avisynth: access violation at 0x0002DFC4 in C:\Windows\SysWOW64\ntdll.dll,
attempting to read from 0x0EE7462F
(J:\video.avs, line 4)

PROCESS EXITED WITH ERROR CODE: 1


If I try with HC Encoder, it just crashes and says the that fault module name is avisynth.dll

StainlessS
27th November 2012, 21:54
Try to create the simplest script you can using ONLY RemovegrainT,
(Forget RemoveSpots for now, you need to establish if it is still a RemoveGrainT problem, or something else).
See any docs with RemovegrainT for a simple test.
Also, forget about trying to encode anything, just try in a player or Vdub, you need something simple to find
the problem.
Also, remove any dll's that made no difference (ie the 2005 redistribatable that you added).

Going to pub now, so will not be around unless on tablet and cant type too well on that. :)

EDIT: Perhaps a moderator can move this to a new thread from post #683.

VideoFanatic
28th November 2012, 00:39
Do you happen to have a RemoveGrainT script as I can't find any?

StainlessS
28th November 2012, 03:25
By the way, is seems that AvsRecursion relies on MSVCR71.dl

Tried to install RemoveGrainT, all I got was something like "there is no function called RemovegrainT".

But I'm currently not at optimum, being a bit pissed.

StainlessS
28th November 2012, 21:20
Currently trying to set up RemoveSpotsMC script, and I'm getting an error:

"Script Error: Expected ":" RemoveSpotsMC.avs Line" etc


function RemoveSpotsMC3(clip clp, int "Vectors", int "Show")
{
# Constants
#
_thSCD1 = 400

Vectors = Default(Vectors, 3)
Show = Default(Show, 0)

Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show

filter = DeFlicker(clp, border=150, percent=70, lmin=5, lmax=240)

super = MSuper(clp, pel=2, sharp=2)
superfi = MSuper(filter, pel=2, sharp=2)
bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, truemotion=true)
bvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, truemotion=true)
bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
fvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, truemotion=true)
fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, truemotion=true)
backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3, thSCD1=_thSCD1) : NullClip(clp)
backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2, thSCD1=_thSCD1) : NullClip(clp)
backw1 = MFlow(clp, super, bvec1, thSCD1=_thSCD1)
forw1 = MFlow(clp, super, fvec1, thSCD1=_thSCD1)
forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2, thSCD1=_thSCD1) : NullClip(clp)
forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3, thSCD1=_thSCD1) : NullClip(clp)


There are multiple illegal uses of the ternary conditional ie "? : " condition that will not parse.
Cannot believe that this ever worked. What should it be ?

Also again, can a Moderator move this to a new thread from post #683.

Gavino
28th November 2012, 21:42
There are multiple illegal uses of the ternary conditional ie "? : " condition that will not parse.
Cannot believe that this ever worked. What should it be ?
I have not looked at the entire file, but from the bit you quoted, I think adding ': NOP()' to the offending lines should work.

StainlessS
28th November 2012, 22:04
Looking at other similar lines it uses


bvec3 = (Vectors == 3) ? MAnalyse(super, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)



Presume that is what is missing, but dont like guessing.

VideoFanatic
28th November 2012, 23:23
I got the RemoveSpots.avsi, from this thread. On line 258 and a few lines after that you need to add " : NullClip(clp)" to get it to work. But I still have the problem where RemoveSpotsMC() causes a 0x0EE7462F error. I'm trying to use a simple RemoveGrainT script like you said to see if RemoveGrainT is the problem but I can't find any scripts for it.

StainlessS
29th November 2012, 01:48
HolyGamer, can YOU request a moderator to move from #683 to a new thread, & perhaps suggest a name for such.

There is no real need to clutter VideoFred's thread for this.
I'm willing to pursue it further, despite not having W7-64, but it might be better if someone with a suitable system could assist.
.

StainlessS
29th November 2012, 18:40
I got the script working (for me).

Script start,


_use_VDub_ = True # Else RemoveSpotsMC2 will fail

PLUGS="D:\R\PLUGS\" # Edit To Suit
VDPLUGS="D:\R\PLUGS\" # Edit To Suit

# NOT USED IN SCRIPT
#
# LoadPlugin(PLUGS + "REMOVEGRAINT-1_0\repairt.dll")
# LoadPlugin(PLUGS + "REMOVEGRAINT-1_0\removegraint.dll")
# LoadPlugin(PLUGS + "FLUXSMOOTH_25_DLL_20040729\fluxsmooth.dll")
# LoadPlugin(PLUGS + "VAGUEDENOISER_25_DLL_20050926\vaguedenoiser.dll")

# USED
# LoadPlugin(PLUGS + "REMOVEDIRT_20050507\removedirt.dll") # ] ONLY ONE OF THESE, NOT BOTH
LoadPlugin(PLUGS + "REMOVEDIRT_20050507\removedirts.dll") # ]
LoadPlugin(PLUGS + "REMOVEGRAIN-1_0\repair.dll")
LoadPlugin(PLUGS + "REMOVEGRAIN-1_0\removegrain.dll")
LoadPlugin(PLUGS + "MVTOOLS-V2_5_11_3\mvtools2.dll")
LoadPlugin(PLUGS + "DEFLICKER_25_DLL_20040816\deflicker.dll")
LoadPlugin(PLUGS + "DESPOT_3_6_1\despot.dll")
LoadPlugin(PLUGS + "FFT3DFILTER_20070220\fft3dfilter.dll") # FFT3DFilter needs FFTW3.DLL in system32 (SysWOW64)
LoadPlugin(PLUGS + "MASKTOOLS-V2_0A48\mt_masktools-25.dll")
LoadPlugin(PLUGS + "MASKTOOLS-V1_5_8\masktools.dll")
LoadPlugin(PLUGS + "DEPAN_20080127\depan.dll") #LoadPlugin(PLUGS + "DEPAN_20061128\depan.dll")
LoadPlugin(PLUGS + "DEPAN_ESTIMATE_20070325\depanestimate.dll") #LoadPlugin(PLUGS + "DEPAN_20061128\depanestimate.dll")
# DepanEstimate needs FFTW3.DLL in system32 (SysWOW64)

(_use_VDub_ == true) ? LoadVirtualDubPlugin(VDPLUGS + "VD_SPOTREMOVER\spotremover.vdf", "SpotRemover", 11) : NOP()


RemoveGrainT, dll is not used in script so can be commented out, also of course unikely to be your trouble.
Use only one version of RemoveDirt dll.
Ensure that you have FFTW3.DLL in SysWOW64 (system32 for 32 bit).

This is the script I was testing with.

VIDOEOFILE="D:\R\PAL-P_169_P-AeonFlux.d2v"
MPEG2Source(VIDOEOFILE)

import("RemoveSpotsMC.avs")
#return last

# function RemoveSpots(clip clp, int "limit", bool "_grey")
# function RemoveSpotsMC(clip clp, int "limit", bool "_grey", int "Vectors")
# function RemoveSpotsMC2(clip clp, int "type", bool "show", int "Vectors")
# function RemoveSpotsMC3(clip clp, int "Vectors", int "Show")
# function RemoveSpotsMC4(clip clp, int "Vectors", int "Show")
# function RemoveSpotsMC5(clip clp, int "Vectors", int "Show")

A=Last
RemoveSpotsMC()
D=subtract(Last,a)
D2=ClipDelta(Last,a,amp=true)
T=Stackhorizontal(a,last)
B=Stackhorizontal(d,d2)
StackVertical(T,B)
return last

# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
amp=Default(amp,false)
show=Default(show,false)
c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
c1=clip1.subtract(clip2)
c1=(amp)?c1.levels(127,1.0,129,0,255):c1
return (show)?c1.Merge(c2):c1
}


Suggest un-comment 'return last' after import this will ascertain if your problem is in dll loading.

NOTE, apart from the RemoveSpotsMC3 NullClip() script errors, RemoveSpotsMC2 'ff1' should read 'forw1'.

EDIT: I use later versions of Depan & DepanEstimate.

EDIT: Some of the MC funcs, seem to create more anomalies than they fix.

EDIT: Assuming that everything ok with 'return last' after import, then test each func and note whether
crash or not, and report back.

StainlessS
29th November 2012, 20:59
If you find that eg RemoveSpotsMC() func is at fault can use the below to locate problem line


function RemoveSpotsMCTest(clip clp, int "limit", bool "_grey", int "Vectors")
{
clp # Assign last for FrameEvaluate


_grey = Default(_grey, false)
limit = Default(limit, 16)
Vectors = Default(Vectors, 1)
Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
FrameEvaluate("""RT_Debug("STEP_1")""",After_frame=true)
super = MSuper(clp, pel=2, sharp=2)
FrameEvaluate("""RT_Debug("STEP_2")""",After_frame=true)
bvec3 = (Vectors == 3) ? MAnalyse(super, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_3")""",After_frame=true)
bvec2 = (Vectors >= 2) ? MAnalyse(super, isb=true, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_4")""",After_frame=true)
bvec1 = MAnalyse(super, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
FrameEvaluate("""RT_Debug("STEP_5")""",After_frame=true)
fvec1 = MAnalyse(super, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
FrameEvaluate("""RT_Debug("STEP_6")""",After_frame=true)
fvec2 = (Vectors >= 2) ? MAnalyse(super, isb=false, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_7")""",After_frame=true)
fvec3 = (Vectors == 3) ? MAnalyse(super, isb=false, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_8")""",After_frame=true)
backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_9")""",After_frame=true)
backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_10")""",After_frame=true)
backw1 = MFlow(clp, super, bvec1)
FrameEvaluate("""RT_Debug("STEP_11")""",After_frame=true)
forw1 = MFlow(clp, super, fvec1)
FrameEvaluate("""RT_Debug("STEP_12")""",After_frame=true)
forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_13")""",After_frame=true)
forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3) : NullClip(clp)
FrameEvaluate("""RT_Debug("STEP_14")""",After_frame=true)

clp = (Vectors == 1) ? interleave(backw1, clp, forw1) : \
(Vectors == 2) ? interleave(backw2, backw1, clp, forw1, forw2) : \
interleave(backw3, backw2, backw1, clp, forw1, forw2, forw3)
FrameEvaluate("""RT_Debug("STEP_15")""",After_frame=true)
clp = RemoveSpots(clp, limit=limit, _grey=_grey)
FrameEvaluate("""RT_Debug("STEP_16")""",After_frame=true)
clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
(Vectors == 2) ? SelectEvery(clp, 5, 2) : \
SelectEvery(clp, 7, 3)
FrameEvaluate("""RT_Debug("STEP_17")""",After_frame=true)

return StackHorizontal(clp,Last).Crop(0,0,width,-0) # Ensure FrameEvaluate()'s are processed
}


Run debugView http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

and then call RemoveSpotsMCTest() instead of RemoveSpotsMC() and check output in DebugView,
You will need RT_Stats plugin (MediaFire in sig).

Can use similar technique for other funcs.

EDIT: If it fails before STEP_1, then insert a line similar to

RT_Debug("CONSTRUCTOR_1")

before each of the FrameEvaluate lines, and it will show the constructors being called (dont forget to amend constructor numbers).

Should produce listing from DebugView like this


00000003 1.79755533 [6660] RT_Debug: CONSTRUCTOR_1
00000004 1.80253458 [6660] RT_Debug: CONSTRUCTOR_2
00000005 1.80835783 [6660] RT_Debug: CONSTRUCTOR_3
00000006 1.81547797 [6660] RT_Debug: CONSTRUCTOR_4
00000007 1.82278299 [6660] RT_Debug: CONSTRUCTOR_5
00000008 1.82932794 [6660] RT_Debug: CONSTRUCTOR_6
00000009 1.83534288 [6660] RT_Debug: CONSTRUCTOR_7
00000010 1.84136367 [6660] RT_Debug: CONSTRUCTOR_8
00000011 1.85357010 [6660] RT_Debug: CONSTRUCTOR_9
00000012 1.86099124 [6660] RT_Debug: CONSTRUCTOR_10
00000013 1.86108100 [6660] RT_Debug: CONSTRUCTOR_11
00000014 1.86832833 [6660] RT_Debug: CONSTRUCTOR_12
00000015 1.87775075 [6660] RT_Debug: CONSTRUCTOR_13
00000016 1.88178849 [6660] RT_Debug: CONSTRUCTOR_14
00000017 1.88707829 [6660] RT_Debug: CONSTRUCTOR_15
00000018 1.89564610 [6660] RT_Debug: CONSTRUCTOR_16
00000019 1.90032268 [6660] RT_Debug: CONSTRUCTOR_17
00000020 1.95606589 [6660] RT_Debug: STEP_1
00000021 1.97399592 [6660] RT_Debug: STEP_1
00000022 2.09149599 [6660] RT_Debug: STEP_1
00000023 2.09160900 [6660] RT_Debug: STEP_2
00000024 2.09171820 [6660] RT_Debug: STEP_3
00000025 2.09182787 [6660] RT_Debug: STEP_4
00000026 2.09193420 [6660] RT_Debug: STEP_5
00000027 2.09204173 [6660] RT_Debug: STEP_6
00000028 2.09214973 [6660] RT_Debug: STEP_7
00000029 2.09225607 [6660] RT_Debug: STEP_8
00000030 2.09236407 [6660] RT_Debug: STEP_9
00000031 2.09246993 [6660] RT_Debug: STEP_10
00000032 2.09257603 [6660] RT_Debug: STEP_11
00000033 2.09268212 [6660] RT_Debug: STEP_12
00000034 2.09278917 [6660] RT_Debug: STEP_13
00000035 2.09289527 [6660] RT_Debug: STEP_14
00000036 2.09300232 [6660] RT_Debug: STEP_15
00000037 2.09310889 [6660] RT_Debug: STEP_16
00000038 2.09321523 [6660] RT_Debug: STEP_17


for first frame and then only the step messages for further frames.

Why are there multiple STEP_1's, beats the hell out of me ! There are multiple usages of 'super' but would have thought caching would
avoid the STEP_1 message being printed multiple times.

Jenyok
30th November 2012, 11:44
Part 1.
.

#
#
# File: RemoveSpots.avsi
#
# RemoveSpots and moution compensated RemoveSpots functions
#
# Functions:
#
# function NullClip(clip clp)
#
# function RemoveSpots(clip clp, int "limit", bool "_grey")
# function RemoveSpotsMC(clip clp, int "limit", bool "_grey", int "Vectors")
#
# function RemoveSpotsMC2(clip clp, int "type", bool "show", int "Vectors")
#
# function RemoveSpotsMC3(clip clp, int "Vectors", int "Show")
#
# function RemoveSpotsMC4(clip clp, int "Vectors", int "Show")
#
# function RemoveSpotsMC5(clip clp, int "Vectors", int "Show")
#
#



LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirts.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\repair.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\removegrain.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\repairt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\removegraint.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MVTOOLS-V2_5_11_3\mvtools2.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\FLUXSMOOTH_25_DLL_20040729\fluxsmooth.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\VAGUEDENOISER_25_DLL_20050926\vaguedenoiser.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEFLICKER_25_DLL_20040816\deflicker.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DESPOT_3_6_1\despot.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MASKTOOLS-V2_0A48\mt_masktools-25.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MASKTOOLS-V1_5_8\masktools.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\FFT3DFILTER_20070220\fft3dfilter.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEPAN_20061128\depan.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEPAN_20061128\depanestimate.dll")

(_use_VDub_ == true) ? LoadVirtualDubPlugin("C:\PROGRAM FILES\VIRTUALDUB 1.9.11\PLUGINS\spotremover.vdf", "SpotRemover", 11) : NOP()



function NullClip(clip clp)
{
return BlankClip(clp, length=0)
}



# =============================================================================
#
#
function RemoveSpots(clip clp, int "limit", bool "_grey")
{
_grey = Default(_grey, false)
limit = Default(limit, 16)

clmode = 17

clensed = Clense(clp, grey=_grey, cache=4)
sbegin = ForwardClense(clp, grey=_grey, cache=-1)
send = BackwardClense(clp, grey=_grey, cache=-1)
alt = Repair(SCSelect(clp, sbegin, send, clensed, debug=true), clp, mode=limit, modeU = _grey ? -1 : limit)
restore = Repair(clensed, clp, mode=limit, modeU = _grey ? -1 : limit)
clp = RestoreMotionBlocks(clensed, restore, neighbour=clp, alternative=alt, gmthreshold=70, dist=1, \
dmode=2, debug=false, noise=10, noisy=12, grey=_grey)

return clp
}


function RemoveSpotsMC(clip clp, int "limit", bool "_grey", int "Vectors")
{
_grey = Default(_grey, false)
limit = Default(limit, 16)
Vectors = Default(Vectors, 1)

Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors

super = MSuper(clp, pel=2, sharp=2)
bvec3 = (Vectors == 3) ? MAnalyse(super, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
bvec2 = (Vectors >= 2) ? MAnalyse(super, isb=true, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
bvec1 = MAnalyse(super, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
fvec1 = MAnalyse(super, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
fvec2 = (Vectors >= 2) ? MAnalyse(super, isb=false, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
fvec3 = (Vectors == 3) ? MAnalyse(super, isb=false, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3) : NullClip(clp)
backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2) : NullClip(clp)
backw1 = MFlow(clp, super, bvec1)
forw1 = MFlow(clp, super, fvec1)
forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2) : NullClip(clp)
forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3) : NullClip(clp)

clp = (Vectors == 1) ? interleave(backw1, clp, forw1) : \
(Vectors == 2) ? interleave(backw2, backw1, clp, forw1, forw2) : \
interleave(backw3, backw2, backw1, clp, forw1, forw2, forw3)

clp = RemoveSpots(clp, limit=limit, _grey=_grey)

clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
(Vectors == 2) ? SelectEvery(clp, 5, 2) : \
SelectEvery(clp, 7, 3)

return clp
}



# =============================================================================
#
# SpotRemover() function VirtualDub
#
function RemoveSpotsMC2(clip clp, int "type", bool "show", int "Vectors")
{
# Constant
#
TypeMax = 4

# Variables
#
type = Default(type, 1)
show = Default(show, false)
Vectors = Default(Vectors, 2)

type = (type < 1) ? 1 : (type > TypeMax) ? TypeMax : type
Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors

# create auxialiary smooth clip for easier motion detection
#
filter = clp.DeFlicker(noise=6).Blur(1.58)

# this is for internal use by MVtools functions. MVtools' version must be 2.0 or higher.
#
super = MSuper(clp, pel=2, sharp=2)
superfi = MSuper(filter, pel=2, sharp=2)

# calculate the motion vectors
#
bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, search=3, truemotion=true) : NullClip(clp)
bvec2 = MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, search=3, truemotion=true)
bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, search=3, truemotion=true)
fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, search=3, truemotion=true)
fvec2 = MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, search=3, truemotion=true)
fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, search=3, truemotion=true) : NullClip(clp)

# create 6 additional clips: two predicted backward and two predicted forward
#
backw3 = (Vectors == 3) ? MCompensate(clp, super, bvec3) : NullClip(clp)
backw2 = (Vectors >= 2) ? MCompensate(clp, super, bvec2) : NullClip(clp)
backw1 = MCompensate(clp, super, bvec1)
forw1 = MCompensate(clp, super, fvec1)
forw2 = (Vectors >= 2) ? MCompensate(clp, super, fvec2) : NullClip(clp)
forw3 = (Vectors == 3) ? MCompensate(clp, super, fvec3) : NullClip(clp)

# clpdeg = (Vectors <= 2) ? MDegrain2(clp, superfi, bvec1, fvec1, bvec2, fvec2, plane=4, thsad=400) : \
# MDegrain3(clp, superfi, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, plane=4, thsad=400)
clpdeg = clp

# combine the 5 frames (2 + 1 + 2), the central one undergoes the degrain filter
# combine the 3 frames (1 + 1 + 1), the central one undergoes the degrain filter
# combine the 7 frames (3 + 1 + 3), the central one undergoes the degrain filter
#
clp = (Vectors == 1) ? interleave(backw1, clpdeg, ff1) : \
(Vectors == 2) ? interleave(backw2, backw1, clpdeg, forw1, forw2) : \
interleave(backw3, backw2, backw1, clpdeg, forw1, forw2, forw3)

# run SpotRemover over each block of 5 (3, 7) frames
# removing spots only, no smoothing
# !!! change to DSD:0 to turn the debug mode off
# !!! change to DSD:1 to turn the debug mode on
#
# SSI - Smooth Strength Intensity
# SSC - Smooth Strength Color
# SKW - Smooth Kernel Width
# SLI - Smooth Locking level for Intensity
# SLC - Smooth Locking level for Color
# SLD - Smooth Locking Debug
# DLS - Detect Level for Spot detection
# DLC - Detect Level for Clearance
# DPC - Detect Perimeter Clearance
# DSF - Detect Spot Fullness factor
# DSD - Detect Spot Debug
# MTX - Motion Table X (columns)
# MTY - Motion Table Y (columns)
# MTL - Motion Table Level to flag cells
# MDX - Motion Distance X
# MDY - Motion Distance Y
# MIH - Motion Interrupted History
# CBR - Color BRightness
# CCO - Color COntrast
# CSA - Color SAturation
# CBA - Color Balance
# CSR - Color Shift Red
# CSB - Color Shift Blue
# FCI - Frame Control Interlaced

clp = clp.ConvertToRGB32()
clp = (type == 1) ? (show == false) ? \
clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:16 DPC:16 DSF:0 DSD:0 MTX:16 MTY:12 MTL:25 MDX:1 MDY:1 MIH:0", "") : \
clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:16 DPC:16 DSF:0 DSD:1 MTX:16 MTY:12 MTL:25 MDX:1 MDY:1 MIH:0", "") : clp
clp = (type == 2) ? (show == false) ? \
clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:15 DPC:14 DSF:1 DSD:0 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : \
clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:24 DLC:15 DPC:14 DSF:1 DSD:1 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : clp
clp = (type == 3) ? (show == false) ? \
clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:10 DSF:2 DSD:0 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : \
clp.SpotRemover("SSI:0 SSC:-5 SKW:3 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:10 DSF:2 DSD:1 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : clp
clp = (type == 4) ? (show == false) ? \
clp.SpotRemover( "SSI:7 SSC:0 SKW:5 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:16 DSF:2 DSD:0 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : \
clp.SpotRemover( "SSI:7 SSC:0 SKW:5 SLI:2 SLC:2 SLD:0 DLS:26 DLC:18 DPC:16 DSF:2 DSD:1 MTX:16 MTY:12 MTL:22 MDX:1 MDY:1 MIH:0", "") : clp

# clp = clp.ConvertBackToYUY2()
clp = clp.ConvertToYV12()

# discard extra frames, keep only the central one
#
clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
(Vectors == 2) ? SelectEvery(clp, 5, 2) : \
SelectEvery(clp, 7, 3)

# compensate for the SpotRemover lag. We will loose the last frame in the movie, but the audio will be in sync
#
# clp = clp.Trim(1, 0) # Maybe not needed

# enhance the contrast (optional)
#
# clp = clp.ColorYUV(gain_y=0, off_y=10, gamma_y=0, cont_y=80, cont_u=0, cont_v=0)

return clp
}

Jenyok
30th November 2012, 11:45
Part 2 continue.
.

global Width2 = 768
global Height2 = 576

# =============================================================================
#
# DeSpot() function
#
function RemoveSpotsMC3(clip clp, int "Vectors", int "Show")
{
# Constants
#
_thSCD1 = 400

Vectors = Default(Vectors, 3)
Show = Default(Show, 0)

Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show

filter = DeFlicker(clp, border=150, percent=70, lmin=5, lmax=240)

super = MSuper(clp, pel=2, sharp=2)
superfi = MSuper(filter, pel=2, sharp=2)
bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, truemotion=true)
bvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, truemotion=true)
bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
fvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, truemotion=true)
fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, truemotion=true)
backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3, thSCD1=_thSCD1) : NullClip(clp)
backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2, thSCD1=_thSCD1) : NullClip(clp)
backw1 = MFlow(clp, super, bvec1, thSCD1=_thSCD1)
forw1 = MFlow(clp, super, fvec1, thSCD1=_thSCD1)
forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2, thSCD1=_thSCD1) : NullClip(clp)
forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3, thSCD1=_thSCD1) : NullClip(clp)

# clpdeg = (Vectors <= 2) ? MDegrain2(clp, superfi, bvec1, fvec1, bvec2, fvec2, plane=4, thsad=400) : \
# MDegrain3(clp, superfi, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, plane=4, thsad=400)
clpdeg = clp

clp = (Vectors == 1) ? Interleave(backw1, clpdeg, forw1) : \
(Vectors == 2) ? Interleave(backw2, backw1, clpdeg, forw1, forw2) : \
Interleave(backw3, backw2, backw1, clpdeg, forw1, forw2, forw3)

clp = clp.Deflicker(percent=99, lag=5, scene=15, info=false)



# ==== большие черные пятна ====
clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
pwidth=50, pheight=50, ranked=true, sign=1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)

# ==== большие белые пятна ====
clp = clp.DeSpot(p1=10, mthres=8, p2=6, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, \
pwidth=100, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=0, color=true, mscene=40, minpts=0)

# ==== маленькие точки и пыль ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
pwidth=6, pheight=5, ranked=true, sign=0, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=2, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)

clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=10, p2=6, \
pwidth=720, pheight=576, ranked=true, sign=2, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)

# ==== Маленькие компактные пятна ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
pwidth=10, pheight=10, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)

# ==== линии, входящие в контакт с движением, избегите области движения ====
clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=16, interlaced=false, median=false, p1=15, p2=13, \
pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)

# ====================================
clp = clp.DeSpot(p1=20, p2=4, pwidth=200, pheight=150, mthres=22, merode=33, sign=2, show=Show, seg=0, color=false, \
motpn=true, fitluma=true, mark_v=255)

clp = clp.DeSpot(p1=20, p2=12, pwidth=768, pheight=576, mthres=80, merode=33, sign=0, show=Show, seg=0, color=true, \
motpn=true, mark_v=255)

clp = clp.DeSpot(p1=12, p2=22, pwidth=100, pheight=100, mthres=22, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
color=true, motpn=true, mark_v=255)

clp = clp.DeSpot(p1=15, p2=1, pwidth=40, pheight=40, mthres=4, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
color=true, motpn=true, mark_v=255)

clp = clp.DeSpot(p1=35, p2=11, pwidth=250, pheight=250, mthres=23, merode=40, p1percent=1, sign=1, show=Show, seg=2,\
color=true, motpn=false, minpts=6, dilate=1, mscene=100, fitluma=true, blur=1, mark_v=255)

clp = clp.DeSpot(p1=22, p2=5, pwidth=100, pheight=140, mthres=11, merode=58, p1percent=25, sign=1, show=Show, seg=1, \
color=true, motpn=false, minpts=6, maxpts=1200, mwidth=7, mheight=5, dilate=2, mscene=90, fitluma=true, \
blur=2, ranked=true, interlaced=false, mark_v=255)

clp = clp.DeSpot(p1=30, p2=22, pwidth=400, pheight=300, mthres=20, merode=33, p1percent=10, sign=1, show=Show, seg=2, \
color=true, motpn=true, mark_v=255)

clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
show=Show, mark_v=255)

clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show, mark_v=255)

clp = clp.DeSpot(p1=30, p2=10, mthres=45, pwidth=Width2, pheight=Height2, minpts=10, dilate=0, ranked=true, \
p1percent=5, mscene=98, merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, \
motpn=true, fitluma=true, blur=1, mark_v=255)

clp = clp.DeSpot(p1=25, p2=14, mthres=25, pwidth=Width2, pheight=Height2, minpts=3, dilate=3, p1percent=5, \
mscene=98, merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)

clp = clp.Despot(p1=28, p2=8, mthres=45, pwidth=850, pheight=850, minpts=10, dilate=0, ranked=true, p1percent=5, mscene=98, \
merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, motpn=true, fitluma=true, \
blur=1, mark_v=255)

clp = clp.Despot(p1=25, p2=14, mthres=25, pwidth=555, pheight=555, minpts=3, dilate=3, p1percent=5, mscene=98, \
merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)





# big black spots
# clp = clp.DeSpot(sign=1, pwidth=45, pheight=45, p1=15, p2=8, mthres=8, color=true, show=Show, mark_v=255)

# thin white lines
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=8, p2=1, mthres=5, show=Show, mark_v=255)

# thick hair lines (avoid real hair)
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=24, show=Show, mark_v=255)

# lines contacting motion, avoid motion areas
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=16, seg=1, show=Show, mark_v=255)

# small dots and dust
# clp = clp.DeSpot(pwidth=6, pheight=5, p1=15, p2=8, mthres=12, tsmooth=2, show=Show, mark_v=255)

# Long horizontal scratches
# clp = clp.DeSpot(sign=-1, pwidth=100, pheight=2, p1=15, p2=8, mthres=12, color=true, show=Show, mark_v=255)

# Small compact spots
# clp = clp.DeSpot(sign=-1, pwidth=10, pheight=10, p1=15, p2=8, mthres=12, color=true, show=Show, mark_v=255)





clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
(Vectors == 2) ? SelectEvery(clp, 5, 2) : \
SelectEvery(clp, 7, 3)

return clp
}

Jenyok
30th November 2012, 11:47
Part 3, continiue.
.

# =============================================================================
#
# DeSpot() function
#
function RemoveSpotsMC4(clip clp, int "Vectors", int "Show")
{
# Constants
#
_thSCD1 = 400
_ml = 100

Vectors = Default(Vectors, 1)
Show = Default(Show, 0)

Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show

filter = FFT3Dfilter(clp, sigma=6, plane=4, bw=32, bh=32, ow=8, oh=8, bt=3)

super = MSuper(clp, pel=2, sharp=2)
superfi = MSuper(filter, pel=2, sharp=2)
bvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=true, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
bvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=true, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
bvec1 = MAnalyse(superfi, isb=true, delta=1, blksize=8, overlap=4, truemotion=true)
fvec1 = MAnalyse(superfi, isb=false, delta=1, blksize=8, overlap=4, truemotion=true)
fvec2 = (Vectors >= 2) ? MAnalyse(superfi, isb=false, delta=2, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
fvec3 = (Vectors == 3) ? MAnalyse(superfi, isb=false, delta=3, blksize=8, overlap=4, truemotion=true) : NullClip(clp)
backw3 = (Vectors == 3) ? MFlow(clp, super, bvec3, thSCD1=_thSCD1) : NullClip(clp)
backw2 = (Vectors >= 2) ? MFlow(clp, super, bvec2, thSCD1=_thSCD1) : NullClip(clp)
backw1 = MFlow(clp, super, bvec1, thSCD1=_thSCD1)
forw1 = MFlow(clp, super, fvec1, thSCD1=_thSCD1)
forw2 = (Vectors >= 2) ? MFlow(clp, super, fvec2, thSCD1=_thSCD1) : NullClip(clp)
forw3 = (Vectors == 3) ? MFlow(clp, super, fvec3, thSCD1=_thSCD1) : NullClip(clp)

sadb = MMask(clp, bvec1, ml=_ml, gamma=1, kind=1, thSCD1=_thSCD1)
sadf = MMask(clp, fvec1, ml=_ml, gamma=1, kind=1, thSCD1=_thSCD1)
msadb = MT_Binarize(sadb, 20, upper=true)
msadf = MT_Binarize(sadf, 20, upper=true)
msad = MT_Logic(msadf, msadb, "or")
msad = MT_Expand(msad)
msadi = Interleave(msad, msad, msad)

clp = (Vectors == 1) ? Interleave(backw1, clp, forw1) : \
(Vectors == 2) ? Interleave(backw2, backw1, clp, forw1, forw2) : \
Interleave(backw3, backw2, backw1, clp, forw1, forw2, forw3)



# ==== большие черные пятна ====
clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
pwidth=50, pheight=50, ranked=true, sign=1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)

# ==== большие белые пятна ====
clp = clp.DeSpot(p1=10, mthres=8, p2=6, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, \
pwidth=100, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=0, color=true, mscene=40, minpts=0, extmask=msadi)

# ==== толстые линии типа волос (избегают реальных волос) ====
clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=24, interlaced=false, median=false, p1=15, p2=13, \
pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)

# ==== линии, входящие в контакт с движением, избегите области движения ====
clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=16, interlaced=false, median=false, p1=15, p2=13, \
pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0, extmask=msadi)

# ==== маленькие точки и пыль ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
pwidth=6, pheight=5, ranked=true, sign=0, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=2, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0, extmask=msadi)

clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=10, p2=6, \
pwidth=720, pheight=576, ranked=true, sign=2, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0, extmask=msadi)

# ==== Длинные горизонтальные затиры ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
pwidth=100, pheight=2, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)

# ==== Маленькие компактные пятна ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
pwidth=10, pheight=10, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0, extmask=msadi)

# ====================================
clp = clp.DeSpot(p1=20, p2=4, pwidth=200, pheight=150, mthres=22, merode=33, sign=2, show=Show, seg=0, color=false, \
motpn=true, fitluma=true, extmask=msadi)

clp = clp.DeSpot(p1=20, p2=12, pwidth=768, pheight=576, mthres=80, merode=33, sign=0, show=Show, seg=0, color=true, \
motpn=true, extmask=msadi)

clp = clp.DeSpot(p1=12, p2=22, pwidth=100, pheight=100, mthres=22, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
color=true, motpn=true, extmask=msadi)

clp = clp.DeSpot(p1=15, p2=1, pwidth=40, pheight=40, mthres=4, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
color=true, motpn=true, extmask=msadi)

clp = clp.DeSpot(p1=35, p2=11, pwidth=250, pheight=250, mthres=23, merode=40, p1percent=1, sign=1, show=Show, seg=2,\
color=true, motpn=false, minpts=6, dilate=1, mscene=100, fitluma=true, blur=1, extmask=msadi)

clp = clp.DeSpot(p1=22, p2=5, pwidth=100, pheight=140, mthres=11, merode=58, p1percent=25, sign=1, show=Show, seg=1, \
color=true, motpn=false, minpts=6, maxpts=1200, mwidth=7, mheight=5, dilate=2, mscene=90, fitluma=true, \
blur=2, ranked=true, interlaced=false, extmask=msadi)

clp = clp.DeSpot(p1=30, p2=22, pwidth=400, pheight=300, mthres=20, merode=33, p1percent=10, sign=1, show=Show, seg=2, \
color=true, motpn=true, extmask=msadi)

clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
show=Show, extmask=msadi)

clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show, \
extmask=msadi)

clp = clp.DeSpot(p1=30, p2=10, mthres=45, pwidth=Width2, pheight=Height2, minpts=10, dilate=0, ranked=true, \
p1percent=5, mscene=98, merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, \
motpn=true, fitluma=true, blur=1, extmask=msadi)

clp = clp.DeSpot(p1=25, p2=14, mthres=25, pwidth=Width2, pheight=Height2, minpts=3, dilate=3, p1percent=5, \
mscene=98, merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, \
extmask=msadi)

clp = clp.Despot(p1=28, p2=8, mthres=45, pwidth=850, pheight=850, minpts=10, dilate=0, ranked=true, p1percent=5, mscene=98, \
merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, motpn=true, fitluma=true, blur=1, \
mark_v=255, extmask=msadi)

clp = clp.Despot(p1=25, p2=14, mthres=25, pwidth=555, pheight=555, minpts=3, dilate=3, p1percent=5, mscene=98, \
merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255, \
extmask=msadi)





# big black spots
# clp = clp.DeSpot(sign=1, pwidth=45, pheight=45, p1=15, p2=8, mthres=8, color=true, show=Show, extmask=msadi)

# thin white lines
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=8, p2=1, mthres=5, show=Show, extmask=msadi)

# thick hair lines (avoid real hair)
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=24, show=Show, extmask=msadi)

# lines contacting motion, avoid motion areas
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=16, seg=1, show=Show, extmask=msadi)

# small dots and dust
# clp = clp.DeSpot(pwidth=6, pheight=5, p1=15, p2=8, mthres=12, tsmooth=2, show=Show, extmask=msadi)

# Long horizontal scratches
# clp = clp.DeSpot(sign=-1, pwidth=100, pheight=2, p1=15, p2=8, mthres=12, color=true, show=Show, extmask=msadi)

# Small compact spots
# clp = clp.DeSpot(sign=-1, pwidth=10, pheight=10, p1=15, p2=8, mthres=12, color=true, show=Show, extmask=msadi)





clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
(Vectors == 2) ? SelectEvery(clp, 5, 2) : \
SelectEvery(clp, 7, 3)

return clp
}

Jenyok
30th November 2012, 11:47
Part 4, continiue.
.

# =============================================================================
#
# DeSpot() function
#
function RemoveSpotsMC5(clip clp, int "Vectors", int "Show")
{
Vectors = Default(Vectors, 1)
Show = Default(Show, 0)

Vectors = (Vectors < 1) ? 1 : (Vectors > 3) ? 3 : Vectors
Show = (Show < 0) ? 0 : (Show > 2) ? 2 : Show

d = clp.DePanEstimate(trust=3, range=1)
clp = clp.DePanInterleave(data=d, prev=Vectors, next=Vectors)


# ==== большие черные пятна ====
clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
pwidth=50, pheight=50, ranked=true, sign=1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)

# ==== большие белые пятна ====
clp = clp.DeSpot(p1=10, mthres=8, p2=6, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, \
pwidth=100, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=0, color=true, mscene=40, minpts=0)

# ==== маленькие точки и пыль ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=33, interlaced=false, median=false, p1=15, p2=8, \
pwidth=6, pheight=5, ranked=true, sign=0, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=2, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)

clp = clp.DeSpot(mthres=8, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=10, p2=6, \
pwidth=720, pheight=576, ranked=true, sign=2, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)

# ==== Маленькие компактные пятна ====
clp = clp.DeSpot(mthres=12, mwidth=7, mheight=5, merode=25, interlaced=false, median=false, p1=15, p2=8, \
pwidth=10, pheight=10, ranked=true, sign=-1, maxpts=0, p1percent=2, dilate=1, fitluma=true, \
blur=4, tsmooth=4, show=Show, mark_v=255, motpn=false, seg=2, color=true, mscene=40, minpts=0)

# ==== линии, входящие в контакт с движением, избегите области движения ====
clp = clp.DeSpot(mthres=13, mwidth=7, mheight=5, merode=16, interlaced=false, median=false, p1=15, p2=13, \
pwidth=140, pheight=100, ranked=true, sign=-1, maxpts=0, p1percent=10, dilate=1, fitluma=true, \
blur=1, tsmooth=0, show=Show, mark_v=255, motpn=false, seg=1, color=true, mscene=40, minpts=0)



# ====================================
clp = clp.DeSpot(p1=20, p2=4, pwidth=200, pheight=150, mthres=22, merode=33, sign=2, show=Show, seg=0, color=false, \
motpn=true, fitluma=true, mark_v=255)

clp = clp.DeSpot(p1=20, p2=12, pwidth=768, pheight=576, mthres=80, merode=33, sign=0, show=Show, seg=0, color=true, \
motpn=true, mark_v=255)

clp = clp.DeSpot(p1=12, p2=22, pwidth=100, pheight=100, mthres=22, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
color=true, motpn=true, mark_v=255)

clp = clp.DeSpot(p1=15, p2=1, pwidth=40, pheight=40, mthres=4, merode=25, p1percent=10, sign=0, show=Show, seg=1, \
color=true, motpn=true, mark_v=255)

clp = clp.DeSpot(p1=35, p2=11, pwidth=250, pheight=250, mthres=23, merode=40, p1percent=1, sign=1, show=Show, seg=2,\
color=true, motpn=false, minpts=6, dilate=1, mscene=100, fitluma=true, blur=1, mark_v=255)

clp = clp.DeSpot(p1=22, p2=5, pwidth=100, pheight=140, mthres=11, merode=58, p1percent=25, sign=1, show=Show, seg=1, \
color=true, motpn=false, minpts=6, maxpts=1200, mwidth=7, mheight=5, dilate=2, mscene=90, fitluma=true, \
blur=2, ranked=true, interlaced=false, mark_v=255)

clp = clp.DeSpot(p1=30, p2=22, pwidth=400, pheight=300, mthres=20, merode=33, p1percent=10, sign=1, show=Show, seg=2, \
color=true, motpn=true, mark_v=255)

clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
show=Show)

clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show)

clp = clp.DeSpot(sign=2, pwidth=Width2, pheight=Height2, p1=10, p2=6, mthres=8, tsmooth=4, seg=2, blur=4, p1percent=2, \
show=Show, mark_v=255)

clp = clp.DeSpot(p1=30, p2=15, pwidth=Width2, pheight=Height2, mthres=20, motpn=true, dilate=1, seg=1, show=Show, mark_v=255)

clp = clp.DeSpot(p1=30, p2=10, mthres=45, pwidth=Width2, pheight=Height2, minpts=10, dilate=0, ranked=true, \
p1percent=5, mscene=98, merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, \
motpn=true, fitluma=true, blur=1, mark_v=255)

clp = clp.DeSpot(p1=25, p2=14, mthres=25, pwidth=Width2, pheight=Height2, minpts=3, dilate=3, p1percent=5, \
mscene=98, merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)

clp = clp.Despot(p1=28, p2=8, mthres=45, pwidth=850, pheight=850, minpts=10, dilate=0, ranked=true, p1percent=5, mscene=98, \
merode=35, mwidth=20, mheight=10, sign=2, show=Show, seg=0, color=true, motpn=true, fitluma=true, blur=1, \
mark_v=255)

clp = clp.Despot(p1=25, p2=14, mthres=25, pwidth=555, pheight=555, minpts=3, dilate=3, p1percent=5, mscene=98, \
merode=35, sign=-2, show=Show, seg=2, color=true, motpn=true, fitluma=true, blur=1, mark_v=255)





# big black spots
# clp = clp.DeSpot(sign=1, pwidth=45, pheight=45, p1=15, p2=8, mthres=8, color=true, show=Show)

# thin white lines
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=8, p2=1, mthres=5, show=Show)

# thick hair lines (avoid real hair)
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=24, show=Show)

# lines contacting motion, avoid motion areas
# clp = clp.DeSpot(sign=-1, pwidth=140, pheight=100, p1=15, p2=13, mthres=13, merode=16, seg=1, show=Show)

# small dots and dust
# clp = clp.DeSpot(pwidth=6, pheight=5, p1=15, p2=8, mthres=12, tsmooth=2, show=Show)

# Long horizontal scratches
# clp = clp.DeSpot(sign=-1, pwidth=100, pheight=2, p1=15, p2=8, mthres=12, color=true, show=Show)

# Small compact spots
# clp = clp.DeSpot(sign=-1, pwidth=10, pheight=10, p1=15, p2=8, mthres=12, color=true, show=Show)





clp = (Vectors == 1) ? SelectEvery(clp, 3, 1) : \
(Vectors == 2) ? SelectEvery(clp, 5, 2) : \
SelectEvery(clp, 7, 3)

return clp
}

StainlessS
30th November 2012, 17:13
@Jenyok, see here:
http://forum.doom9.org/showthread.php?t=166579&page=2
and here:
http://forum.doom9.org/showthread.php?p=1603125#post1603125

You have script errors as noted in links. Also see load plugin notes for other problems.

@HolyGamer,
Mounir had similar problems to yours (with RemoveGrainT W7-64), perhaps he can assist:
http://forum.doom9.org/showthread.php?p=1564265#post1564265

Plus, see here:
http://forum.doom9.org/showthread.php?p=1467440#post1467440
Make sure you have Msvcr71.dll in SysWow64 (search Program Files for a copy, AvsRecursion.dll requirement).
Apparently, they forgot to add it to Windows 7 64 bit. http://www.addictivetips.com/windows-tips/fix-msvcp71-dll-and-msvcr71-dll-missing-error-in-windows-7/

EDIT: Some info from MS on Msvcr71.dll : http://support.microsoft.com/kb/326922
According to MS, it should NOT be in system32/SysWOW64 but in same directory as program that requires it (bundled with
that program), but in this case it needs to be in search path somewhere, I choose to use a 340kb version supplied with
an old version of Nero BR, I have 9 copies in my Program files, 8 are 340kb, and the 9th is 336kb.
Visual CPP Toolkit 2003, comes with a 340kb version and it is that one that is most likely required by any open source software.

VideoFanatic
7th December 2012, 14:01
Plus, see here:
http://forum.doom9.org/showthread.php?p=1467440#post1467440
Make sure you have Msvcr71.dll in SysWow64 (search Program Files for a copy, AvsRecursion.dll requirement).
Apparently, they forgot to add it to Windows 7 64 bit. http://www.addictivetips.com/windows-tips/fix-msvcp71-dll-and-msvcr71-dll-missing-error-in-windows-7/

EDIT: Some info from MS on Msvcr71.dll : http://support.microsoft.com/kb/326922
According to MS, it should NOT be in system32/SysWOW64 but in same directory as program that requires it (bundled with
that program), but in this case it needs to be in search path somewhere, I choose to use a 340kb version supplied with
an old version of Nero BR, I have 9 copies in my Program files, 8 are 340kb, and the 9th is 336kb.
Visual CPP Toolkit 2003, comes with a 340kb version and it is that one that is most likely required by any open source software.

The addictive tips link says the files go in SysWOW64 yet you said at the end of your post that they must go in the same folder as the application that requires it which seems to contradict what you said! Anyway I know they go in SysWOW64 because MultiAVCHD (bluray authoring program) does not work without them being there!)

Thanks everyone for all your help but I give up trying to get removespotsMC to work - especially when you said it created more anomalies than it fixes! RemoveSpots() may remove less spots than RemoveSpotsMC() but it works and doesn't create any anomalies. Here's (http://pastebin.com/y9M9nRTh) the small script I use for RemoveSpots().

StainlessS
7th December 2012, 19:45
HolyGamer, MS says that it should go in same directory as program that requires it (bundled with that program)
BUT, would not then work as required for us, so, everybody (here) just ignores that MS advise. Is because of different
versions of those dll's and the 'dll hell' that MS created. Ignoring MS advise could result in some programs using
the dll in System32/SysWOW64 instead of the bundled one and possible problems in those programs.

kedautinh12
26th October 2019, 08:41
Microsoft Visual C++ 2005 Redistributable OK for MSVCR80.dll
AVSRecursion.dll http://avisynth.org/warpenterprises/

Both in SysWOW64 (on 64 bit, verified as correct, system32 on 32 bit systems)
link was died, you can share me another link??

Groucho2004
26th October 2019, 09:09
link was died, you can share me another link??http://www.avisynth.nl/users/warpenterprises/

kedautinh12
26th October 2019, 11:25
http://www.avisynth.nl/users/warpenterprises/

this is for avs 32 bit, are you have for avs 64 bit??

Groucho2004
26th October 2019, 11:33
this is for avs 32 bit, are you have for avs 64 bit??https://forum.doom9.org/showthread.php?p=1888671#post1888671