View Full Version : script function RemoveNoiseMC


Heini011
16th April 2006, 23:05
Hi folks,

i wrote a little script function as a better alternative for the old Dust. it is optimized for removing noise with only a little lost of details. it removes larger spots and other dirt also.
this script works in YV12 color mode only. the video-clip must have a mod 8 resolution.

i suggest to insert in the first line of the avisynth-script:

SetMemoryMax(128) # for 512MB RAM
or
SetMemoryMax(256) # for >=1024 MB RAM

if you want to remove only a little bit of noise from a high quality movie, please look at RemoveNoiseMC_HQ (http://forum.doom9.org/showthread.php?p=832213#post832213)


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
}


some examples:

for slight noisy video or spot/dirt removing only:


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
}


medium noise, higher grain:


function mq_filter(clip c)
{
c=c.RemoveNoiseMC(rdlimit=10,rgrain=2,denoise=8)
c=c.LimitedSharpenFaster(Smode=4,strength=20,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
return c
}


high noise or analog capture:


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
}


the extreme case with a modded function for high denoise values:


function RemoveHighNoiseMC(clip clip,int "rdlimit", int "rgrain", int "denoise", float "csharp", bool "_grey")
{
rdlimit = default(rdlimit,24)
rgrain = default(rgrain,3)
denoise = default(denoise,15)
csharp = (rgrain>2) ? default(csharp,0.32) : default(csharp,0.28)
_grey = default(_grey, false)
_dgr = 0.7+rgrain*0.5
global idx_c = idx_c + 1
cbs = 8
ccf = cbs*cbs/64
cpn = (denoise>12) ? 50*ccf : 57*ccf
bvec3 = clip.MVAnalyse(isb=false, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec3 = clip.MVAnalyse(isb=true, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = rdlimit>20 ? \
clip.MVFlow(bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(bvec1).Deblock(quant=16, aOffset=4, bOffset=4)
forw1 = rdlimit>20 ? \
clip.MVFlow(fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(fvec1).Deblock(quant=16, aOffset=4, bOffset=4)
clp = interleave(backw1, clip, forw1)
clp = clp.RemoveDirt(rdlimit,rgrain,_grey)
clp = clp.SelectEvery(3,1)
dnc = clp.MVDenoise(bvec3, bvec2, bvec1, fvec1, fvec2, fvec3, thT=denoise, thSAD=160+12*denoise, thmv=40, thSCD1=255+4*denoise)
vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=6, 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")
return csharp==0 ? dnc : clp.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40)
}

function vlq_filter(clip c) {
c=c.RemoveHighNoiseMC(rdlimit=24,rgrain=3,denoise=16,csharp=0.3)
c=c.VagueDenoiser(threshold=1.0, nsteps=6, chromaT=1.2, percent=75)
c=c.deen("a3d",rad=3,thrY=4,thrUV=7,min=0.25,tthY=2,tthUV=3,scd=7)
c=c.LimitedSharpenFaster(Smode=4,strength=28,overshoot=1,wide=false,ss_x=1.2,ss_y=1.2)
return c
}


needed plugins:

Latest MVTools 1.4, DeBlock 1.2 and VagueDenoiser 0.35.1 from Fizick's Page (http://avisynth.org.ru/fizick.html)
RemoveGrain (http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar) pre 1.0
RemoveDirt (http://www.removedirt.de.tf/) 0.9
FluxSmooth 1.1a from warpenterprises (http://www.avisynth.org/warpenterprises/files/fluxsmooth_25_dll_20040729.zip)
SeeSaw (http://home.arcor.de/dhanselmann/_stuff/SeeSaw_2006.01.02.rar) 2006.01.02, therefor MaskTools 1.5.8 (http://manao4.free.fr/MaskTools-v1.5.8.zip)

for my examples
LimitedSharpenFaster (http://www.avisynth.org/LimitedSharpen#LimitedSharpenFaster), therefor MaskTools v2.0a30 (http://manao4.free.fr/masktools-v2.0a30.zip)
deen 1.0 beta 1 (old version)


suggestions for parameter selection:

- set rdlimit=0, denoise=0 and rgrain according to the examples above
- look for a very bad frame
- increase rdlimit until the big noise is gone
- increase denoise until the remaining noise is minimized

- set sharp=true for a video with high resolution of fine details, which you want to encode using a high bitrate
set sharp=false for older film material or tv captures

revisions:

april 19th:
-RemoveHighNoiseMC clean-up
april 20th:
-deen 1.0 beta 1 attachment added
-hints for parameter selection added
-minor removedirt parameter change
may 10th:
- spatial filtering for moving block areas in RemoveDirt
- minor parameter changes
may 29th: deen parameter in vlq_filter example
june 12th:
- improved scene switch behaviour
june 24th:
- minor script error corrected (quality unchanged), thanks to Alain2
august 15th:
- bicubic subpixel interpolation in mvanalyze. much better sharpness thanks to Fizick new MVTools!
august 16th:
- adjustments for sharp subpixel interpolation
november 28th:
- sharp option for sharp subpixel interpolation added for manual selection
.

Heini011
16th April 2006, 23:48
sample picture: vlq_filter

danpos
16th April 2006, 23:51
@Heini011

Hi there! It seems quite interesting, so thanks for share it with us. I just have a suggestion: posting all filters dependencies in order to get the script working, because of maybe some users can to have some difficulty to know what filters/versions are necessary to get it working properly.

Cheers,

danpos
17th April 2006, 01:50
@Heini011

Well done, thanks! :)

Cheers,

Heini011
17th April 2006, 13:18
sample picture: lq_filter

Heini011
17th April 2006, 13:35
sample picture: hq_filter
(from a pre version of this filter, not exactly the same...)

danpos
17th April 2006, 19:13
@Heini011

Good examples. They show that the propers 'filters' perform a really good job on the 'dusts' in each case ...

Cheers,

Alain2
18th April 2006, 22:45
Thanks Heini011 for sharing your script, it proves to be rather good on some materials I have and was struggling on with other methods ; motion compensation seems to be very efficient at keeping details while doing a good job at denoising!

[edit] I just noticed you changed the vlq_filter from the initial one, introducing the RemoveHighNoiseMC, and also you changed denoise=6 to denoise=0 in the hq_filter... If you make other mods in the future, please let us know or we will miss them ^^

rfmmars
19th April 2006, 07:22
Thank for the great documentaion that is ever so missing in some other posts. It help a dumby like me.

Richard

foxyshadis
19th April 2006, 13:17
Another thing I can suggest is to package it into a single file, so people can just download it right to their avs folder. You're more than welcome to upload it to avisynth's wiki and link it from there (though the link will change anytime you update your script, except when linking from the wiki), or you can ask richard for a bit of space. I have a video I'd like to test this out on soon!

Morpheus_xx
19th April 2006, 15:08
Great functions! I tried it for my tv-capture and I really like the results!

During encoding on my AMD X2 dual core cpu, the load goes only up to 58%.

Could somebody tell me, where in the script I could put the "SetMTMode" commands properly, so that it can be faster?

I tried this, but got green dots over the image:

SetMTMode(2)
mq_filter()


Any suggestions?

Alain2
20th April 2006, 00:19
I didn't have a problem without the deblock function from fizick, but I realize that i have also dgdecode.dll in avisynth plugins directory, which contains a deblock() function as well ; maybe it could be a good idea to rename one of these functions to avoid confusion between the 2 (as it's likely that a lot of people have dgdecode.dll in their plugins), or maybe change the script for deblock functions, to be called with the syntaxe deblock_deblock() to specifically call fizick'dll deblock function... (This is probably not a real issue as from fizick's and neuron2's changelogs it appears they didn't really touch manao's core deblock function)

Heini011
20th April 2006, 01:12
Hi,

for thresholds > 0.6 fft3dfilter makes a better job than vaguedenoiser. here is an example for an improved vlq_filter:


function vlq_filter_ultimate(clip c) {
c=c.RemoveHighNoiseMC(rdlimit=24,rgrain=3,denoise=16)
c=c.fft3dfilter(sigma=1.2, sharpen=0.4, plane=4)
c=c.deen("a3d",rad=3,thrY=4,thrUV=7,min=0.25,tthY=2,tthUV=3,scd=7)
return c
}


needed plugins:
fft3dfilter185.zip (http://avisynth.org.ru/fft3dfilter/fft3dfilter185.zip), therefor fftw3.dll (ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip)


@Morpheus_xx:

SetMTMode(2) should, according to avisynth documentation, be in the first line of your avs-script to support multi-threading.

@moderator:

please approve my deen 1.0 beta 1 attachmend in the first post.

greetings.

Morpheus_xx
20th April 2006, 07:13
@Morpheus_xx:

SetMTMode(2) should, according to avisynth documentation, be in the first line of your avs-script to support multi-threading.


yes, I know. But this gives me green dots over the image...

I think one of the many used filters does not work so well with MTMode(2). That why I've asked where to "tweak" these functions.

Mr. Brown
20th April 2006, 13:08
@ Heini011
thank you for RemoveNoiseMC it's good

aBra
20th April 2006, 14:12
I can't use the script with the latest MVTools 0.9.9.1. :(

foxyshadis
20th April 2006, 19:41
That's the latest pre-1.0 version. You need 1.1 (http://www.avisynth.org/fizick/mvtools/mvtools.htm).

Alain2
20th April 2006, 23:14
1.2.2 (http://avisynth.org.ru/mvtools/mvtools.html) (with deblock removed from package and left in the separate plugin, as described in the needed plugins in the first post) ; use the links provided by Heini011 to find the correct plugins versions

Wilbert
21st April 2006, 08:32
@Heini011,

I approved your attachment. I'm sorry that I didn't notice it.

Disabled
21st April 2006, 16:55
Well it took me some time to get it running, but now I got it and its a fantastic script!
I did a quick test with chapter 29 from Matrix and everything looked great, besides this:
http://img359.imageshack.us/img359/9139/orig5aa.th.png (http://img359.imageshack.us/my.php?image=orig5aa.png) http://img57.imageshack.us/img57/9381/rnmc3qg.th.png (http://img57.imageshack.us/my.php?image=rnmc3qg.png)
There is a flashlight in red for just one frame and it gets detected as dirt. I'm impressed by the quality, as even the face is cleared from the light. Really, this is no BS, no color conversion between the both and no other tuning, this is just RNMC working!
I'm using the mq_filter preset...

*edit*
some more examples:
http://img192.imageshack.us/img192/9641/orig21ea.th.png (http://img192.imageshack.us/my.php?image=orig21ea.png) http://img160.imageshack.us/img160/5318/rnmc21zp.th.png (http://img160.imageshack.us/my.php?image=rnmc21zp.png)

http://img100.imageshack.us/img100/8537/orig34cd.th.png (http://img100.imageshack.us/my.php?image=orig34cd.png) http://img154.imageshack.us/img154/8467/rnmc33rk.th.png (http://img154.imageshack.us/my.php?image=rnmc33rk.png)

Conclusion: This might be a pretty cool script for slow movies, but extreme action and fog is a no no, as it kills major detail
And by the way: I'm using the mq preset as hq didn't remove enough noise. But I'm trying my own settings now.

Fizick
21st April 2006, 22:13
Small comment. Generally, I prefer do not use too many (>2) denoisers in one chain of script. Every denoiser kills some details, and deforms noise spectrum - some denoisers are developed to deal with un-denoised video.
And whole noise removal is not optimal (at least for non-anime video).

Alain2
22nd April 2006, 01:31
I agree for the lower qual filters were deen is involved for instance, but nethertheless I am still impressed by what can be achieved with this motion denoising script; I used the hq filter on a grainy film I had and wanted to denoise with the least detail loss, and this filter chain gave me the best compromise :) And on animation the low settings are rather good as well

I've avoided so far diving into the mvtools, I mostly used the masktools for playing with my scripts, I think I'll start having a look to the mvtools as well ;)

Disabled
22nd April 2006, 09:49
After trying a lot more settings I think that any rdlimit over 2 kills small objects just flashing in, like the reflections in my second set of screens.
You wont notice it until you know what is missing, but that is too much for me.
rdlimit=2,rgrain=1,denoise=4 still kills detail in the rocks in set 2 & 3 but its a fast action scene and you wont notice anyway. And it kills some major noise in still scenes. I think I'll encode some more with these settings!
*edit*
Oh and with 2-3 fps its kinda fast for me :)

Heini011
22nd April 2006, 13:25
@Disabled

pleae notice my small paramester selection guide, added in the first posting.

rgrain=3 is aimed only for analog capture or really poor quality sources. for high quality sources you could trying to set cpn=75*ccf in the script.

flashing in objects are in conflict with the aim of dirt dection/removing. this script is not aimed for high quality action movies. use the mvdenoise part of this script instead.

@Fizick:
good denoising is not only a matter of taste but means high compressibility too. therefore we need temporal and spatial filtering. a single temporal filter is hardly good enough for very strong noise. deen with weak parameters is a good extension for vaguedenoiser, cause it removes some dirt on bigger homogeneous surfaces.

Disabled
22nd April 2006, 19:12
Yeah thanks Heini, I already noticed your parameter guide, but As I said I notice major object deletion with settings as low as rdlimit=3,rgrain=1,denoise=3. With rdlimit=3,rgrain=0,denoise=0 still some objects get removed.
Oh and with rdlimit=0 objects get removed too. I guess thats some bug, as its as strong as with rdlimit>=3
I experimented with the rest of the script too, but I think I still have a long way to go, but results are quite promising.
Thanks a lot for the script!

hartford
3rd May 2006, 03:15
I tried this two ways; progressive works, interlaced gives exception. Perhaps an avisyth problem?

I'm using Avisynth v2.5.6.0

This causes an Avisynth exception:

LoadPlugin("d:\plugins\mt_masktools_2.0a28.dll")
LoadPlugin("d:\plugins\MaskTools-1.5.8.dll")
LoadPlugin("d:\plugins\Deen.dll")
LoadPlugin("d:\plugins\FluxSmooth-1.1.dll")
LoadPlugin("d:\plugins\mvtools-1.2.2.dll")
LoadPlugin("d:\plugins\RemoveDirt-0.9.dll")
LoadPlugin("d:\plugins\RemoveGrainS-09.dll")
LoadPlugin("d:\plugins\Repair-09.dll")
LoadPlugin("d:\plugins\VagueDenoiser-0.35.1.dll")
LoadPlugin("d:\plugins\deblock-1.2.dll")
LoadPlugin("d:\plugins\RemoveGrainS-1a.dll")

import("d:\plugins\import\RemoveNoiseMC.avsi")
import("d:\plugins\import\SeeSaw.avsi")

avisource("d:\ALL_This.avi").convertToYV12(interlaced=true)

separatefields()
Selectodd().RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=6)
Selecteven().RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=6)
Weave()

==

If I remove the "separatefields()" stuff, it works.

I'm not saying that there is anything "wrong" with your script.

What version of Avisynth are you using?

Mr. Brown
3rd May 2006, 20:20
Yeah thanks Heini, I already noticed your parameter guide, but As I said I notice major object deletion with settings as low as rdlimit=3,rgrain=1,denoise=3. With rdlimit=3,rgrain=0,denoise=0 still some objects get removed.
Oh and with rdlimit=0 objects get removed too. I guess thats some bug, as its as strong as with rdlimit>=3
I experimented with the rest of the script too, but I think I still have a long way to go, but results are quite promising.
Thanks a lot for the script!

The removed object's is not a bug it's a problem that affect all Dirt removers.
The big problem for the filter is to difference in middle - high motion what is Dirt and what is Object/Detail.
In the end you must live with a compromise between Dirt Remove and Object/Detail Lost.

DarkNite
12th May 2006, 08:34
I have to say this gives amazing results with animated sequences. Well, it is not so kind to CGI in high motion when certain effects are used, but that's to be expected. Thankfully there's always filtering by section as a scripting option.

The hq settings almost always play nicely with content imported from my camera, and that's my main concern. With some simple tweaking this is very versatile. Nicely done.

Heini011
25th May 2006, 11:59
Hi folks,

i wrote a simpler and less brutal script function for denoising modern high quality movies. it was aimed as a better replacement for mvdenoise.

you can modify the mvtools blocksize:
cbs = 4 sometimes better denoising caused by better block-matching, less blocking
cbs = 8 much faster and may preserve slightly more sharpness



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

function RemoveDirt_HQ(clip input, int tlimit, int rgrain, bool "_grey")
{
_dgr = 0.4+rgrain*0.25
clensed = input.RemoveTempGrain(1).FluxSmoothST(tlimit,rgrain)
restore = input.VagueDenoiser(threshold=_dgr, nsteps=6, chromaT=_dgr, percent=100).RemoveGrain(1)
alt = restore
return RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, pthreshold=3+2*rgrain, cthreshold=3+2*rgrain, gmthreshold=40, dist=1, dmode=1, debug=false, noise=tlimit+1, noisy=12, grey=false)
}

global idx_c = 4

function RemoveNoiseMC_HQ(clip,int "tlimit", int "rgrain", float "csharp")
{
tlimit = default(tlimit,4)
rgrain = default(rgrain,1)
csharp = rgrain>1 ? default(csharp,0.14) : default(csharp,0.13)
global idx_c = idx_c + 1
cbs = 4
ccf = cbs*cbs/64
cpn = tlimit>6 ? 70*ccf : 75*ccf
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=1, overlap=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=1, overlap=0, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = clip.MVFlow(bvec1, idx=idx_c)
forw1 = clip.MVFlow(fvec1, idx=idx_c)
dnc = interleave(backw1,clip,forw1)
dnc = dnc.RemoveDirt_HQ(tlimit,rgrain)
dnc = dnc.SelectEvery(3,1)
return csharp==0 ? dnc : \
clip.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40)
}



function hqfilter(clip c)
{
c=c.RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
c=c.LimitedSharpenFaster(Smode=4,strength=15,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
return c
}


27. may: very small update @ seesaw

Alain2
25th May 2006, 20:49
I will try :)

Question: Am I obliged to put global idx_c = 4 ? it was 25 in the previous functions you gave, and as I understand it this number is just a ref number for idx in mvtools, so it's starting point not very important ? (I ask because I want to keep all your functions in the same .avsi)

Heini011
25th May 2006, 21:54
Hi Alain2,

the only importance for idx_c is this: there shouldn't be another mvtools function call in your avisynth script with the same idx value.

Clown shoes
27th May 2006, 11:33
Hi there. Please excuse my scripting ignorance, but I am having a problem with the usage of the simple script. My .avs is reporting; There is no function named "TemporalRepair" I am imagining this is due to incorrect usage rather than incorrect .dlls, although I could be wrong. I am trying to use this in conjunction with LimitedSharpener. My script is as follows;

Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avsi")
import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseSimple.avsi")
import("C:\Program Files\AviSynth 2.5\plugins\SeeSaw.avsi")
avisource("E:\test.avi", audio=false)
#colorMatrix()
AssumeFPS(24,1,true)
#addborders(0,32,0,32)
Levels(0, 1.2, 255, 0, 255)
Tweak(bright=1.3, sat=1.2, cont=1.05 )
RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
LimitedSharpen(dest_x=368,dest_y=208,ss_x=1.5,ss_y=1.5,Smode=3,strength=100,wide=true,special=true)


Would someone be good enough to point out where I am going wrong.

Thanks in advance

Rich

Alain2
27th May 2006, 12:56
Look at the first post of this thread, the needed plugins section

Clown shoes
27th May 2006, 13:16
I have them all in my plugins folder as far as I can tell. Is TemporalRepair refering to the lack or non functioning of a particular plugin?

foxyshadis
27th May 2006, 14:09
Repair.dll and its auxillaries are in the removegrain.rar linked in the first post. You may also need SSETools from the official 0.9 (http://home.pages.at/kassandro/RemoveGrain/RemoveGrain.zip).

myck
27th May 2006, 17:48
This is the best script for denoise I've ever used and with a good speed also. But I want an advice. I use this especialy on low light videos from my pal camera (the ones in day light doesn't have much noise). So please tell me which are the best settings for using with videos on low light and what ways are you using for bright the videos (I use HDRAGC for now with good results, but I want to know if is something better). Thank you.

Heini011
27th May 2006, 22:37
Hi Clown shoes,

foxyshadis answered already: you need the Repair.dll from RemoveGrain 1.0 pre package, linked in the first posting of the removenoisemc thread. if it still doesn't work, copy RepairS.dll in your avisynth plugin directory.

hi myck,

all filters used in my script have absolute thresholds. so there is little to tweak for low light scenes, sadly. but you could use didee's great ylevels script to enhance the brightness.

greetings.

Clown shoes
28th May 2006, 01:35
Thanks guys, yes that works. I also had to move the dlls out of the Avisynth plugin folder, as they were conflicting with other dlls and causing a crash each time I opened a script. I do have one other question though. Your script calls on the SeeSaw script. Does that then make my use of Limited Sharpen redundant, or am I getting myself a little confused.

I am using your simple action script with cbs = 8

and my script is now;

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\Deen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\FluxSmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\RemoveDirt.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\RemoveGrainS.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\Repair.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\VagueDenoiser.dll")


Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseSimple.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\SeeSaw.avsi")


avisource("E:\test.avi", audio=false)
#colorMatrix()
AssumeFPS(24,1,true)
#addborders(0,32,0,32)


Levels(0, 1.2, 255, 0, 255)
Tweak(bright=1.3, sat=1.2, cont=1.05 )


RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
LimitedSharpen(dest_x=368,dest_y=208,ss_x=1.5,ss_y=1.5,Smode=3,strength=100,wide=true,special=true)

I am using your Remove noise script instead of; hqdn3d(3,2,4,4,5)

Could you see any purpose to using both denoisers, or is that just unnecesary overkill?


Sorry. I forgot one more stupid question. I am a little new to using longer complicated scripting, and I am confused by the addition at the end of your script of these lines;

c=c.RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
c=c.LimitedSharpenFaster(Smode=4,strength=15,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
return c

Are they active in the script? And does that mean I can just make my adjustments to Limited Sharpen within your Remove Noise script?

Apologies if these are very stupid questions. I am still quite new to this and there is quite a steep, initial learning curve.


Thanks again

Clown Shoes

:stupid:

DarkNite
28th May 2006, 06:57
I am using your Remove noise script instead of; hqdn3d(3,2,4,4,5)

Could you see any purpose to using both denoisers, or is that just unnecesary overkill?

I'm almost certain that would be overkill, but you could always try it and compare.


I am confused by the addition at the end of your script of these lines;

c=c.RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
c=c.LimitedSharpenFaster(Smode=4,strength=15,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
return c

Are they active in the script? And does that mean I can just make my adjustments to Limited Sharpen within your Remove Noise script?

Generally a function or plugin call that isn't commented out, and is followed by a return call is active.

Just comment out the original LimitedSharpenFaster line, and create a dupicate line in your script. Edit the duplicate line in the script to match your destination settings. If that doesn't work well enough for you then start adding your other settings in as well.

Example:

#c=c.LimitedSharpenFaster(Smode=4,strength=15,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
c=c.LimitedSharpenFaster(dest_x=368,dest_y=208,Smode=4,strength=15,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)


That way you won't lose the original line if something goes wrong or you're not pleased with the results.

Clown shoes
28th May 2006, 12:10
Thank you for your help Darknite, but I am clearly still doing something wrong! If I comment out the function lines in my script and use the lines in the remove grain script, neither lines work and the file plays unfiltered! If I comment out the lines in the remove grain script and replace them in mine, it seems to work properly. I'm sure I should just be thankful I can get the filters working, but I want to understand what it is that's going wrong. If I post up the two scripts that are not working, maybe someone could point out where I am going wrong?

My Script;

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\Deen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\FluxSmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\RemoveDirt.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\RemoveGrainS.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\Repair.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Remove Noise Simple\VagueDenoiser.dll")


Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseMC.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\SeeSaw.avsi")


avisource("E:\test.avi", audio=false)
#colorMatrix()
AssumeFPS(24,1,true)
#addborders(0,32,0,32)


Levels(0, 1.2, 255, 0, 255)
Tweak(bright=1.3, sat=1.2, cont=1.05 )


#RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
#LimitedSharpenFaster(dest_x=368,dest_y=208,ss_x=1.3,ss_y=1.3,Smode=3,strength=100,wide=true,special=true)


Remove Noise Script

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

function RemoveDirt_HQ(clip input, int tlimit, int rgrain, bool "_grey")
{
_dgr = 0.35+rgrain*0.2
clensed = input.RemoveTempGrain(1).FluxSmoothST(tlimit,rgrain)
restore = input.VagueDenoiser(threshold=_dgr, nsteps=6, chromaT=_dgr, percent=100).RemoveGrain(1)
alt = restore
return RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, pthreshold=3+2*rgrain, cthreshold=3+2*rgrain, gmthreshold=40, dist=1, dmode=1, debug=false, noise=tlimit+1, noisy=12, grey=false)
}

global idx_c = 4

function RemoveNoiseMC_HQ(clip,int "tlimit", int "rgrain", float "csharp")
{
tlimit = default(tlimit,4)
rgrain = default(rgrain,1)
csharp = (rgrain>1) ? default(csharp,0.28) : default(csharp,0.26)
global idx_c = idx_c + 1
cbs = 8
ccf = cbs*cbs/64
cpn = (tlimit>6) ? 72*ccf : 76*ccf
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = clip.MVFlow(bvec1, idx=idx_c)
forw1 = clip.MVFlow(fvec1, idx=idx_c)
dnc = interleave(backw1,clip,forw1)
dnc = dnc.RemoveDirt_HQ(tlimit,rgrain)
dnc = dnc.SelectEvery(3,1)
return csharp == 0 ? dnc : \
dnc.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40)
}



function hqfilter(clip c)
{
c=c.RemoveNoiseMC_HQ(tlimit=4,rgrain=1)
#c=c.LimitedSharpenFaster(Smode=4,strength=15,overshoot=1,wide=false,ss_x=1.3,ss_y=1.3)
c=c.LimitedSharpenFaster(dest_x=368,dest_y=208,ss_x=1.3,ss_y=1.3,Smode=3,strength=100,wide=true,special=true)
return c
}

I'm sure, I'm doing something silly wrong here, but I would like to understand what that is, so as I can learn more about quality scripting.

The only other thing I am confused about is the use of SeeSaw in the Remove Noise Script. Is it actually being called upon?

Heini011
28th May 2006, 12:56
Hi Clown shoes,

you have marked out the calls to RemoveNoiseMC_HQ and LimitedSharpenFaster with the fist '#' character. please take a look in the avisynth documentation for such questions!

LimitedSharpenFaster doesn some other kind of sharpening as SeeSaw, which i use mainly for detail enhancement. just try it out.

Clown shoes
28th May 2006, 14:57
Sorry Heini011, I don't think I am explaining myself properly. I was trying to follow what Darknite said and adapting the functions at the end of your RemoveNoise script. I deliberatly commented them out in my script to see if they are active at the end of the RemoveNoise script. Would I be right in thinking, you are telling me the end of the RemoveNoise script is there purely as a guide to what I should be using in my script?

I hope I am on the right lines here. Do you think someone might be able to show me an example of one of thier scripts? I'm sorry if I'm still asking stupid questions but this seems like such a good filter and I would love to get it working correctly.

Please tell me if you feel I am clogging up the thread with my questions, as I really don't want to be a pain. :o

foxyshadis
28th May 2006, 15:44
The line you replaced is encapsulated in a function, which is never used unless you explicitly call it. You must either add hqfilter() in your main script, or uncomment the two lines which do the exact same thing anyway.

Clown shoes
28th May 2006, 15:57
Thanks so much Foxyshadis. It all makes perfect sense now and better still, the script works perfectly! :D

What I was failing to do was call the function in my main script with hqfilter() Obvious when it's spelt out for you :rolleyes:

I shall now have much fun tweaking this great looking filter.

Thank you one and all for you patience.

ClownShoes

:thanks:

ObeewanVOB
28th May 2006, 18:10
All I can say Heini is :eek: ! I've been trying to use a combination of filters to help improve some captures with "acceptable" but not great results so far. I was just starting to toy around using Didee's SeeSaw function until I came along this. Obviously there is no way to make an old and degrading analog transfer look perfect but with the functions and examples you've provided here alone it's a night and day difference! Keep it up guys, my many thanks to you and Didee!

demonicos
29th May 2006, 05:41
Id like to say to Heini011 that this is a bloody awesome script although im not too familiar with it all and probably have the wrong settings but the results im seeing in TORA TORA TORA are incredible and is worth the 4-6 fps im getting ;)

Alain2
23rd June 2006, 22:36
I've just lost a few hours understanding what was wrong in my script (I had strange errors, and initially thought it was because i was doing directshouwsource on a wmv9 I420 file, which I never done before), but in the end the problem was coming from the scripts here : function RemoveNoiseMC(clip,....
should be replace by function RemoveNoiseMC(clip clip,......
Strangely I never had any problem from mpeg2source clips, but it wasn't working with the wmv9 yv12 clip imported from directshowsource ; in case it helps others ;)

Heini011
24th June 2006, 19:44
Hi,

@Alain2,
thank you for your hint! strange, this error caused no problems for me.

@all:

i added a few lines for a improved scene-change behaviour. further filter improvements would require a replacement of vaguedenoiser. any suggestions for a still better pure spatial anti-grain denoiser ?

deblock is not very effective also, but fortunately not very important for this script.

greetings.

Eretria-chan
25th June 2006, 16:31
I just tried this, but I get a syntax error in LimitedSharpFaster.avs, line 30, column 19. I copied all the code for LimitedSharpenFaster from the link into that script but as I import it, I get syntax error.
This filter looks really nice and I'd love to try it out, but this syntax error keeps me from doing it. I have no idea why it fails. Can anyone help?

Adub
25th June 2006, 17:47
What exactly is your error?
Are you sure that you have all of the required plugins to run the filter smoothly?

Eretria-chan
25th June 2006, 17:49
Did I not write that?
I get a syntax error in LimitedSharpFaster.avs, line 30, column 19
To my knowledge, I have everything, but it IS hard to know... those problems might just manifest themselves later, though. I must first fix that syntax error to get it to work.

Heini011
25th June 2006, 23:11
hi Eretria-chan,

i can't understand the problem. line 30 in LimitedSharpenFaster is a blank line, followed by some default-assignments. make sure, you have the right version of LimitedSharpenFaster and all plugins mentioned in the first post (for LSF Removegrain 1.0 beta, Removegrain 0.9, Masktools2 > 2a20). Backup and clear your avisynth plugin directory and download all plugins from the first post again.

i suggest to use in the first line of your script
SetMemoryMax(128); if you have 512MB RAM
SetMemoryMax(256), if you have >=1024 MB

greetings.

Eretria-chan
25th June 2006, 23:16
I downloaded LimitedSharpenFaster from here: http://www.avisynth.org/LimitedSharpen#LimitedSharpenFaster
I do not know; perhaps I have a faulty version?

foxyshadis
25th June 2006, 23:24
http://www.avisynth.org/mediawiki/wiki/LimitedSharpen

They should be the same, though, I don't remember modifying either, and line 30 should be blank in both. Unless you stripped out the comments?

The above wiki is the new one, everything in the old is deprecated if there's an entry in the new one for it (which is most of the stuff now).

Eretria-chan
26th June 2006, 01:27
That did indeed do the trick! It works now!
UPDATE: Ahaha... I actually forgot to enable the script. No, it isn't working just yet, but the syntax error is gone.
UPDATE2: Got it to work now. But unfortunaly, it SLOW! :/ Is there anyway to make this work to watch video with it enabled?

foxyshadis
26th June 2006, 04:57
This makes for a mostly realtime filter:
LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,Smode=4,strength=120,soft=30)

Remove soft for a little more speed. I'll edit the wiki. But LSF is right on the scripty border between realtime and too slow. If it's too slow, try ffdshow's sharpeners instead.

Didée
26th June 2006, 08:02
I guess Eretia-chan wanted to get RemoveNoiseMC running faster, not LimitedSharpen ...

Answer: No, no way.

And FYI: For what this script actually is doing, in fact it is pretty fast! (--> Get a clue of the things you're using ...)

Eretria-chan
26th June 2006, 09:09
Didée: I have no idea how fast the script is supposed to run. I have no idea in what is involved in getting it running. It's only a shame I can't run it realtime, even with a powerful processor. Though if it could run on the gpu, it would help.

foxyshadis
26th June 2006, 09:35
Just looking at what's inside should give you an idea... 2x motion compensation, alone quick way to triple processing time; 3 vaguedenoisers, seesaw, fluxsmooth, cleanse, repair, removedirt, and a couple of random padding filters to ensure that it never rises above 1fps. (If you look closely there's a code: the third letter of every third filter, when unjumbled, spells out "cpu killer"...)

Eretria-chan
26th June 2006, 09:39
I wouldn't know. I don't know whatever is going on in the script. I use it and that's enough for me. But I believe you on the cpu killer part. SmoothUV + this script results in ~4 fps when encoding with huffy :plain:
It's time likes this I really would like if there was an option to use the GPU as well :D

Heini011
26th June 2006, 12:19
for better performance you can

1. set denoise = 0

a fraction of the originally noise will remain then

2. modify cbs = 8 to cbs = 16

this degrades denoise-performance for motion parts, but could be effective for low quality movies with much noise.

if you have a high quality movie with only litte noise, take RemoveNoiseMC_HQ (http://forum.doom9.org/showthread.php?p=832213#post832213)

Revgen
21st July 2006, 20:16
Here is a .zip file with all plugins and scripts packaged and linked for RemoveNoiseMC and RemoveNoiseMC_HQ. Just extract the RemoveNoiseMC folder and import RemoveNoiseMC.avs into your script.

http://rapidshare.de/files/26631643/RemoveNoiseMC.zip.html

Deblock 1.2 - Fizick - http://avisynth.org.ru/mvtools/deblock.html
Vague Denoiser 0.35.1 - Fizick - http://avisynth.org.ru/vague/vaguedenoiser.html
RemoveGrain pre 1.0 - Kassandro - http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar
RemoveDirt 0.9 - Kassandro - http://www.removedirt.de.tf/
Fluxsmooth - warpenterprises - http://www.avisynth.org/warpenterprises/files/fluxsmooth_25_dll_20040729.zip
SeeSaw - Didee - http://home.arcor.de/dhanselmann/_stuff/SeeSaw_2006.01.02.rar
Masktools 1.5.8 - Manao - http://manao4.free.fr/MaskTools-v1.5.8.zip
LimitedSharpenFaster - Didee, Clouded - http://people.pwf.cam.ac.uk/mg262/posts/
Masktools 2.0a30 - Manao - http://manao4.free.fr/masktools-v2.0a30.zip
deen 1.0 beta 1 - MarkFD? - No source link known.

Fizick
21st July 2006, 23:12
Please read info about plugins re-distribution:
http://forum.doom9.org/showthread.php?p=812638#post812638

Revgen
21st July 2006, 23:51
Please read info about plugins re-distribution:
http://forum.doom9.org/showthread.php?p=812638#post812638

Do you want me to remove the link?

I never found source code in any of the binaries I downloaded. If you have the source code to your plugins, I'll add them.

Wilbert
21st July 2006, 23:54
From that Fizick's link:
Our case is case (c).
So, if you downloaded some GPL binary WITHOUT source (for example Avisynth2.56, which have separate source archive package), you may distribute it without a source too.
Yes, but only if you include that offer to distribute the source (or if you include a link to the source).

But if you downloaded some GPL binary WITH a source in one zip package, you must distribute whole package (with source).
No, that's not what it says. You can remove the source and put it in a different package and distribute it. You can remove the source and replace it by a link to it (you don't need to host it yourself, but it should be the same version of course).

@Revgen,

Adding links to the source code is sufficient.

Revgen
22nd July 2006, 00:01
@Revgen,

Adding links to the source code is sufficient.

Some of them don't have any source code. The Deen beta Heini posted is one of them. I'll try to do the best I can.

Wilbert
22nd July 2006, 00:05
The Deen beta Heini posted is one of them.
Yes, one of the few which is closed source :)

Revgen
22nd July 2006, 00:17
Links posted.

Didée
22nd July 2006, 01:11
Regarding LimitedSharpen/Faster & SeeSaw - thanks for the honor, but these Avisynth scripts come without any license, AFAIK. :D
(The scripts are the sources, so it's not necessarily needed to link them seperately. They are free as can only be. :) )

Fizick
22nd July 2006, 02:30
Wilbert,
Of course, it is not very important, but I disagree. :)
Link to my site is not sufficient. :)
The link must be to SAME place, as link to binary.

See:

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

Revgen
22nd July 2006, 06:54
Regarding LimitedSharpen/Faster & SeeSaw - thanks for the honor, but these Avisynth scripts come without any license, AFAIK. :D
(The scripts are the sources, so it's not necessarily needed to link them seperately. They are free as can only be. :) )

Your right that SeeSaw didn't need to be mentioned. But I decided to anyway.:)

However, LimitedSharpenFaster does need to be mentioned since it comes with Clouded's LimitedSupport.dll .

foxyshadis
22nd July 2006, 08:36
Eh? Since when? That was folded into MaskTools2 over 6 months ago...

Make sure you included the one from http://avisynth.org/mediawiki/wiki/LimitedSharpen

As to fizick's objection, you may want to reupload the archive with a text file including the stuff you added to your post. Or a text file with each (although you should at least be inlcuding the documentation files anyway, which generally have links in them).

Revgen
22nd July 2006, 16:20
Eh? Since when? That was folded into MaskTools2 over 6 months ago...

Make sure you included the one from http://avisynth.org/mediawiki/wiki/LimitedSharpen

As to fizick's objection, you may want to reupload the archive with a text file including the stuff you added to your post. Or a text file with each (although you should at least be inlcuding the documentation files anyway, which generally have links in them).

I've already updated the Readme.txt in the .zip file.

Wilbert
22nd July 2006, 18:57
@Fizick,

Perhaps you are right, but does that mean that 'equivalent access to copy the source code from a different place' doesn't count as distribution of the source code? It's an interpretation of language thingie, but it doesn't seem to exclude this according to me.

Fizick
22nd July 2006, 20:17
Wilbert,
consider example:
I have web site with binary and source.
You have your web site with binary only, and point link to source at my site.
Suppose I destroy my site :)
You link to source will be broken.
I must not support your link to source.
That is why (IMHO), GPL say about SAME place.

But generally I the mostly dissappointed, when people remove documentation from binary packages. It make dowloaders illiterate.

Pookie
22nd July 2006, 21:49
Per foxyshadis comment

http://forum.doom9.org/showthread.php?p=768220#post768220

Wilbert
22nd July 2006, 21:50
Fizick, I agree that it makes sense and that this was probably the intension of that sentence, but that was not my point. Let's forget about it :)

halsboss
24th October 2006, 10:48
Hi folks, i wrote a little script function ...


Was referred here from topic "Help improving a bad quality recording" http://forum.doom9.org/showthread.php?p=891398#post891398

Just to be sure, are the scripts in the 1st post of this thread indeed the latest up-to-date ones (or do I have to walk this thread picking out updates) ?

Bad_cap
24th October 2006, 11:53
I tried this two ways; progressive works, interlaced gives exception. Perhaps an avisyth problem?

I'm using Avisynth v2.5.6.0

This causes an Avisynth exception:

LoadPlugin("d:\plugins\mt_masktools_2.0a28.dll")
LoadPlugin("d:\plugins\MaskTools-1.5.8.dll")
LoadPlugin("d:\plugins\Deen.dll")
LoadPlugin("d:\plugins\FluxSmooth-1.1.dll")
LoadPlugin("d:\plugins\mvtools-1.2.2.dll")
LoadPlugin("d:\plugins\RemoveDirt-0.9.dll")
LoadPlugin("d:\plugins\RemoveGrainS-09.dll")
LoadPlugin("d:\plugins\Repair-09.dll")
LoadPlugin("d:\plugins\VagueDenoiser-0.35.1.dll")
LoadPlugin("d:\plugins\deblock-1.2.dll")
LoadPlugin("d:\plugins\RemoveGrainS-1a.dll")

import("d:\plugins\import\RemoveNoiseMC.avsi")
import("d:\plugins\import\SeeSaw.avsi")

avisource("d:\ALL_This.avi").convertToYV12(interlaced=true)

separatefields()
Selectodd().RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=6)
Selecteven().RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=6)
Weave()

==

If I remove the "separatefields()" stuff, it works.

I'm not saying that there is anything "wrong" with your script.

What version of Avisynth are you using?

I'm also trying to process an interlaced capture. AvsP (or Virtualdub) just dies after trying preview with this script.

Any advice for us fighting with interlaced material?

Didée
24th October 2006, 12:56
Just poking in the blue, but could the problem be related to "clense(.. , cache=4)" in the internal RemoveDirt() function?
(I never liked (nor fully understood) kassandro's invention of "cache slots", and also not too much the additional dll to put into \system32.)

Try either with an older version of clense.dll (and remove that 'cache=' thingy), or try like this:

order = (GetParity == True) ? 0 : 1
separatefields()
Selecteven() + selectodd()
RemoveNoiseMC(rdlimit=6,rgrain=1,denoise=6)
interleave( trim(0,(framecount()-1)/2) , trim((framecount()+1)/2,0) )
(order==0) ? AssumeTFF() : AssumeBFF()
Weave()

pvann
24th October 2006, 13:13
Bap_Cap: I have just come across RemoveNoiseMC too and have had some great success so far with interlaced PAL (Australia) taken indoors in 1989 on VHS camera. This is script I used:

import("D:\.....\RemoveNoise_Filter.avsi")
AVISource("cap.avi")
AssumeBFF()
Bob(0,0.5)
converttoYV12()
vlq_filter_ultimate()
SeparateFields()
SelectEvery(4,0,3).Weave()

where RemoveNoise_Filter.avsi contains all the script functions in the first post

This is very slow on my Pentium 3Ghz, 1GB RAM WinXP at around 1fps but results are very promising so I'll play around with the parameters in the vlq_filter_ultimate function as suggested by Heini011 in the first post. The closest I got to this quality so far on poor VHS capture is using the trial of NeatVideo in VirtualDub, but it took some time to get the noise "image" since my video didn't have large enough plain areas.


Note: I also used DePanStabilise previously to take out some of my camera shake

mdata=DePanEstimate(clip2,pixaspect=1.094,range=1,trust=1)
clip2=DePanStabilize(clip2,data=mdata,dymax=30,dxmax=60,\
cutoff=1,pixaspect=1.094,damping=1)

I understand it is best to do Stabilise prior to denoising, any comments welcome.

Bad_cap
24th October 2006, 21:45
Thanks for the tips. I try to combine the stabilizer and filtering:


AssumeTFF()
ConverttoYV12(interlaced=true)
mdata = DePanEstimate(dxmax=40, dymax=20)
DePanStabilize(data=mdata, dxmax=40, dymax=20)
Bob(0,0.5)
vlq_filter_ultimate() <- Should this actually be after separatefields?
SeparateFields()
SelectEvery(4,0,3).Weave()
Crop(32,8,-32,-16).AddBorders(32,8,32,16)

pvann
24th October 2006, 23:24
Bad_cap: I do DePanEstimate & DePanStabilize after the Bob().

I found that the default trust =4 in dePanEstimate resulted in a couple of "jumps" in my video unrelated to scene changes so I varied it until the jumps went, trust = 1. I imagine that that parameter is video specific.

Does anybody know how the Trust parameter works? A google search didn't help.

canuckerfan
13th November 2006, 09:46
will RemoveNoiseMC_HQ remove dust/spots as well?

halsboss
31st December 2006, 08:39
Hmm, 1st time tried to use it and Script error: there is no function named "RestoreMotionBlocks"
The plugins seem to be loaded.

Edit: fixed

halsboss
31st December 2006, 08:47
Please, what does this do in the example above ?
SeparateFields()
SelectEvery(4,0,3).Weave()


Does it re-interlace the deinterlaced (Bob'd) video into TFF PAL ?

Thanks.

Serbianboss
2nd January 2007, 23:28
It seem that RemoveNoiseMC dont work good with interlaced material. I also have problem when load script in virtual dub or avsp. It craches. I also try RemoveNoiseMC with InterlacedSmoothing function but its also crashes in virtual dub and avsp.

Only with bobing work good, but its terrible slow on dual amd 3800 with 2 gb memory.

So this is script which i used with RemoveNoiseMC function:


Import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseMC.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\SeeSaw.avs")

AVISource("C:\Documents and Settings\Nenad\Desktop\film.avi")
convertToYV12(interlaced=true)

AssumeBFF()
leakkernelbob(order=0,threshold=3)
RemoveNoiseMC(rdlimit=18,rgrain=3,denoise=14) //This is high settings
AssumeBFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()


I think that this script is ok. It deinterlace, apply filters and than reinterlance.


If can work with Select evan/odd it would be much faster, but script is crashes with evan and odd.

One more: Which value to add for set memory max when we have 2 gb of memory?

Pookie
3rd January 2007, 02:05
SetMemoryMax(640) and get the latest mvtools from http://avisynth.org.ru/mvtools/mvtools.html

source=AVISource("C:\Documents and Settings\Nenad\Desktop\film.avi").convertToYV12(interlaced=true)


fields=source.AssumebFF().SeparateFields()

backward_vec2 = fields.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = fields.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = fields.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = fields.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
fields.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=800,idx=1)

Weave()

Serbianboss
3rd January 2007, 14:15
Thanks for script. This script is for MVtools not for RemoveNoise MC. But results is very similar like Remove Noise script.

Just 2 questions: Can in this script add some external filter like fft3dfilter?

What is most aggressive thSAD parameter?

fenomeno83
3rd January 2007, 15:03
very good post.I want a filter for analog tv in real time(using ffdshow+avisynth).Which plugins and istruction must I use in ffdhow in avisyntrh tabs?thanks

Didée
3rd January 2007, 15:30
You don't have the hardware to use any of the abovementioned denoising scripts in realtime.

Pookie
3rd January 2007, 17:00
http://www.cray.com/products/xmt/ :D

fenomeno83
3rd January 2007, 17:02
I have pentium4 3.2ghz,2mb cache,1gb ram

Pookie
3rd January 2007, 17:07
Well, then the answer is no....:D



serbianboss - you can add probably add mvdenoise to the end. I haven't tried it, though.

fields.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=800,idx=1).\
MVDenoise(backward_vec2,backward_vec1,forward_vec1,forward_vec2,tht=10,thSAD=400)

Serbianboss
3rd January 2007, 18:04
Can MVDegrain2 use this parametars(just lambda,delta):


....

fields=source.AssumeBFF().SeparateFields()

backward_vec2 = fields.MVAnalyse(isb = true, lambda = 1000, delta = 2)
backward_vec1 = fields.MVAnalyse(isb = true, lambda = 1000, delta = 1)
forward_vec1 = fields.MVAnalyse(isb = false, lambda = 1000, delta = 1)
forward_vec2 = fields.MVAnalyse(isb = false, lambda = 1000, delta = 2)
fields.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=800,idx=1)
Weave()


Because with this parametars is much fuster (0.15 speed in CCE)

One more: Where is good to add MT parametar to speed up this script.

Serbianboss
4th January 2007, 14:10
Any comment on post above?

Heini011- any chance in future to implement interlaced support for script RemoveNoice MC. Its very good script and it would be good if we can process on interlaced material.

I am interesting what filter Removenoise mc using to remove spots. Is it remove dirt?

How in other script we can just use tehnique of removing spots like remove noise?

Here is little example, what remove noise mc was cleaned(see black spot on left side):

ORIGINAL
http://img372.imageshack.us/img372/5659/originalwp8.png (http://imageshack.us)

RemoveNoise MC
http://img292.imageshack.us/img292/61/removenoisemcmu9.png (http://imageshack.us)

Used just parameter from lq filter:


SetMemoryMax(640)
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveNoiseMC.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\SeeSaw.avs")

AVISource("C:\Documents and Settings\Nenad\Desktop\vulkani.avi")
convertToYV12(interlaced=true)


RemoveNoiseMC(rdlimit=18,rgrain=3,denoise=14)


I know that this my script isnt good for interlaced material so i just test to see results.

zilog jones
4th January 2007, 16:49
I'm having trouble getting RemoveHighNoiseMC to work. Here's what I have:

LoadPlugin("E:\AV\AviSynth 2.5\RemoveNoiseMC\mvtools_1.4.dll")
LoadPlugin("E:\AV\AviSynth 2.5\RemoveNoiseMC\RemoveGrainSSE3.dll")
LoadPlugin("E:\AV\AviSynth 2.5\RemoveNoiseMC\DenoiseSharpen.dll")
LoadPlugin("E:\AV\AviSynth 2.5\RemoveNoiseMC\RepairSSE3.dll")
LoadPlugin("E:\AV\AviSynth 2.5\RemoveNoiseMC\RSharpenSSE3.dll")
import("E:\AV\AviSynth 2.5\RemoveNoiseMC\seesaw.avsi")

function RemoveHighNoiseMC(clip clip,int "rdlimit", int "rgrain", int "denoise", float "csharp", bool "_grey")
{
rdlimit = default(rdlimit,24)
rgrain = default(rgrain,3)
denoise = default(denoise,15)
csharp = (rgrain>2) ? default(csharp,0.32) : default(csharp,0.28)
_grey = default(_grey, false)
_dgr = 0.7+rgrain*0.5
global idx_c = idx_c + 1
cbs = 8
ccf = cbs*cbs/64
cpn = (denoise>12) ? 50*ccf : 57*ccf
bvec3 = clip.MVAnalyse(isb=false, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
fvec3 = clip.MVAnalyse(isb=true, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
backw1 = rdlimit>20 ? \
clip.MVFlow(bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(bvec1).Deblock(quant=16, aOffset=4, bOffset=4)
forw1 = rdlimit>20 ? \
clip.MVFlow(fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
clip.MVFlow(fvec1).Deblock(quant=16, aOffset=4, bOffset=4)
clp = interleave(backw1, clip, forw1)
clp = clp.RemoveDirt(rdlimit,rgrain,_grey)
clp = clp.SelectEvery(3,1)
dnc = clp.MVDenoise(bvec3, bvec2, bvec1, fvec1, fvec2, fvec3, thT=denoise, thSAD=160+12*denoise, thmv=40, thSCD1=255+4*denoise)
vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=6, 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")
return csharp==0 ? dnc : clp.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40)
}

function vlq_filter(clip c) {
c=c.RemoveHighNoiseMC(rdlimit=24,rgrain=3,denoise=16,csharp=0.3)
c=c.VagueDenoiser(threshold=1.0, nsteps=6, chromaT=1.2, percent=75)
c=c.deen("a3d",rad=3,thrY=4,thrUV=7,min=0.25,tthY=2,tthUV=3,scd=7)
c=c.LimitedSharpenFaster(Smode=4,strength=28,overshoot=1,wide=false,ss_x=1.2,ss_y=1.2)
return c
}

function vlq_filter_ultimate(clip c) {
c=c.RemoveHighNoiseMC(rdlimit=24,rgrain=3,denoise=16)
c=c.fft3dfilter(sigma=1.2, sharpen=0.4, plane=4)
c=c.deen("a3d",rad=3,thrY=4,thrUV=7,min=0.25,tthY=2,tthUV=3,scd=7)
return c
}

I have this imported into another script, where I call vlq_filter_ultimate() and not much else (converting to YV12 before, 696x576 MJPEG video, using directshowsource as I'm using ffdshow).

However, I get this error: "I don't know what "idx_c" means", and it refers to line 16 and 51 of the above code. I'm pretty sure I have the right plugins and scripts loaded... I think... :confused: I wasn't sure if those other plugins that come with RemoveGrain are needed (and I have SSE3).

RemoveNoiseMC seems to work (it's in the same directory loading the same plugins), however it doesn't seem to do an awful lot outside improving the colour (using lq_filter). I'm trying it on a pretty noisy VHS recording (recorded from a bad reception too :( ).

Any ideas?

foxyshadis
4th January 2007, 19:19
You missed the global idx_c = 25 in the original function. You'll need the other functions too, removedirt and removetempgrain.

zilog jones
4th January 2007, 20:05
I knew it was probably my fault :)
It's working now - thanks!

Any suggestions for higher settings for vlq_filter_ultimate, for my very noisy video? With the default settings it seems to be reducing chroma noise a lot, however it just seems to be sharpening the rest of the noise most of the time :(
I'll upload a clip eventually

fenomeno83
5th January 2007, 20:27
I found a good solution for real time (gradual denoise+deinterlacing+soften lpf).
but now I want a better solution to reencode(virtual dub+avisynth) captured analog movies to eliminate analog artifacts in the best manner.If is possibile a simple script(includes all functions)because I'm not very experct.thanks!

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

videoFred
26th January 2010, 14:45
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.

Mvtools2 is using M....., instead of the old MV......
You will have to change this in the RemovenoiseMC script!
MAnalyse, MFlow, MDegrain etc...

Fred.

kool
26th January 2010, 14:47
how i would do that? :confused:

Edit: you mean i should change MVAnalyse to MAnalyse in RemoveNoiseMC.avsi ?

videoFred
26th January 2010, 14:52
how i would do that? :confused:

With your keyboard? :)


Edit: you mean i should change MVAnalyse to MAnalyse in RemoveNoiseMC.avsi ?

You got it! :p

Fred.

kool
26th January 2010, 14:56
to make it sure, is it this part ?

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 ? \

Edit: or if you have working one, could you upload it? it will makes thing more easy.

kool
26th January 2010, 15:52
doesn't help changing MVAnalyse to MAnalyse, I'm getting errors for other parts of MVTools.

videoFred
26th January 2010, 16:17
I wrote:


MAnalyse, MFlow, MDegrain etc...

Fred.

Didée
26th January 2010, 16:33
You can't just swap the names like MVAnalyse->Manalyse. You also need to provide all filters with appropriate "super" clip, and (in exchange) cancel out all "idx=.." parameters.

videoFred
26th January 2010, 16:43
You can't just swap the names like MVAnalyse->Manalyse. You also need to provide all filters with appropriate "super" clip, and (in exchange) cancel out all "idx=.." parameters.

But of cource... I forgot about this :scared:

Fred.

kool
26th January 2010, 16:43
I don't have enough scripting Knowledge and I'm not familiar with MVTools to solve this issue, could you help us to solve this problem.

videoFred
26th January 2010, 16:46
I don't have enough scripting Knowledge and I'm not familiar with MVTools to solve this issue, could you help us to solve this problem.

Simple, rename back to MVAnalyse and use MVTools1...

Fred.

kool
26th January 2010, 16:52
That sounds much easier, after doing it I get this error. I'm using MVTools v1.11.4.5

http://i46.tinypic.com/2ckgft.jpg

* And if I have MVTools2 and MVTools 1 in my plugin directory, wouldn't they make any problem in loading scripts?

kool
26th January 2010, 21:26
And also getting this error, really don't know what is the problem.

http://i49.tinypic.com/339sjzl.jpg

osgZach
27th January 2010, 01:18
Your resolution must be divisible by 8, I think is what that means.

If you're putting in a crop but not resizing (yet) for instance, that might be causing the error.

As for the second one... not sure what that means, unless its telling you that you have to declare that option in your script call.

kool
27th January 2010, 02:02
I did resize, and here is the script

SetMemoryMax(512)

Load_Stdcall_Plugin("C:\Program Files (x86)\meGUI\tools\yadif\yadif.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avs")
DGDecode_mpeg2source("C:\Users\kool\Desktop\Test\Test.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Yadif(mode=1, order=1)
Srestore(Frate=29.970)
Crop(2, 60, -22, -64)

LQ_Filter()
LanczosResize(584, 336)

When I put the LQ_Filter() before resize I get this error

http://i46.tinypic.com/2ckgft.jpg

But if I put it after resize I get this error

http://i49.tinypic.com/339sjzl.jpg

Didée
27th January 2010, 09:15
The deblock error is because your cropping creates non-mod8 frame dimensions. Putting it after the resize makes no sense, because then the 8x8 blocks are no more in the places where the deblock-filter is looking for them. Adjust your crop values like this:
Srestore(Frate=29.970)
Crop(0, 56, -16, -64) # closest mod-8 approach to (2,60,-22,-64)
LQ_Filter()
Crop(2,4,-6,-0) # crop the rest of the borders
LanczosResize(584, 336)

The MVDenoise error is because MVDenoise is depreciated, and not supported anymore in actual MVTools2. Seen from that point, you cannot port RemoveNoiseMC to MVTools2, because MVDenoise is not available. You'd need to build an approximation for MVDenoise via MDegrain, or build manually with MCompensate/Interleave/TemporalSoften/SelectEvery.

bayex
28th January 2010, 08:26
Is it possible to run through the GPU Removenoise

Jenyok
14th February 2012, 07:53
This is a code of all known RemoveNoise and various filters functions, used RemoveNoise, collected together.
MC - moution compensated.
Code is adapted to MVTools V2.

Didee
neuron2
Gavino

Any your suggestion, addition, correction and improvment of this code ?!
Also needed your help to replace function Deen() beta1 to Deen() beta2.


#
#
# File: RemoveNoise.avsi
#
# Moution compensated RemoveNoise and variuos filters functions
#
# Functions:
#
# function RemoveNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
# function HQ_Filter(clip clp)
# function MQ_Filter(clip clp)
# function LQ_Filter(clip clp)
#
# function RemoveNoiseMC_HQ(clip clp, int "tlimit", int "rgrain", float "csharp")
# function HQ_Filter2(clip clp)
#
# function RemoveHighNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", float "csharp", bool "_grey")
# function VLQ_Filter(clip clp)
# function VLQ_Filter_Ultimate(clip clp)
#
#



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\REMOVEGRAINT-1_0\removegraint.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAINT-1_0\repairt.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\removegrain.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEGRAIN-1_0\repair.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\FFT3DFILTER_20070220\fft3dfilter.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\ZZZ_OLD\DEEN_25_DLL_20030813\deen.dll")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\DEBLOCK_25_DLL_20060214\deblock.dll")

Import("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\SHARPFUNCTION_LIMITEDSHARPENFASTER\limitedsharpenfaster.avsi")
Import("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\SEESAW\seesaw.avsi")
Import("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\REMOVEDIRT_20050507\removedirt2.avsi")


#global idx_c = 4


# =============================================================================
#
#
function RemoveNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", bool "sharp", float "csharpen", bool "_grey")
{
_grey = Default(_grey, false)
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)

# global idx_c = idx_c + 1

dummy = clp.BlankClip(length=0)
csharpen = (sharp) ? csharpen : csharpen + 0.08
_dgr = 0.45 + rgrain * 0.4
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

super = MSuper(clp, pel=2, sharp=csh)
bvec3 = MAnalyse(super, isb=true, blksize=cbs, delta=3, truemotion=true, pnew=cpn, overlap=cov)
bvec2 = MAnalyse(super, isb=true, blksize=cbs, delta=2, truemotion=true, pnew=cpn, overlap=cov)
bvec1 = MAnalyse(super, isb=true, blksize=cbs, delta=1, truemotion=true, pnew=cpn, overlap=cov)
fvec1 = MAnalyse(super, isb=false, blksize=cbs, delta=1, truemotion=true, pnew=cpn, overlap=cov)
fvec2 = MAnalyse(super, isb=false, blksize=cbs, delta=2, truemotion=true, pnew=cpn, overlap=cov)
fvec3 = MAnalyse(super, isb=false, blksize=cbs, delta=3, truemotion=true, pnew=cpn, overlap=cov)
backw1 = (rdlimit > 13) ? (rdlimit > 20) ? MFlow(clp, super, bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, bvec1).Deblock(quant=16, aOffset=4, bOffset=4) : \
MFlow(clp, super, bvec1)
forw1 = (rdlimit > 13) ? (rdlimit > 20) ? MFlow(clp, super, fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, fvec1).Deblock(quant=16, aOffset=4, bOffset=4) : \
MFlow(clp, super, fvec1)

# 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, clp, forw1)
clp = clp.RemoveDirt2(rdlimit, rgrain, _grey)
# clp = clp.RemoveDirtMC2(rdlimit, rgrain, _grey)
dnc = (denoise == 0) ? clp.RemoveTempGrain(rgrain).SelectEvery(3, 1) : dummy
clp = clp.SelectEvery(3, 1)

dnc = MDegrain3(clp, super, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, thSAD=190 + 15 * denoise, \
thSCD1=230 + 5 * denoise)

# 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
}



# for slight noisy video or spot/dirt removing only
#
function HQ_Filter(clip clp)
{
clp = clp.RemoveNoiseMC(rdlimit=6, rgrain=1, denoise=0)
clp = clp.LimitedSharpenFaster(Smode=4, strength=18, overshoot=0, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}


# medium noise, higher grain:
#
function MQ_Filter(clip clp)
{
clp = clp.RemoveNoiseMC(rdlimit=10, rgrain=2, denoise=8)
clp = clp.LimitedSharpenFaster(Smode=4, strength=20, overshoot=1, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}


# high noise or analog capture:
#
function LQ_Filter(clip clp)
{
clp = clp.RemoveNoiseMC(rdlimit=18, rgrain=3, denoise=14)
clp = clp.VagueDenoiser(threshold=0.6, nsteps=6, chromaT=0.6, percent=75)
clp = clp.deen("a3d", rad=3, thrY=3, thrUV=5, min=0.25, tthY=2, tthUV=3, scd=6)
clp = clp.LimitedSharpenFaster(Smode=4, strength=24, overshoot=1, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}



# =============================================================================
#
#
function RemoveNoiseMC_HQ(clip clp, int "tlimit", int "rgrain", float "csharp")
{
tlimit = Default(tlimit, 4)
rgrain = Default(rgrain, 1)
csharp = (rgrain > 1) ? Default(csharp, 0.14) : Default(csharp, 0.13)

# global idx_c = idx_c + 1

cbs = 4
ccf = cbs * cbs / 64
cpn = (tlimit > 6) ? 70 * ccf : 75 * ccf

super = MSuper(clp, pel=2, sharp=1)
bvec1 = MAnalyse(super, isb=true, blksize=cbs, delta=1, overlap=0, truemotion=true, pnew=cpn)
fvec1 = MAnalyse(super, isb=false, blksize=cbs, delta=1, overlap=0, truemotion=true, pnew=cpn)
backw1 = MFlow(clp, super, bvec1)
forw1 = MFlow(clp, super, fvec1)

# bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=1, overlap=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=1, overlap=0, truemotion=true, pnew=cpn, idx=idx_c)
# backw1 = clip.MVFlow(bvec1, idx=idx_c)
# forw1 = clip.MVFlow(fvec1, idx=idx_c)

dnc = interleave(backw1, clp, forw1)
dnc = dnc.RemoveDirt_HQ(tlimit, rgrain)
# dnc = dnc.RemoveDirtMC_HQ(tlimit, rgrain)
dnc = dnc.SelectEvery(3, 1)

return ((csharp == 0) ? dnc : clp.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40))
}


function HQ_Filter2(clip clp)
{
clp = clp.RemoveNoiseMC_HQ(tlimit=4, rgrain=1)
clp = clp.LimitedSharpenFaster(Smode=4, strength=15, overshoot=1, wide=false, ss_x=1.3, ss_y=1.3)

return clp
}



#global idx_c = 25


# =============================================================================
#
#
function RemoveHighNoiseMC(clip clp, int "rdlimit", int "rgrain", int "denoise", float "csharp", bool "_grey")
{
_grey = Default(_grey, false)
rdlimit = Default(rdlimit, 24)
rgrain = Default(rgrain, 3)
denoise = Default(denoise, 15)
csharp = (rgrain > 2) ? Default(csharp, 0.32) : Default(csharp, 0.28)

# global idx_c = idx_c + 1

_dgr = 0.7 + rgrain * 0.5
cbs = 8
ccf = cbs * cbs / 64
cpn = (denoise > 12) ? 50 * ccf : 57 * ccf

super = MSuper(clp, pel=2, sharp=0)
bvec3 = MAnalyse(super, isb=true, blksize=cbs, delta=3, truemotion=true, pnew=cpn)
bvec2 = MAnalyse(super, isb=true, blksize=cbs, delta=2, truemotion=true, pnew=cpn)
bvec1 = MAnalyse(super, isb=true, blksize=cbs, delta=1, truemotion=true, pnew=cpn)
fvec1 = MAnalyse(super, isb=false, blksize=cbs, delta=1, truemotion=true, pnew=cpn)
fvec2 = MAnalyse(super, isb=false, blksize=cbs, delta=2, truemotion=true, pnew=cpn)
fvec3 = MAnalyse(super, isb=false, blksize=cbs, delta=3, truemotion=true, pnew=cpn)
backw1 = (rdlimit > 20) ? MFlow(clp, super, bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, bvec1).Deblock(quant=16, aOffset=4, bOffset=4)
forw1 = (rdlimit > 20) ? MFlow(clp, super, fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
MFlow(clp, super, fvec1).Deblock(quant=16, aOffset=4, bOffset=4)

# bvec3 = clip.MVAnalyse(isb=false, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# bvec2 = clip.MVAnalyse(isb=false, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# bvec1 = clip.MVAnalyse(isb=false, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec1 = clip.MVAnalyse(isb=true, blksize=cbs, delta=1, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec2 = clip.MVAnalyse(isb=true, blksize=cbs, delta=2, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# fvec3 = clip.MVAnalyse(isb=true, blksize=cbs, delta=3, pel=2, sharp=0, truemotion=true, pnew=cpn, idx=idx_c)
# backw1 = (rdlimit > 20) ? clip.MVFlow(bvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
# clip.MVFlow(bvec1).Deblock(quant=16, aOffset=4, bOffset=4)
# forw1 = (rdlimit > 20) ? clip.MVFlow(fvec1).Deblock(quant=22, aOffset=6, bOffset=6) : \
# clip.MVFlow(fvec1).Deblock(quant=16, aOffset=4, bOffset=4)

clp = interleave(backw1, clp, forw1)
clp = clp.RemoveDirt2(limit=rdlimit, rgrain=rgrain, _grey=_grey)
# clp = clp.RemoveDirtMC2(limit=rdlimit, rgrain=rgrain, _grey=_grey)
clp = clp.SelectEvery(3, 1)

dnc = MDegrain3(clp, super, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3, thSAD=160 + 12 * denoise, \
thSCD1=255 + 4 * denoise)

# dnc = clp.MVDenoise(bvec3, bvec2, bvec1, fvec1, fvec2, fvec3, thT=denoise, thSAD=160 + 12 * denoise, \
# thmv=40, thSCD1=255 + 4 * denoise)

vid_mo = dnc.VagueDenoiser(threshold=_dgr, chromaT=_dgr, nsteps=6, 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")

return ((csharp == 0) ? dnc : clp.SeeSaw(dnc, Sstr=csharp, Szp=12, SdampHi=20, bias=40))
}


function VLQ_Filter(clip clp)
{
clp = clp.RemoveHighNoiseMC(rdlimit=24, rgrain=3, denoise=16, csharp=0.3)
clp = clp.VagueDenoiser(threshold=1.0, nsteps=6, chromaT=1.2, percent=75)
clp = clp.deen("a3d", rad=3, thrY=4, thrUV=7, min=0.25, tthY=2, tthUV=3, scd=7)
clp = clp.LimitedSharpenFaster(Smode=4, strength=28, overshoot=1, wide=false, ss_x=1.2, ss_y=1.2)

return clp
}


function VLQ_Filter_Ultimate(clip clp)
{
clp = clp.RemoveHighNoiseMC(rdlimit=24, rgrain=3, denoise=16)
clp = clp.fft3dfilter(sigma=1.2, sharpen=0.4, plane=4)
clp = clp.deen("a3d", rad=3, thrY=4, thrUV=7, min=0.25, tthY=2, tthUV=3, scd=7)

return clp
}

canuckerfan
6th March 2012, 07:34
^Thanks for the update. However, there is one caveat. I used to use the old MVToolsV1 version of RemoveNoiseMC and it removed spots quite well. However, with the MVToolsV2 version of RemoveNoiseMC, those spots aren't removed. It shouldn't be that way, should it?

canuckerfan
21st March 2012, 02:18
is there anyway to modify RemoveNoiseMC so that it still removes spots/scratches but doesn't remove grain/detail as much? here's the current code:

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
}

canuckerfan
28th March 2012, 09:12
anyone?

Jenyok
25th March 2013, 19:17
Something else...
.

# http://forum.ixbt.com/topic.cgi?id=29:33640-65
#
function Super_Filter(clip video, int "Spatial", int "Strength", int "Frames", int "Radius", \
int "blksize", int "Despot", int "p", int "show")
{
Spatial = default(Spatial, 0)
Strength = default(Strength, 33)
Frames = default(Frames, 2)
Radius = default(Radius, 9)

S1 = Strength / 30
S2 = Strength / 100
S3 = Strength / 20
S4 = floor(s3 * 1.5)

blksize = default(blksize, 16)
(blksize < 4) ? 4 : (blksize > 32) ? 32 : blksize
overlap = blksize / 2

Despot = default(Despot, 0)
p = default(p, 100)
show = default(show, 0)


# Here is a code of function
#
video.ConvertToYV12()

super = MSuper(hpad=8, vpad=8, pel=2, sharp=2, rfilter=1)
bw = MAnalyse(super, isb=true, overlap=overlap, blksize=blksize)
fw = MAnalyse(super, isb=false, overlap=overlap, blksize=blksize)
bf1 = MCompensate(last, super, bw, planar=true)
ff1 = MCompensate(last, super, fw, planar=true)

interleave(bf1, last.MDegrain1(super, bw, fw, planar=true).MDegrain1(super, bw, fw, planar=true), ff1)

FluxSmoothST(Radius, Radius)
SelectEvery(3, 1)

(Spatial == 1) ? fft3dfilter(sigma=S1, sigma2=S2, sigma3=S3, sigma4=S4, plane=0, bw=32, bh=32, \
bt=Frames, ow=16, oh=16, sharpen=0.3, svr=1.0, measure=false, wintype=0, degrid=1.0, \
dehalo=2.0, hr=2.0, ht=75.0) : NOP()

super = MSuper(hpad=8, vpad=8, pel=2, sharp=2, rfilter=1)
bv = MAnalyse(super, isb=true, overlap=overlap, blksize=blksize)
fv = MAnalyse(super, isb=false, overlap=overlap, blksize=blksize)
bv1 = MCompensate(last, super, bv, planar=true)
fv1 = MCompensate(last, super, fv, planar=true)

interleave(bv1, last.MDegrain1(super, bv, fv, planar=true).MDegrain1(super, bv, fv, planar=true), fv1)

FluxSmoothST(Radius, Radius)

(DeSpot == 1) ? DeSpot(p1=40, p2=30, pwidth=p, pheight=p, mthres=35, merode=25, p1percent=10, sign=2, \
show=show, seg=1, color=true, motpn=true) : NOP()

SelectEvery(3, 1)

MSharpen(strength=40, debug=true)
XSharpen(strength=120, threshold=8)
LimitedSharpenFaster(strength=40, smode=3)

# unsharpmask(60, 1, 0)
# unsharpmask(60, 2, 50)

return (Gradfun2dbmod(thr=1.4, thrC=1.8, str=0.2, strC=0, temp=100, adapt=64))
}

GMJCZP
17th November 2014, 04:41
If I place internally in RemoveNoise _grey=true I get green screen.
Anyone has happened using greyscale() previously?

foxyshadis
18th November 2014, 00:36
_grey or uv trashes chroma in the RemoveGrain filters, which usually means green screen (sometimes magenta or garbage colors); follow it with a greyscale() for good output. (You can add it to the end of the function.) Newer filters can use Y8 to properly handle it.

GMJCZP
18th November 2014, 01:09
_grey or uv trashes chroma in the RemoveGrain filters, which usually means green screen (sometimes magenta or garbage colors); follow it with a greyscale() for good output. (You can add it to the end of the function.) Newer filters can use Y8 to properly handle it.

foxyshadis, You were right, it worked. :thanks:
Just before Return clp put clp = clp.Greyscale()

Is curious to use Greyscale more than once.

StainlessS
18th November 2014, 02:58
Is curious to use Greyscale more than once.

_grey means dont do anything with chroma, ie will contain whatever rubbish was in memory before new frame was created.

Greyscale sets chroma to 128.

EDIT: Oops, thats pretty much what foxyshadis said.

hnn
3rd June 2017, 00:09
Hi, nice filter! What do you think about an upgrade?

I have tried with the new version of masktools and mvtools, but the filter only work with masktools-v2b1 and mvtools 1.8.4.0

The new masktools have a probrem with SeeSaw

Evaluate: Unhandled C++ exception!

(SeeSaw.avs, line 128)

(SeeSaw.avs, line 80)

siella
20th July 2017, 12:58
I upgraded and imroved this script. I used mvtools v2, rgtools and masktools2. After some test i will share.

thescrapyard
5th December 2017, 09:08
Any updates on the improved and updated script as I use this for old cartoons and b&W films so an updated scriupt may help

Thanks