Log in

View Full Version : script function RemoveNoiseMC


Pages : 1 2 [3] 4

zilog jones
6th January 2007, 02:55
Here's an example of said very noisy video: www.skynet.ie/~zilog/video/ex1.avi (xvid, 30s, 31MB)
The MPEG4 compression has actually smoothed it out a bit (it was MJPEG), but it's still quite bad.

vlq_filter_ultimate seems to just give up except for smoothing chroma (I'm using stronger fft3dfilter settings, without sharpen).

Any ideas? Or does anyone recommend any other filters?

Pookie
6th January 2007, 06:10
Maybe it was raining Granola that day :D


http://img167.imageshack.us/img167/2431/dirtdt0.th.jpg (http://img167.imageshack.us/my.php?image=dirtdt0.jpg)

NeatVideo Vdub
http://img403.imageshack.us/img403/7296/cleanto1.th.jpg (http://img403.imageshack.us/my.php?image=cleanto1.jpg)

Still, the quality is so bad, the Neatvideo filter makes everything opaque.

My suggestion - unless you have an immediate relative in that commercial, fuggetaboutit....

zilog jones
6th January 2007, 12:27
Lol, there's other more interesting stuff on that tape - I just decided to use that cheesy ad as an example :D

Never heard of NeatVideo before, then again I've never really looked at commercial filters...

fenomeno83
6th January 2007, 12:44
here there is my video:
http://www.yourfilelink.com/get.php?fid=253895

Which filters must I apply?

Serbianboss
6th January 2007, 12:46
Can we just use removedirt from this function to clean spots

fenomeno83
6th January 2007, 13:18
how must I use removedirt?excuse me,I'm not expert.
Can I give me string to insert in .avs and plugins to insert in avisynth/plugins folder?thanks

for pookie:result of neatvideo filter is excellent!how must I do to inserti this filter in virtual dub?thanks

fenomeno83
6th January 2007, 14:02
I used neatvideo.it is fantastic!!!

Serbianboss
6th January 2007, 14:20
neatvideo is very slow about 2 fps on my computer.

remove dirt in Removenoise mc excellent remove spots,so interesting how just to use removedirt from that function

fenomeno83
6th January 2007, 14:38
how must I apply removedirty?

fenomeno83
16th January 2007, 11:18
excuse me..I'm using neatvideo to remove noise from analog capture(because I can't use removedirt)..Now I want generate details with other filters(also non free).How can I do?My step are:
1-remove noise with neatvideo
2-add details(but not noise) with another filters

thanks

Didée
16th January 2007, 12:22
I want generate details with other filters(also non free).How can I do?
I'm currently trying to figure how to take $100 out of my pocket if there are only $20 in it.

Once I figured how to do that, I'll answer your question. :)

fenomeno83
16th January 2007, 17:03
why in this great forum nothing want to help me???!!!

tranfa
16th January 2007, 17:05
I'm currently trying to figure how to take $100 out of my pocket if there are only $20 in it.

Once I figured how to do that, I'll answer your question. :)

Maybe he's simply asking for suggestions, mentioning also non-free filters he might consider to buy.
The important is that he, not you, owns the 100$ in his pocket...;)

foxyshadis
16th January 2007, 19:06
Maybe he's simply asking for suggestions, mentioning also non-free filters he might consider to buy.
The important is that he, not you, owns the 100$ in his pocket...;)

You missed his analogy, which is that you can't magically put detail back into something that's lost it. You can correlate fake detail and sharpening with what exists, or hide it under a blanket of noise, but what's lost is gone forever. (Although Didée has dedicated his time here to extracting every possible drop of quality from video, good and bad, no matter how long the script takes. :p)

Pookie
16th January 2007, 21:07
Wouldn't that be Euros, Didée ? ;)

Here's my analogy - pick off the scab, and it is going to leave a scar...

tranfa
16th January 2007, 21:25
Then I'm sorry: I thought the analogy was more referred to the "non free" side of the story...

Many thanks anyway to anyone who makes this community one of the most interesting for video editing, both developing and communicating the developments! :thanks:

tranfa
16th January 2007, 21:26
Wouldn't that be Euros, Didée ?

Here's my analogy - pick off the scab, and it is going to leave a scar...

That's clear, indeed...!

Pookie
16th January 2007, 22:19
The only reason I even posted a shot with NeatVideo was to demonstrate that a few select frames could look OK, but if you saw the rest of the clip, it was absolute junk - artifacts that looked like someone had sandpapered the camera lens. That's why I recommended to zilog not to even waste his time.

fenomeno83
18th January 2007, 17:11
neatvideo is fantastic!!if we use auto profile by select area neatvideo will work correctly!

kastiauto
3rd February 2007, 20:08
Hello

Sorry, but i don't understand how to use these examples given in post 1.
I made file RemoveNoiseMC.avsi containing that first code, but where i have to put code in box 2 (function hq_filter)? If I append that in the end of file RemoveNoiseMC.avsi, then how i call it out in .avs file? hq_filter() or RemoveNoiseMC() with same values in hq_filter function?

foxyshadis
3rd February 2007, 22:00
You only need to call hq_filter(). You can put the secondary functions in their own avsi or the same as removegrain, doesn't matter. You don't need to load anything, since avsi autoloads.

kastiauto
3rd February 2007, 23:31
You only need to call hq_filter(). You can put the secondary functions in their own avsi or the same as removegrain, doesn't matter. You don't need to load anything, since avsi autoloads.

Thanks for explaining script work process.
I did some search in my scripts and plugins and found that LimitedSharpenFaster was corrupted. Now everything seems to be working.

canuckerfan
29th April 2007, 19:45
wrt the first post... I'm running RemoveNoiseMC like this:

function hq_filter(clip c)
{
c=c.RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=0)
c=c.LimitedSharpenFaster(Smode=4,strength=18,overshoot=0,wide=false,ss_x=1.3,ss_y=1.3)
return c
}

hq_filter()

is that the right syntax? I've always been confused about how to run the RemoveNoiseMC script. I think I might be doing something wrong, but the script still manages to work with the following loaded/unloaded:

#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fluxsmooth.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Deblock.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RepairSSE3.dll")
#Import("C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseMC.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\Seesaw.avs")

doesn't RemoveDirtMC need RG, fxsmooth, deblock, repair, and the official removedirt? How come my script (using the syntax above this) still works with those "needed" plugins commented out? any help is appreciated

~bT~
29th April 2007, 22:22
^ dont those plugins get autoloaded as they are in the plugins folder & get called from the function?

canuckerfan
29th April 2007, 23:24
^as far as I know, they don't get autoloaded... unless I'm missing something.

foxyshadis
30th April 2007, 00:29
In the registry, there's a key at HKLM\Software\Avisynth\plugindir2_5. Anything in that folder gets autoloaded.

canuckerfan
30th April 2007, 00:41
In the registry, there's a key at HKLM\Software\Avisynth\plugindir2_5. Anything in that folder gets autoloaded.
I see... so even if I comment out the certain LoadPlugin lines, those plugs still will get loaded?

And if that's the case, how come when I comment out the LoadPlug line for vaguedenoiser, the script throws an error saying VD needs to be loaded?

one more question, is that the correct syntax for calling hq_filter?

~bT~
30th April 2007, 02:37
^ there are some .dll's which don't autoload. for me its warpsharp.dll.

canuckerfan
30th April 2007, 07:50
k, I figured out the RemoveNoiseMC stuff. now, how would I use RemoveNoiseMC_HQ? would I just save this script (http://forum.doom9.org/showthread.php?p=832213#post832213) to an avs file, load it and then call what? i've tried a couple things... but am always confused.

foxyshadis
30th April 2007, 08:51
Upgrade to avisynth 2.5.7, where that autoload bug is fixed. >(

In 2.5.6, it would only load a maximum of 30 or so plugins, in alphabetical order, so the last few (or last half in my case) wouldn't ever get loaded.

Anyway, back on topic, you use the HQ filter by just importing the script and calling the function, RemoveNoiseMC_HQ() inside your script somewhere. Only VLQ requires any changes to the removenoisemc function itself.

canuckerfan
4th May 2007, 03:30
^thanks. that worked:)

one question... if I wanted RemoveNoiseMC_HQ() to only remove spots, not grain/mosquito noise, would I need to tweak the params? or leave as default?

canuckerfan
6th May 2007, 18:07
anyone, please?

FredThompson
6th May 2007, 23:19
Heini011- any chance in future to implement interlaced support for script RemoveNoice MC
This shows how to split an interlaced stream into 2 parts, process them, then rejoin:
ConvertToYV12(Interlaced=True)
SeparateFields()
evn=functions()
odd=functions()
Interleave(evn,odd)
weave()

digitalone
26th June 2007, 21:29
i am not able to get this script to work. as mentioned in first post, i've all the necessary plugins installed in avisynth plugins folder...but still when i call the script function ( RemoveNoiseMC() ) i get an error.

"There is no function named RestoreMotionBlocks"

i reckon RMB is part of RemoveDirt which i've already installed. i tried loading the DLLs with loadplugin command but that didn't work as well.

am i missing something?

foxyshadis
26th June 2007, 22:08
You should ensure you have the latest from http://www.removedirt.de.tf/ which should also be in the package. The only dependency removedirt should have is visual C 2003 runtime (msvcr71.dll), but if you don't have that, removedirtS.dll doesn't need it.

digitalone
27th June 2007, 06:40
@foxyshadis: thx for replying. removedirt error is gone..but avsp still crashes..

http://maxupload.com/img/E9141B03.gif

this is my script:
SetMemoryMax(128)
DGDecode_mpeg2source("E:\Soldier\test_cl.d2v",cpu=4,info=3)
ConvertToYV12(interlaced=true)
ColorMatrix(d2v="E:\Soldier\test_cl.d2v")

Crop(16,6,-4,-34)
Lanczos4Resize(592,304)

RemoveNoiseMC()

Leak
27th June 2007, 08:06
@foxyshadis: thx for replying. removedirt error is gone..but avsp still crashes..

http://maxupload.com/img/E9141B03.gif
Could this be related to this problem (http://forum.doom9.org/showthread.php?p=844409#post844409)?

digitalone
28th June 2007, 20:00
Could this be related to this problem (http://forum.doom9.org/showthread.php?p=844409#post844409)?

thx a lot Leak...the post you referred to solved my problem.. :)

canuckerfan
11th August 2007, 02:28
^I think i'm having a similar problem. I've tried various version of remograin, removedirt, and repair but still my script crashes about 30 seconds in. It goes steadily at about 2 or 3 fps but then Lagarith just says done but obviously it isn't...

#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Colormatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RepairSSE2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveDirtSSE2.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE2.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseMC.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\SeeSaw.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\hq_filter.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avs")

setmemorymax(512)

AVISource("G:\Xvid\IVTCing\IVTC_A.avi")

trim(0,2771)

#ColorMatrix(mode="Rec.709->Rec.601",opt=0,threads=0,scaling=1)

hq_filter()

any ideas?

steptoe
14th October 2007, 20:31
I was having numerous problems with the additional needed filters or functions complaining that whatever was missing, so I just loaded all the needed .dlls or functions and don't bother using the filter calls, just use whats contained in them directly and the function now runs perfectly, great results, very slow, but final quality is what counts

EG

SetMTMode(2,2)
SetMemoryMax(256)
LoadPlugin("D:\Video\AviSynth\Plugins\deblock.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\deen.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\denoisesharpen.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\fluxsmooth.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\masktools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\mt_masktools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\mvtools.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\removedirt.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\removegrain.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\repair.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\rsharpen.dll")
LoadPlugin("D:\Video\AviSynth\Plugins\vaguedenoiser.dll")
Import("D:\Video\AviSynth\Plugins\LimitedSharpenFaster.avs")
Import("D:\Video\AviSynth\Plugins\SeeSaw.avs")
Import("D:\Video\AviSynth\Plugins\RemoveNoiseMC.avs")
RemoveNoiseMC(rdlimit=18,rgrain=3,denoise=14)
VagueDenoiser(threshold=0.6, nsteps=6, chromaT=0.6, percent=75)
deen("a3d",rad=3,thrY=3,thrUV=5,min=0.25,tthY=2,tthUV=3,scd=6)
LimitedSharpenFaster(Smode=4,strength=24,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)


This is the high noise or analogue capture function call I use with DVD-RB Pro, everything now works perfectly

Vesi
27th November 2007, 03:52
I don't know why this is not working for me, after I put all the require plugins from 1th page to plugins directory.

http://maxupload.com/img/3CC5072B.png

what i am doing wrong? here is the simple script where i am using on it.

DGDecode_mpeg2source("C:\Documents and Settings\vesi\Desktop\test2\test2.d2v")
DeBlock_QED()
AssumeTFF().Telecide(guide=1).Decimate()
crop( 2, 54, -2, -50)

Spline36Resize(640,272) # Spline36 (Neutral)
vlq_filter()

I visit RemoveDirt (http://www.removedirt.de.tf/)site and also copy the Removedirt.avs and put in to my plugins folder then i get this error.
http://maxupload.com/img/6B6588EF.png

foxyshadis
27th November 2007, 07:41
bizarro random characters means it's coming from an avsi, if you already have a good idea of which avsi you can still use the line numbers, but if not you need to manually import them all.

SimpleAverage means you have an oooooollllllld version of LimitedSharpenFaster and really need to replace it with the current one. The link at the start of this thread is incorrect, it should point to the mediawiki.

Vesi
27th November 2007, 10:25
Thanks alot foxyshadis,replacing it with LSF from masktools package
solve the problem. hopefuly now i have the latest LSF.
And I copy the seesaw.avs from The link at the start of this thread(is it the right one?) do I need seesaw.avsi also? and could someone link me to latest seesaw. thanks in advance

gigantibyte
30th January 2008, 15:03
I'm getting a weird error I haven't see posted elsewhere:

"Evaluate: left of '?' must be boolean"

http://i26.tinypic.com/244ccxd.png

My avs script looks like:

SetMemoryMax(256)

LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\ColorMatrix.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\MaskTools-v1.5.8\MaskTools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\masktools-v2.0a32\mt_masktools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveGrain1.0beta\RemoveGrain.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveGrain-pre1.0\RemoveGrain.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveGrain-pre1.0\Repair.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveDirt0.9\RemoveDirt.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\TIVTC\TIVTC.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\mvtools-v1.9.2\mvtools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\vaguedenoiser0351\VagueDenoiser.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\fluxsmooth_25_dll_20040729\FluxSmooth.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\deblock12\deblock.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\deen10-beta1\Deen.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\warpsharppackage_25\warpsharp.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")

Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\SeeSaw\Seesaw.avs")
Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\LimitedSharpenFaster.avs")
Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveNoiseMC.avs")
Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\mq_filter.avs")


DGDecode_mpeg2source("C:\temp\sambleb\sample2a.d2v",info=3)
ColorMatrix(hints=true, interlaced=true)

tfm(pp=7).tdecimate()

crop( 6, 64, -8, -72)
Spline36Resize(704,384)

mq_filter()

My code forSeesaw.avs, LimitedSharpenFaster.avs, RemoveNoiseMC.avs, and mq_filter.avs are the latest versions posted, and I'm using AviSynth 2.57. Most of the dlls loaded come from the first post in this thread.

Line 30 of the RemoveNoiseMC.avs code is:

csharpen = sharp ? csharpen : csharpen+0.08


I'm stumped.

Heathcliff
23rd March 2008, 23:57
personnaly my error is :
there is no fonction called "RestoreMotionBlocks"
in RemoveNoiseMC.avs & test1.avs

my test1.avs :
Import("C:\Audio-Video\Filters\AviSynth 2.5\plugins\RemoveNoiseMC.avs")

Load_Stdcall_Plugin("C:\Audio-Video\Tools\megui\tools\yadif\yadif.dll")
AviSource("T:\BT 03008\BANDE 0273871\LA DONNEUSE master huffyuv 2.avi")

Yadif(order=0)
crop( 8, 46, -10, -54)
AddBorders(9,50,9,50,$000000)


converttoYV12

hq_filter()

function hq_filter(clip c)
{
c=c.RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=0)
c=c.LimitedSharpenFaster(Smode=4,strength=18,overshoot=0,wide=false,ss_x=1.3,ss_y=1.3)
return c
}

my RemoveNoiseMC.avs
Import("C:\Audio-Video\Filters\AviSynth 2.5\plugins\LimitedSharpenFaster.avs")
Import("C:\Audio-Video\Filters\AviSynth 2.5\plugins\SeeSaw.avs")

LoadPlugin("C:\Audio-Video\Filters\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Audio-Video\Filters\AviSynth 2.5\plugins\deblock.dll")
LoadPlugin("C:\Audio-Video\Filters\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Audio-Video\Filters\AviSynth 2.5\plugins\mvtools.dll")
LoadPlugin("C:\Audio-Video\Filters\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Audio-Video\Filters\AviSynth 2.5\plugins\Deen.dll")


function RemoveTempGrain(clip input, int _mode)
{
rg = RemoveGrain(input, mode=_mode)
return TemporalRepair(rg, input)
}

function RemoveDirt(clip input, int limit, int rgrain, bool "_grey")
{
_grey = default(_grey, false)
_dgr1 = 0.35+rgrain*0.3
_dgr2 = 0.45+rgrain*0.4
repmode = 1
clensed = Clense(input, grey=_grey, cache=4)
restore = input.FluxSmoothST(3+3*rgrain,rgrain)
restore = Repair(restore, input, mode=repmode, modeU= _grey ? -1 : repmode)
restore = rgrain==0 ? restore.RemoveGrain(1) : \
restore.VagueDenoiser(threshold=_dgr1, chromaT=_dgr1, nsteps=7, percent=75).RemoveGrain(1)
alt = input.VagueDenoiser(threshold=_dgr2, chromaT=_dgr2, nsteps=7, percent=100).RemoveGrain(5)
return RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, pthreshold=4+2*rgrain,

cthreshold=6+2*rgrain, gmthreshold=40, dist=1, dmode=2, debug=false, noise=limit, noisy=12, grey=_grey)
}

global idx_c = 25

function RemoveNoiseMC(clip,int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
{
rdlimit = default(rdlimit,11)
rgrain = default(rgrain,2)
denoise = default(denoise,8)
sharp = (rgrain<1) ? default(sharp,true) : default(sharp,false)
csharpen = (rgrain>2) ? default(csharpen,0.17) : (rgrain>1) ? default(csharpen,0.15) : default(csharpen,0.13)
csharpen = sharp ? csharpen : csharpen+0.08
_grey = default(_grey,false)
_dgr = 0.45+rgrain*0.4
dummy = clip.BlankClip(length=0)
global idx_c = idx_c+1
cbs = 8
cov = (cbs>4) ? cbs/4 : 0
ccf = cbs*cbs/64
cpn = (denoise>12) ? 50*ccf : (denoise>8) ? 58*ccf : (denoise>5) ? 66*ccf : 72*ccf
csh = sharp ? 1 : 0
bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn,

idx=idx_c)
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn,

idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn,

idx=idx_c)
fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn,

idx=idx_c)
backw1 = rdlimit>13 ? \
rdlimit>20 ? \
clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
clip.MVFlow(bvec1, idx=idx_c)
forw1 = rdlimit>13 ? \
rdlimit>20 ? \
clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
clip.MVFlow(fvec1, idx=idx_c)
clp = interleave(backw1,clip,forw1)
clp = clp.RemoveDirt(rdlimit,rgrain,_grey)
dnc = denoise==0 ? clp.RemoveTempGrain(rgrain).SelectEvery(3,1) : dummy
clp = clp.SelectEvery(3,1)
dnc = denoise==0 ? dnc : \
clp.MVDenoise(bvec2, bvec1, fvec1, fvec2, thT=denoise, thSAD=190+15*denoise, thmv=40, thSCD1=230+5*denoise)
vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=7, percent=75)
vid_mo = rgrain==1 ? vid_mo.RemoveGrain(1) : vid_mo.RemoveGrain(5)
dnc = dnc.ConditionalFilter(dnc, vid_mo, "(YDifferenceFromPrevious()+YDifferenceToNext())/AverageLuma()", "<", "0.3")
clp = clp.SeeSaw(dnc, Sstr=csharpen, Szp=12, SdampHi=20, bias=40)
return clp
}

i should have missed something, can somebody tells me what ?

many thanks !

talen9
25th March 2008, 14:00
@Heathcliff:

:search:

From this same thread, on page 7:

i am not able to get this script to work. as mentioned in first post, i've all the necessary plugins installed in avisynth plugins folder...but still when i call the script function ( RemoveNoiseMC() ) i get an error.

"There is no function named RestoreMotionBlocks"

i reckon RMB is part of RemoveDirt which i've already installed. i tried loading the DLLs with loadplugin command but that didn't work as well.

am i missing something?

You should ensure you have the latest from http://www.removedirt.de.tf/ which should also be in the package. The only dependency removedirt should have is visual C 2003 runtime (msvcr71.dll), but if you don't have that, removedirtS.dll doesn't need it.

;)

Heathcliff
26th March 2008, 20:51
many thanks talen9... i made a search but it didn't see this message... it now works ;)

bmnot
26th January 2009, 00:24
Sorry for bumping such an old thread, but I have a relevant question and I didn't think it was worth making a new thread for a small question like this.

But yeah, I'm trying to use RemoveNoiseMC on an old noisy transfer of a public domain movie called "The Last Man on Earth"

and I get this error every time I try and use the avisynth script in MeGUI or TMPGEnc

http://cubeupload.com/files/84f800untitled.png

Here's my RemoveNoiseMC.avsi

I've just added the lq filter function to the bottom of it then called from my the avs of my movie


function RemoveTempGrain(clip input, int _mode)
{
rg = RemoveGrain(input, mode=_mode)
return TemporalRepair(rg, input)
}

function RemoveDirt(clip input, int limit, int rgrain, bool "_grey")
{
_grey = default(_grey, false)
_dgr1 = 0.35+rgrain*0.3
_dgr2 = 0.45+rgrain*0.4
repmode = 1
clensed = Clense(input, grey=_grey, cache=4)
restore = input.FluxSmoothST(3+3*rgrain,rgrain)
restore = Repair(restore, input, mode=repmode, modeU= _grey ? -1 : repmode)
restore = rgrain==0 ? restore.RemoveGrain(1) : \
restore.VagueDenoiser(threshold=_dgr1, chromaT=_dgr1, nsteps=7, percent=75).RemoveGrain(1)
alt = input.VagueDenoiser(threshold=_dgr2, chromaT=_dgr2, nsteps=7, percent=100).RemoveGrain(5)
return RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, pthreshold=4+2*rgrain, cthreshold=6+2*rgrain, gmthreshold=40, dist=1, dmode=2, debug=false, noise=limit, noisy=12, grey=_grey)
}

global idx_c = 25

function RemoveNoiseMC(clip,int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
{
rdlimit = default(rdlimit,11)
rgrain = default(rgrain,2)
denoise = default(denoise,8)
sharp = (rgrain<1) ? default(sharp,true) : default(sharp,false)
csharpen = (rgrain>2) ? default(csharpen,0.17) : (rgrain>1) ? default(csharpen,0.15) : default(csharpen,0.13)
csharpen = sharp ? csharpen : csharpen+0.08
_grey = default(_grey,false)
_dgr = 0.45+rgrain*0.4
dummy = clip.BlankClip(length=0)
global idx_c = idx_c+1
cbs = 8
cov = (cbs>4) ? cbs/4 : 0
ccf = cbs*cbs/64
cpn = (denoise>12) ? 50*ccf : (denoise>8) ? 58*ccf : (denoise>5) ? 66*ccf : 72*ccf
csh = sharp ? 1 : 0
bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=csh, overlap=cov, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = rdlimit>13 ? \
rdlimit>20 ? \
clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(bvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
clip.MVFlow(bvec1, idx=idx_c)
forw1 = rdlimit>13 ? \
rdlimit>20 ? \
clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(fvec1, idx=idx_c).Deblock(quant=16, aOffset=4, bOffset=4) : \
clip.MVFlow(fvec1, idx=idx_c)
clp = interleave(backw1,clip,forw1)
clp = clp.RemoveDirt(rdlimit,rgrain,_grey)
dnc = denoise==0 ? clp.RemoveTempGrain(rgrain).SelectEvery(3,1) : dummy
clp = clp.SelectEvery(3,1)
dnc = denoise==0 ? dnc : \
clp.MVDenoise(bvec2, bvec1, fvec1, fvec2, thT=denoise, thSAD=190+15*denoise, thmv=40, thSCD1=230+5*denoise)
vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=7, percent=75)
vid_mo = rgrain==1 ? vid_mo.RemoveGrain(1) : vid_mo.RemoveGrain(5)
dnc = dnc.ConditionalFilter(dnc, vid_mo, "(YDifferenceFromPrevious()+YDifferenceToNext())/AverageLuma()", "<", "0.3")
clp = clp.SeeSaw(dnc, Sstr=csharpen, Szp=12, SdampHi=20, bias=40)
return clp
}

function lq_filter(clip c) {
c=c.RemoveNoiseMC(rdlimit=18,rgrain=3,denoise=14)
c=c.VagueDenoiser(threshold=0.6, nsteps=6, chromaT=0.6, percent=75)
c=c.deen("a3d",rad=3,thrY=3,thrUV=5,min=0.25,tthY=2,tthUV=3,scd=6)
c=c.LimitedSharpenFaster(Smode=4,strength=24,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
return c
}


Here's the AVS of my movie, before RemoveNoiseMC is run the clip undergoes an IVTC, crop, resize to anamorphic 16x9.


SetMemoryMax(640)

# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\FluxSmooth.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\mt_masktools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\MaskTools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\Deen.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\mvtools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveDirtSSE2.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveGrainSSE2.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RepairSSE2.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\VagueDenoiser.dll")

Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\SeeSaw.avsi")
Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\LimitedSharpenFaster.avsi")
Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\RemoveNoiseMC.avsi")


# SOURCE
mpeg2source("C:\Users\Derek\Desktop\TheLastManOnEarth.d2v")

# TRIM
#trim(startframe,endframe)

# IVTC
Telecide(order=1,guide=1).Decimate()

# CROPPING
crop(0,60,720,360)

# SUBTITLES
#VobSub("FileName")

# RESIZING
LanczosResize(720,480)

# DENOISING: thanks to RemoveNoiseMC
lq_filter()



I have no clue what to do so forgive me if I'm wrong, I thought the values that error is referring to were already defined in the lq_filter function. Do I have to define them elsewhere?

EDIT:

I've also tried including bool "mc" on the lines mentioned in the error message, then it says it expects a comma or left parenthesis in the middle of a word where I know there shouldn't be one. Has anyone else had this much trouble getting this script working? I'm running the latest mvtools 1.x version.

siella
22nd March 2009, 18:18
I hope update new mktools2

kool
26th January 2010, 14:31
Lets make the long story short, I'm facing same problem as bmnot , I have the MVtools2, but still I'm getting these kind of errors.

http://i45.tinypic.com/2ryrlsx.jpg