Log in

View Full Version : MC noise removal script


Pages : 1 2 [3] 4 5 6 7

Adub
17th February 2008, 00:25
Adding this to the wiki.

Edit: Added to the wiki.
Link: http://avisynth.org/mediawiki/MC_Spuds#Links

Spuds
28th February 2008, 23:29
Found a fixed a error in the final output of the script, nothing major but I was not applying one of the transforms.

Minor tweaks to the starfield function when its used on non anime sources.

The link in post 2 has been updated as well as the wiki.

halsboss
2nd March 2008, 11:01
Which warpsharp DLLs and xsharpen should I use ?

There's 2 at http://avisynth.org/warpenterprises/ with one 24k the other larger ... does it give aWarpsharp and xsharpen or are there more dlls ?

Confused ...
http://forum.doom9.org/showthread.php?p=1047273#post1047273 mentions aWarpsharp.dll and http://forum.doom9.org/showthread.php?p=1047300#post1047300 mentions xsharpen ...

Spuds
3rd March 2008, 03:18
xsharpen is contained in the warpsharp.dll, get it here (http://avisynth.org/warpenterprises/...l_20031103.zip)

Alternativly there is a modified version of the warpsharp.dll at this site (http://seraphy.fam.cx/~seraphy/program/WarpSharp/index.html), if you have an Intel processor use the ICC version else the VC version.

Vesi
3rd March 2008, 17:23
I get this error when I want to use debug.
Script error: Invalid arguments to function "debug_view"

Spuds
4th March 2008, 00:31
I found one error in the debug view function when you used strength=1 or set edgeclean=false when you call the function. If you were doing either of these then change the bold text below in line 153 as follows:

maskedge = (edgeclean) ? dering_mask(clp4, anime, strength, edm_hi, edm_lo) : nop()

to:

maskedge = (edgeclean) ? dering_mask(clp4, anime, strength, edm_hi, edm_lo) : nullclp

If this does not fix the issue please let me know and also post how you called mc_spuds. I'm working on a couple of other improvements and when done I'll post an update with this fix.

Vesi
4th March 2008, 01:16
Problem fixed, thanks alot spuds.
and yes I was using strength=1

halsboss
4th March 2008, 02:40
Hi Spuds, I needed a dummies simplified strong denoiser just for my own purpose. Thanks to you I was able to base it on your function (uses less filters and I didn't understand the frames=3 vs frames=4 logic). Hope that's OK. Thanks again.
Could you clarify the limit default setting code is right as it wasn't quite the same as the other code around it ?

limit = (defined(limit)) ? limit : (defined(limit)) ? select(limit , 96 , 96 , 102 , 128 , 156 , 225 , 255) : 128 # threshold for the motion mask inclusion, lower includes more

Anyway here's my cut-down script based on your terrific effort. Query: the IDXing doesn't seem right ... is it ?
FUNCTION DCW_STRONG_DENOISE(clip clp, int "strength", bool "fixcolorbleed", bool "edgeclean", bool "fixfocus", bool "addnoise") {
#
# clp MUST BE IN YV12 and mod 8 size
# Strength (1-6), default 3, more=stronger denoising
# fixcolorbleed (true or false) default false, remove color bleeding
# edgeclean (true or false) default false, help any edge ringing left behind by adding a mild blur to object edges
# fixfocus (true or false) default false, can help with edges that are blurry, this is from IIP script
# addnoise (true or false) default false, add some grain in dark areas, help with compression and detail illusion
#
##### VERY STRONG motion compensated denoiser, based on MVDegrain3
#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Derived from MC_Spuds()
# Motion compensated noise removal with sharpening -- version: BETA - 29.Feb.2008
# http://forum.doom9.org/showthread.php?p=1101306#post1101306
# Thanks to Didee for his comments, scripts and posts from which I learned much and borrowed some from :)
# Required filters:
# mt_masktools: Ver 2.0.32+
# Code http://manao4.free.fr/masktools-v2.0a32.zip : Discussion http://forum.doom9.org/showthread.php?t=98985
# removegrain: Ver 1.0 (8/2005) & Ver 0.9 (5/2005) v1.0 has an issue with repairsse3, so use the repairsse3.dll one from V0.9
# Code http://www.removegrain.de.tf : Discussion http://forum.doom9.org/showthread.php?s=&threadid=79751
# removedirt: Ver 0.9+
# Code http://www.removedirt.de.tf : Discussion http://forum.doom9.org/showthread.php?s=&threadid=70856
# mvtools: Ver 1.9.1+
# Code http://avisynth.org.ru/fizick.html : Discussion http://forum.doom9.org/showthread.php?t=84770
# unfilter: Ver 0.0.1.5+
# Code http://www6.impacthosting.com/trbarry/downloads.htm
# fft3dfilter: ver 2.1.1+
# Code http://avisynth.org.ru/fizick.html
# addgrain: Ver 1.4+
# Code http://foxyshadis.slightlydark.com/random/AddGrainC.zip
# awarpsharp and xsharpen versions mentioned at
# http://forum.doom9.org/showthread.php?p=1107734#post1107734
# awarpsharp from awarpsharp.dll
# http://forum.doom9.org/showthread.php?p=1107379#post1107379 and
# xsharpen from warpsharp.dll
# http://forum.doom9.org/showthread.php?p=1107379#post1107379
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\fft3dfilter.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\WarpSharp.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\aWarpSharp.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\MaskTools.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\Unfilter.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\AddGrainC.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\mt_masktools.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\RemoveGrainSSE2.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\RepairSSE2.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-dcw\RemoveDirtSSE2.dll")
#Import("C:\Program Files\AviSynth 2.5\LimitedSharpenFaster.avsi")
#Import("C:\Program Files\AviSynth 2.5\Deblock_QED_MT2.avs")
#
#
global idx_pointer = 24

# set up our parameters based on what the user input

strength = default( strength , 3 ) # how aggressive to remove noise / grain, sets predefined defaults
fixcolorbleed = default( fixcolorbleed , false ) # Special mode to remove color bleeding
edgeclean = default( edgeclean , false ) # edge clip for extra noise removal?
fixfocus = default( fixfocus , false ) # special mode to try and crisp up edges of blurry / soft video, code from IIP
addnoise = default( addnoise , false ) # Special mode to add some grain in dark areas, help with compression and detail illusion

shadow_l = 24 # Low limit for dark grain mask
shadow_h = 42 # high limit for dark grain mask
edm_lo = string( 55 ) # edge detection lo threshold
edm_hi = string( 255) # edge detection hi thresold
ls_x = 1.25 # LSF Smode=4 default
ls_y = 1.25 # LSF Smode=4 default
lsfstr = 100 # Strength parameter in LSF
quant1 = 0 # quant 1 for deblock_qed
quant2 = 45 # quant 2 for deblock_qed
uv = 1 # uv for deblock_qed
pel = 2 # pel for MVAnalyse
search = 2 # search mode for mvanalysis

blocksize = (defined(strength)) ? select(strength , 16 , 8 , 8 , 16 , 16 , 16 , 16) : 16 # blocksize for motion search
overlap = (defined(strength)) ? select(strength , 2 , 0 , 2 , 4 , 4 , 8 , 8) : 2 # overlap of the block for motion search
pnew = (defined(strength)) ? select(strength , 32 , 32 , 32 , 32 , 32 , 32 , 32) : 32 # prevent replacing of an alrady good predictor by one thats just a little better
thsad = (defined(strength)) ? select(strength , 400 , 300 , 400 , 415 , 450 , 450 , 500) : 400 # threshold to motion, increase for more grain removal ie 500
thscd1 = (defined(strength)) ? select(strength , 400 , 400 , 400 , 400 , 400 , 400 , 400) : 400 # threshold to motion comared to SAD
thscd2 = (defined(strength)) ? select(strength , 130 , 130 , 130 , 130 , 130 , 130 , 130) : 130 # Scene detection threshold, how much must a frame must change to be a scene change
ml = (defined(strength)) ? select(strength , 100 , 120 , 100 , 95 , 90 , 90 , 80) : 100 # threshold for the motion mask inclusion, lower includes more
limit = (defined(strength)) ? select(strength , 96 , 96 , 102 , 128 , 156 , 225 , 255) : 128 # threshold for the motion mask inclusion, lower includes more

# initilize clip-dependent constants
clp_width = clp.width()
clp_height = clp.height()
clp_width_2x = 2 * clp_width
clp_height_2x = 2 * clp_height
nullclp = blankclip(clp)

# Remove color bleeding
clp = (fixcolorbleed) ? clp.removegrain(0,11) : clp

# Do the primary noise removal
#+++
# pre-filter a clip for motion estimation, then upsample it too
vector_prefilter1 = clp.fft3dfilter(sigma=strength*4.,sigma2=strength*3.,sigma3=strength*2.,sigma4=strength*1.,bt=1,bw=16,bh=16,ow=4,oh=4,plane=4)
upsampled1 = vector_prefilter1.BicubicResize(clp_width_2x,clp_height_2x,b=0.0,c=0.5,src_left=0.25, src_top=0.25)
# compute the motion vectors
global idx_pointer = idx_pointer + 1
bv3 = vector_prefilter1.MvAnalyse(isb=true, delta=3, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled1,pnew=pnew)
bv2 = vector_prefilter1.MvAnalyse(isb=true, delta=2, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled1,pnew=pnew)
bv1 = vector_prefilter1.MvAnalyse(isb=true, delta=1, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled1,pnew=pnew)
fv1 = vector_prefilter1.MvAnalyse(isb=false, delta=1, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled1,pnew=pnew)
fv2 = vector_prefilter1.MvAnalyse(isb=false, delta=2, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled1,pnew=pnew)
fv3 = vector_prefilter1.MvAnalyse(isb=false, delta=3, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled1,pnew=pnew)
# mvdegrain the resulting frame based on the motion vectors
global idx_pointer = idx_pointer + 1
clp2 = clp.MVDegrain3(bv1,fv1,bv2,fv2,bv3,fv3,thSAD=thsad,IDX=idx_pointer,limit=limit,thscd1=thscd1,thscd2=thscd2)
# make a mask based on our denoised framed, we need new vectors since the key frame changed
vector_prefilter2 = clp2
upsampled2 = vector_prefilter2.BicubicResize(clp_width_2x,clp_height_2x,b=0.0,c=0.5,src_left=0.25,src_top=0.25)
global idx_pointer = idx_pointer + 1
bv1 = vector_prefilter2.MvAnalyse(isb=true, delta=1, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled2,pnew=pnew)
fv1 = vector_prefilter2.MvAnalyse(isb=false, delta=1, idx=idx_pointer, truemotion=true,blksize=blocksize,overlap=overlap,pel=pel,sharp=0,search=search,chroma=true,pelclip=upsampled2,pnew=pnew)
# use the vectors to create masks, we apply stage two filtering to masked areas.
maskmotion = mt_average(clp2.mvmask(kind=1, vectors=bv1, ml=ml),clp2.mvmask(kind=1, vectors=fv1, ml=ml)).UtoY().BicubicResize(clp2.width(),clp2.height())
maskstatic = mt_invert(maskmotion).mt_lut("x 48 < 0 x ?")
# create our filtered clips to apply via the masks, don't go to heavy on smoothed since we have already degrained.
smoothed = clp2.RemoveGrain(mode=17)
sharp = clp2.limitedsharpenfaster(smode=4, ss_x=ls_x, ss_y=ls_y, strength=lsfstr)
# apply smooth and sharp clips with the masks
clp3 = mt_merge(clp2, smoothed, maskmotion)
clp4 = mt_merge(clp3, sharp, maskstatic)
#+++

# There could be some edge ringing left behind, this will help it by adding a mild blur to object edges.
maskedge = (edgeclean) ? dering_mask(clp4, edm_hi, edm_lo) : nullclp
dering = (edgeclean) ? clp4.bicubicResize((clp_width/2),(clp_height/2)).bicubicResize(clp_width,clp_height,b=0.8,c=0.1).unfilter(-5,-5) : nullclp
clp4 = (edgeclean) ? mt_merge(clp4,dering,maskedge) : clp4

# apply focus function if requested, can help with edges that are blurry, this is from IIP script.
clp4 = (fixfocus) ? focus(clp4, clp_width, clp_height) : clp4

# add grain to dark areas so encoders dont block them up on a low bitrate, also can give detail illusion
maskdark = (addnoise) ? clp4.mt_lut("x " + th_lo + " < 255 x " + th_hi + " > 0 x " + th_lo + " - " + th_hi + " " + th_lo + " - / 255 * ? ? "): nop()
clp5 = (addnoise) ? mt_merge(clp4,clp4.sharpen(0.25).addgrain(2,0,0),maskdark,luma=true): clp4

RETURN(clp5)
}

#----------------------
FUNCTION RemoveDustDirt(clip input, int repmode, int clmode, int limitY, int limitUV)
{
repmode = default(repmode, 16)
clmode = default(clmode, 5)
limitY = default(limitY, 5)
limitUV = default(limitUV, 255)
clensed = Clense(input)
repaired = Repair(clensed, input, mode=repmode)
degrained = RemoveGrain(repaired, mode=clmode)
degrained = mt_lutxy(degrained,input, \
expr="x y - abs " + string(limitUV + 1) + " < x x y - 128 + 128 < y " + string(limitUV) + " - y " + string(limitUV) + " + ? ?", \
yexpr="x y - abs " + string(limity + 1) + " < x x y - 128 + 128 < y " + string(limity) + " - y " + string(limity) + " + ? ?",y=3,u=3,v=3)
RETURN (degrained)
}

#----------------------
FUNCTION MinBlur(clip input, int r, int "uv")
{
# Taken from MCBob.avs:
uv = default(uv,3)

# process chroma if uv==3, otherwise just luma
uv2 = (uv==2) ? 1 : uv
rg4 = (uv==3) ? 4 : -1
rg11 = (uv==3) ? 11 : -1
rg20 = (uv==3) ? 20 : -1
medf = (uv==3) ? 1 : -200

# make our blur clips, r controls amount ...keep the best blur pixel from each
RG11D = (r==1) ? mt_makediff(input,input.removegrain(11, rg11),U=uv2,V=uv2)
\ : (r==2) ? mt_makediff(input,input.removegrain(11,rg11).removegrain(20,rg20),U=uv2,V=uv2)
\ : mt_makediff(input,input.removegrain(11,rg11).removegrain(20,rg20).removegrain(20,rg20),U=uv2,V=uv2)
RG4D = (r==1) ? mt_makediff(input,input.removegrain(4,rg4),U=uv2,V=uv2)
\ : (r==2) ? mt_makediff(input,input.medianblur(2,2*medf,2*medf),U=uv2,V=uv2)
\ : mt_makediff(input,input.medianblur(3,3*medf,3*medf),U=uv2,V=uv2)
DD = mt_lutxy(RG11D,RG4D,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",U=uv2,V=uv2)
RETURN (input.mt_makediff(DD,U=uv,V=uv))
}

#----------------------
FUNCTION dering_mask(clip input, string edm_hi, string edm_lo)
{
nmask = input.mt_edge(mode="min/max",thy1=0,thy2=255,thC1=0,thC2=255,Y=3,V=1,U=1)
amask = nmask.mt_lut("x 70 > 255 x ?").removegrain(11,modeU=0,modeV=0)
tmask = amask.mt_expand.mt_inflate
maskedge = mt_lutxy(amask.mt_invert(), tmask, expr="x y * 255 /").mt_lut("x " + edm_hi + " > 255 x " + edm_lo + " < 0 x " + edm_lo + " - " + edm_hi + " " + edm_lo + " - / 255 * ? ? ")
RETURN (maskedge)
}

#----------------------
FUNCTION Focus(clip input, int clp_width, int clp_height)
{
# May help some edge blurred sources by defining the edges
ssx = 3.5
ssy = 3.5

# Super-duper-size the clip ensuring its mod16
xx_ss2 = int(clp_width * ssx / 16 + 0.5) * 16
yy_ss2 = int(clp_height * ssy / 16 + 0.5) * 16
input = input.LanczosResize(xx_ss2,yy_ss2)

# apply our transfors to the edges (blur, warpsharp (only to luma), and xsharpen)
input = input.removegrain(20)
input = input.awarpsharp(depth=10.5, thresh=0.5, blurlevel=2, cm=0)
input = input.xsharpen(255,255)

# return the clip in its original size, this will just have enhanced edges
RETURN input.Lanczos4Resize(clp_width,clp_height).RemoveGrain(mode=1)
}

#----------------------
FUNCTION blockbreaker(clip input, clip bv1,clip bv2, clip fv1, clip fv2, clip clp12, int frames)
{
# create a blockmask
blockmask = mvmask(input,bv1,kind=1,ml=6,gamma=3).mt_invert.mt_binarize.mt_expand.mt_inflate

# creatre a flowed and stabilized clip
clpnb = (frames==2) ? interleave(input.mvflow(bv2,IDX=idx_pointer),input.mvflow(bv1,IDX=idx_pointer),input,input.mvflow(fv1,IDX=idx_pointer),input.mvflow(fv2,IDX=idx_pointer)) \
: interleave(input.mvflow(bv1,IDX=idx_pointer),input,input.mvflow(fv1,IDX=idx_pointer))
clpnb = (frames==2) ? clpnb.temporalsoften(2,1,1,32,2) : clpnb.temporalsoften(1,1,1,32,2)
clpnb = (frames==2) ? selectevery(clpnb,5,2) : selectevery(clpnb,3,1)

# merge the clips together to smooth the blocks
clp12 = mt_merge(clp12,clpnb,blockmask)
RETURN (clp12)
}

foxyshadis
4th March 2008, 07:52
IanB's going to be very annoyed at you. :p

You never actually do anything with the vector_prefilter2.MvAnalyse(.... clips, but I assume that's intentional. You should probably include "global idx_pointer = idx_pointer + 1" in blockbreaker, or it will use the wrong idx if called after DCW_STRONG_DENOISE.

Note that isn't even necessary anymore; every thread internally gets its own idx offset or something like that in the latest releases of mvtools, so it's completely safe to just use a hardcoded number even with multithreading.

Just don't use the same hardcoded number as some other script! A random higher idx or a global idx like you use is much safer when mixing mvtools functions.

Oh yeah, and your idx initialization needs to be outside the function or it'll be the same for every thread (but will work fine with newer mvtools anyway). The file also has to be imported before the setmtmode/mt.

halsboss
4th March 2008, 08:56
Whoa ! That's the last thing anyone needs. :)

Thanks for the explanation.

I attempted to use the "logical flow" of MC_SPUDS's code and function calls, and that's what I thought it ended up to be... off to review that, then.

Spuds
5th March 2008, 04:19
@halsboss

First no problem taking the function and doing what you want to it, its how we learn! Share, reuse, tweak, learn :)

limit = (defined(limit)) ? limit : (defined(limit)) ? select(limit , 96 ......
Yeah thats wrong, must have forgotten to take my medication that day. The way its written unless you passed the function a limit value it would always be 128, no real harm just not as intended. The forth/fifth limits should be strengths. Thanks for catching that!

foxyshadis already gave you a few pointers on that script. I believe the blockbreaker comment is due to the fact that you don't call it from within DCW_STRONG_DENOISE, so if you intend to call it outside that function you need to be careful.


OK onto some new stuff, I have posted a new version of the script with several important changes. I have not updated the wiki so for now you can only get in at the link in post #2. This is a test version, thats why I have not updated the wiki.

The changes are as follows:
1) It no longer externally upscales the frame, instead it lets mvtools do the work. I have gone back and forth on this point and tried many different resize functions but in the end I could not see any visual difference that really pointed me in one direction or the other, perhaps even a detriment doing it externally. This was further complicated by allowing pel=4 in the last update :)

2) Significant changes to the flow=true functions. They now work on frames 1 through 4 where in the past it was only on 3 and 4. They also now use mvcompensate in place of mvflow and use ff3dfilter or dfttest for denoising (instead of removegrain and temporalsoften) on the long temporal clip that flow=true creates. I feel its a significant improvement from the old routine, give it a try !

3) Aggressive=true will work on frames 1-4 instead of just frames 3 and 4. It basically does a two pass through the denoising, a lite first pass and and a second normal for lack of a better description.

4) Various areas cleaned up

Terranigma
5th March 2008, 04:49
You're going to overload your brain one day. =P
Anyways, thanks for the update. I'll test it a.s.a.p. :)

talen9
9th March 2008, 16:34
Spuds, there's a slight typo (I think) in line 73 of the recently modified MC_Spuds.avs (from your .zip archive, but's there in the wiki's version too).

My source was "mod 4" (but not "mod 8") both by width and by height, but then, on the bicubicresize done in line 144, when the clip's width and heigth is halved, AviSynth outputs the error "YV12 width must be multiple of 4".

In the check you're doing in line 73, you're checking for "not-mod 8" sources, but in the comment line above you wrote:
"# baseline clip color size error check, mod 8 and yv12 colorspace"
.

Changing the mod check value in line 73 to "8" has the effect of correctly failing the assert ... that's the way to go, or am i missing something?


:thanks: for you precious work on this function!

Spuds
9th March 2008, 17:44
@talen9

Thats a bit strange ... the function should work with mod4 clips.

Originally I had restricted it to mod8, that was the assert comment line that you found. That restriction caused some a bit of anguish so I opened it up to allow mod4. Ideally you should be mod8 or preferably mod16 for efficiency but mod4 *should* work.

If it was throwing the error on the resize line (part of the final motion mask) it narrows it down a bit. Could you please post the call you made to mc_spuds as well as the clip dimensions so I can try and reproduce the error.

Thanks!

talen9
9th March 2008, 17:59
The source is a PAL R2 DVD, 720x576, cropped to 716x424 by "crop(2,76,-2,-76,align=true)".

The call to MC_Spuds is

MC_Spuds(frames=2, strength=3, thSAD=100)

As i (awfully) tried to explain in the previous post, i think the culprit is the first BicubicResize on line 144:

dering = (edgeclean && anime && strength < 5) ? minblur(clp4,1,1) \
: (edgeclean && anime && strength > 4) ? minblur(clp4,2,1) \
: (edgeclean) ? clp4.bicubicResize((clp_width/2),(clp_height/2)).bicubicResize(clp_width,clp_height,b=0.8,c=0.1).unfilter(-5,-5) : nullclp

The complete error line is:

Resize: YV12 width must be mutiple of 4.
(C:\<path>\MC_Spuds.avs, line 144)
(<calling script>, line 95)


EDIT: the fact that I'm calling MC_Spuds in an "SetMTMode(2,2)"-d script might have to do something with the anomaly? I thought of that only just now ...

EDIT2: erase the previous edit, it behaves the same even if I remove the SetMTMode().

Spuds
9th March 2008, 19:32
Now I got it :)

Nothing like doing some division in a script and then not validating that the results are valid, doh! I've posted a new version via the link in post #2, it should fix that error and allow it to be mod4.

There are a few new items in that script as well that you are welcome to try out.

1) temporal=true .. I'm sure everyone can guess what that is, but if not it uses the temporal de-graining method that Didee introduced some weeks back. Since the script already had 95% of the data needed it seemed like a natural extension to add. Try it with frames 1-4 or flow=true to see if you like its results.

2) prefiltering now follows the strength parameter, this will speed up (well .5fps is a speed up in mc stuff !) processing for lower strengths. You can override with premax=true which will turn on full pre-filtering of the clip for motion vector searches.

3) added ability to specify the sharp parameter to mvanalyze via sharp = (0-2) should someone just want to tweak and play.

Nikos
9th March 2008, 20:11
Spuds thanks for your work, just a correction, in my opinion.
From mvtools doc:

mt_merge

mt_merge : clip clip1, clip clip2, clip mask, bool "luma"(false)

* It's the backbone of the framework. It merges two clips according to the mask. The bigger the mask value, the more the second clip will be taken into account ( the actual formula is y = ((256 - m) * x1 + m * x2 + 128) / 256 )

* luma is a special mode, where only the luma plane of the mask is used to process all three channels.

* u and v are defaulted to 2 (that way, the resulting clip contains the chroma of clip1, and looks right).


From your function:

# add grain to dark areas so encoders dont block them up on a low bitrate, also can give detail illusion
maskdark = (addnoise) ? clp4.mt_lut("x " + th_lo + " < 255 x " + th_hi + " > 0 x " + th_lo + " - " + th_hi + " " + th_lo + " - / 255 * ? ? "): nop()
clp5 = (addnoise && chro) ? mt_merge(clp4,clp4.sharpen(0.25).addgrain(2,0,0),maskdark,luma=true) \
: (addnoise) ? mt_merge(clp4,clp4.sharpen(0.25).addgrain(2,0,0),maskdark): clp4

I thing, this is the correct syntax to add grain in luma and chroma. Because U=2 and V=2 are defaults, unless luma=true override them.

# add grain to dark areas so encoders dont block them up on a low bitrate, also can give detail illusion
maskdark = (addnoise) ? clp4.mt_lut("x " + th_lo + " < 255 x " + th_hi + " > 0 x " + th_lo + " - " + th_hi + " " + th_lo + " - / 255 * ? ? "): nop()
clp5 = (addnoise && chro) ? mt_merge(clp4,clp4.sharpen(0.25).addgrain(2,0,0),maskdark, luma=true, U=3, V=3) \
: (addnoise) ? mt_merge(clp4,clp4.sharpen(0.25).addgrain(2,0,0),maskdark): clp4

talen9
9th March 2008, 23:39
Now I got it :)

Nothing like doing some division in a script and then not validating that the results are valid, doh! I've posted a new version via the link in post #2, it should fix that error and allow it to be mod4.


:thanks:

McCauley
10th March 2008, 00:00
Hi Spuds,

first i have to thank you for your hard work on this aweseome script, i tried some other MC denoise scripts, but none of them were so easy to use/understand like this, plus it's fast (okay, that was a lie, but its speed is pretty decent for MC stuff).

I tried it on some DV footage from my Canon XM2 and it looked great.

After all the praise, may i make some suggestions?
I had to examine this script a bit to filter my camcorder footage and found a few things that should be quite useful not only for me. :-)
Since this is becoming a total picture conversion script, i would like to propose some features to bloat it up a bit more. :-)


I dont quite understand the syntax of MVtools, nor the function in your script, but wouldn't it be useful to use only every second frame but the same amount of frames forwards and backwards for anime, because often frames are doubled?
If this is already integrated or doesn't make much sense for some reason i don't understand -> ignore it, i just had this idea while going through the documentation of MVtools.

To apply this script to cleaner sources, weaker modes would be very nice, since mode1 already kills to much detail on good sources like DVD, HD broadcast or disc streams. Additionally a strength=0 to deactivate the denoising would be nice, so one can only use the other useful functions in the script.

A dest_x/dest_y parameter, so it's not needed to call LSF anymore. This parameter should also be applicable to the ContraSharpening and if no sharpening is applied.(Others may not share my opinion, but i find Lanczos for upsizing and Spline36 for downsizing very pleasing.)

Is sharpening only for frames (or even better areas) with little motion like mentioned here (http://forum.doom9.org/showthread.php?t=135194&highlight=frames) already implemented? There is something written in the script, but as far as i understand it it's not what i mean. With the already determined motion vectors it should be possible to write a function that can do that, that should be a really efficient bitrate saver.

The sharpp parameter should be IMHO off at the smallest value e.g zero instead of 3.

From my own humble experience i found a deblocking/debanding function for very dark areas tremendously useful on most sources. A function like i posted here (http://forum.doom9.org/showpost.php?p=1096407&postcount=4) would be nice, since this is basically the same function like the addnoise in dark areas it should be easy to implement in the part of the script. A bool value and a strength value for the deblocking should be sufficient, the gradfun2db can be raised by 0.1 points for every five quant points, a separate value doesn't seem to be necessary to me. As defaults i suggest "darkdb(deblock=24, gradfun2db=1.2)" and "ddbquant(24)" for real life footage, for anime higher values should be usefual by default, but i'm not very familiar with that topic.

Similar to the function mentioned above, i would like to propose a function to apply stronger degrainig for very light areas, since grain is more disctracting in these areas and they normally contain less detail than areas with average brightness. A separate deblocking for these areas doesn't seem necessary to me.

An internal cropping parameter would necessary to use this as an AllInOneScript, since deblock_qed needs mod16 cropping in the begining to to find the blocks, This should apply to every output (only denoised, denoised/resized, denoised/resized/sharpened), so the picture don't has to be cropped/resized to the final size.

I also have some suggestions that are not directly related to the script:
You forgot to mention HQN3D as a necessary filter in the .html.
A version history with the changes in the .html file would be nice. This is just out of curiosity. Additionally links to the older versions would be nice, also out of curiosity.:)

Smaller jumps in the version numbers, i really don't want to you reach a 1.0, because i'm afraid you could take a break after that. :p

I hope all the suggestions e.g implementation wishes are not too impertinent, because i really appreciate you work on that script!:thanks:
I also hope it was not too much bla bla to read, but i wasn't able to compress my text more, i already denoised it with MC_Spuds. :p
I would like to help you more with code, but unfortunatelly my suggestions are the best i can do, since my scripting skills are not that great.

Regards
McCauley

halsboss
10th March 2008, 00:32
I tried it on some DV footage from my Canon XM2 and it looked great.

Hi, I want to apply this to my DV camera footage too. As I understand it this function processes progressive frames ... How did you (and I shall) deal with adapting it for PAL interlaced frames ? :thanks:

I note http://forum.doom9.org/showthread.php?p=1061218#post1061218 indicates something the code below should work, however I'm not sure of the effect of strong noise on TDEINT or YADIF. One of these should result in interlaced BFF output - any suggestions for a PAL BFF "strongly noised" DV camcorder input shot with a lot of low-light (dusk/night) scenes?


AVISource("somevideo.avi")
ConvertToYV12(interlaced=true)
AssumeBFF()
yadif(mode=1,order=0) # mode=0=deinterlace mode=1=doubleframerate, order=0=BFF order=1=TFF
mc_spuds(frames=4,strength=5)
AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave()



AVISource("somevideo.avi")
ConvertToYV12(interlaced=true)
AssumeBFF()
TDeint(mode=1,order=0) # mode=0=deinterlace mode=1=doubleframerate, order=0=BFF order=1=TFF
mc_spuds(frames=4,strength=5)
AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave()



AVISource("somevideo.avi")
ConvertToYV12(interlaced=true)
AssumeBFF()
interp = separatefields().eedi2(field=0)
tdeint(mode=1,order=0,edeint=interp) # mode=0=deinterlace mode=1=doubleframerate, order=0=BFF order=1=TFF
mc_spuds(frames=4,strength=5)
AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave()

McCauley
10th March 2008, 00:37
Hi halsboss,

i shot in the frame mode of the XM2 which outputs a progressive DV picture, so i unfortunatelly cannot help you, sorry!

Regards
McCauley

Terranigma
10th March 2008, 00:38
How did you (and I shall) deal with adapting it for the interlaced frames issue ? :thanks:
By first progressifying the frames through deinterlacing or restorative methods?

halsboss
10th March 2008, 01:01
Thanks Terranigma, in between posts I had edited that post http://forum.doom9.org/showthread.php?p=1110600#post1110600 with some example deinterlacing, seeking suggestions (not sure of the effect of strong noise on TDEINT or eedi2 or YADIF).

May I also ask what "restorative" means ?

Spuds
10th March 2008, 02:52
@Nikos, technically you are correct, the U=3,V=3 should be added, great catch. I do believe that the luma=true processing implies u=3,v=3 and I ran a short comparison of luma=true vs luma=true,u=w,v=3 and did not see a delta but ....


@McCauley .. wow thats a lot to digest! Let me try to address your points / requests as best I can.

but wouldn't it be useful to use only every second frame but the same amount of frames forwards and backwards for anime, because often frames are doubled?
You should not have a lot of duplicate frames unless you had and interlaced source that you deinterlaced while doubling the frame rate. Consider doing a same frame rate deinterlacing and feeding that to the script.

weaker modes would be very nice, since mode1 already kills to much detail on good sources like DVD, HD broadcast or disc streams. Additionally a strength=0
I'll add a strength=0 that is a low touch mode, thats easy. You can also specify things like thsad=100, ml=255 which would lower the noise removal quite a bit.

A dest_x/dest_y parameter I hear ya on that but there are just SO many ways to do that it would really need its own script to handle it properly. I've already got my hands full with the functions today !

Is sharpening only for frames (or even better areas) with little motion it has that today and its adjustable with the ml parameter. ml is the motion limit value, the higher the value the more something has to be moving to be seen as motion, the lower the less it has to move. ml=255 would basically sharpen everything while ml=0 would be similar to sharpp=3, ie nothing.

The sharpp parameter should be IMHO off at the smallest value e.g zero instead of 3 Purist ! .. I'll add that in the next rev :) sharpp=3 will also remain to keep compatibility.

deblocking/debanding I'll have to spend some time on these points. The script has the light/dark functionality today so implementing the concepts is not difficult, but will not do anything to improve speed either :) I do like the ideas so I'm going to spend some time on this to see what I can come up with.

Yeah the revisions, history and required parts are well lacking to say the least. Never thought this would be a 'project' :p

Terranigma
10th March 2008, 03:07
May I also ask what "restorative" means ?

It means to return in it's original state.
In this case, i'd be talking about through ivtc.

zilog jones
18th March 2008, 02:21
This is a very impressive script - it's working very well on anything noisy I throw at it (analogue cable recordings, old VHS tapes etc.). Good stuff!

However, it seems to be cropping every side by 8 pixels for some reason. Line 161 seems to be doing this - is the crop function supposed to be there? I'm using the latest version from your site (updated on the 16th) and I followed the instructions regarding which plugins to use (I think I have everything). I'm getting no errors. I've tried both 768x576 and 352x240 videos and it's cropping both in the same way.

Spuds
18th March 2008, 03:01
@zilog jones

I *think* you caught me in the middle of an update that caused that problem. Please download the script again, I just finished uploading it to the link in post #2 as well as the wiki.

Latest version 0.9, so close to 1.0 :)

Version 0.9 'finalizes' the changes from the last few betas. The full list of changes are:
V0.9
1. Added temporal=true which uses the temporal de-graining limit from Didee. Since the script already had 95% of the data needed to do this it seemed like a natural extension to include.
2. Prefiltering now follows the strength parameter, this will speed up processing for lower strengths.
3. Added premax=true which will turn on full strength pre-filtering of the clip for motion vector searches (overrides strength settings on pre filtering levels).
4. Added ability to specify the sharp parameter to mvanalyze via sharp = (0-2)
5. Added strength=0 (actually redefined) so its very low touch for higher quality input videos
6. Updated documentation so that sharpp=0 is no sharpening
7. Fixed mod4 error in resize logic
8. Deringing strength now follows the strength parameter. Changed deringing from simple bilinear blur to fft3d for non anime sources.
9. Added mod16 blank borders to improve edge processing and keep clip mod16 for processing. Borders are removed at the end to return the original sized clip.

Enjoy and as always le me know what I broke this time so I can get 0.9a uploaded :p

zilog jones
18th March 2008, 03:42
Seems to be working OK now - thanks!
It is quite slow, but it seems to do a better job than what I was using before (RemoveHighNoiseMC) - it's apparently less destructive regarding removing small shiny things appearing for a short time (i.e. things incorrectly removed/moved for being noise). Lots of settings to mess around with too!

archaeo
18th March 2008, 17:14
Can MC_spuds be used with MT such as:

MT("MC_spuds") ?

I did a couple of quick short clip tests using this, and there didn't appear to be any problems, (it increased fps significantly) but I'm not sure if it would eventually run into problems.

canuckerfan
19th March 2008, 00:18
might be a bit of an obvious question but how well does this retain detail as opposed to mvdegrain3? (i'd imagine it's the same since mc_spuds is also MC'd)

Spuds
19th March 2008, 02:42
@archaeo .. I run it with setmtmode 2 and have not seen any issues as long as you are using the latest version of mvtools. I get a nice speedup as well. I'm not as sure about running it with MT() and my hesitation is how the overall block and overlap processing occurs on the seam that MT() creates. May be fine I'm just not sure :confused: I'd look through the MT thread and see what others have determined about dfttest, fft3dfilter and mvtools.

@canuckerfan .. Well if you call it with frames=3 it will use mvdegrain3 as part of its processing, the strength of it is set via strength=0-6. Lots and lots of options, check the docs for the complete list and set any special modes based on your video and personal preferences of what looks good.

Malcolm
19th March 2008, 16:48
@Spuds,
i just switched from BETA 29.Jan.08 to your latest version 0.9 from 17.Mar.08 and noticed, that the new version seems to reduce noise (esp. color noise) _much less_ than the january version.

Here are 2 screenshots:
First one with the january version (left: unprocessed frame, middle: mcspuds, right: difference 16x amplified)
Second one with the current version 0.9 (left: unprocessed frame, middle: mcspuds, right: difference 16x amplified)
http://img379.imageshack.us/img379/2706/mcspudsjanhq6.th.jpg (http://img379.imageshack.us/my.php?image=mcspudsjanhq6.jpg)
http://img135.imageshack.us/img135/6184/mcspudsmarchmp4.th.jpg (http://img135.imageshack.us/my.php?image=mcspudsmarchmp4.jpg)

I have other clips (but not available at the moment) where the difference between the 2 versions of mcspuds is even bigger. I compared the two scripts using a diff tool but there are so many changes i'm unable to judge why the visual differences are so huge. Maybe you know..?!

I have used mcspuds with the following parameters:
MC_Spuds(strength=6, frames=3, flow=false, focus=false, preprocess=true, postprocess=true)
Altering parameters like 'flow' and 'temporal' only changed the results marginally.

Is it by intention that the new version of mcspuds filters (so much) less?? Or is it a fault?? How can i get the same amount of filtering with the new version of mcspuds?

greetings,
Malcolm

Spuds
20th March 2008, 05:00
@Malcolm

That source looks as bad as what I get off my cable and thats a fact!

I think this issue was a consequence of me tunning the chro=true vs false behavior ... basically increasing how rigorous I was about those intended behaviors.

I believe I know what causes what you demonstrated so well in your post (thank you!). I have posted a .9a Beta for testing in post number 2, please try that version and let me know if it corrects the issue.

Malcolm
20th March 2008, 10:22
@Spuds

Great!
.9a brings back the filtering of this ugly color noise. :) Here's an updated screenshot with the new script.
http://img156.imageshack.us/img156/5031/mcspudsmarch9aiw9.th.jpg (http://img156.imageshack.us/my.php?image=mcspudsmarch9aiw9.jpg)

If you compare it with the first screenshot from my last post, you can see that the large color bandings (violet / green) are removed again (look at the amplified difference). Thanks a lot! :thanks:

On the other hand: if you look at the luma values & finer details in the amplified part, you can also see that with the .9a version there is less 'stuff' removed from the original than with the january version. I'm uncertain if your new script removes less noise or just preserves more details/edges/etc.
(actually you can already see in the screenshots that the new version preserves more details and is also sharper than the old version). But still the question remains: Is it still as effective to noise than before?

Just to get me right: I don't want to criticize your changes in the script, i just want to understand how the behaviour changed. Maybe this is all by intention.

Greetings,
Malcolm

P.S. The screenshots are from very old (10+ years) VHS captures of a famous (or 'cult') german comedy show ('Oliver Kalkofe') which i try restore & preserve on DVD. Actually if you could see a clip instead of just a single screenshot you'd be shocked how bad the flickering colors, noise all over the screen and moving radio interference is. But thanks to your ingenious script, i can fight it effectively! ;)

archaeo
20th March 2008, 15:02
@archaeo .. I run it with setmtmode 2 and have not seen any issues as long as you are using the latest version of mvtools. I get a nice speedup as well. I'm not as sure about running it with MT() and my hesitation is how the overall block and overlap processing occurs on the seam that MT() creates. May be fine I'm just not sure :confused:

Just a quick update:
I went ahead and ran a full encode with MT("MC_spuds"), and found that it did create problems with CCE... I noticed it hung up the program a couple of times over the course of the encode. It may be due to a moderate overclock that I have on my E6700 (OC'd to 3.0Ghz), but I'm not so sure. After finishing, I noticed that the playback would freeze at a number of locations. At this point, although it seems to run, it appears that setmtmode is the most reliable method to use MT.

ChrisW77
20th March 2008, 20:33
I can't get setmode to actually do anything, whereas MT pushed my core2 to it's limits.

For instance

SetMTMode(2,4)
MC_Spuds(strength=4)

stays around the same 3-4 fps I'm getting without SetMT.

Yet

MT("MC_Spuds(strength=4)",2,2)

I get around 8-10 fps. But, I notice a lot of random dots appearing at various times, and the odd corruption now and then.
Still, great script.

archaeo
20th March 2008, 22:23
...I notice a lot of random dots appearing at various times...



Funny you mention that, I have also noticed something similar too ... Do they appear to you as sort of white pixel flashes? They would be what I would describe as a 'sparkle'. I originally thought they may be on the source, but a quick check didn't show them. I'd have to run another encode to see if I can repeat it. I may have even seen this on an encode where I did not use MT("MC_spuds").

ChrisW77
21st March 2008, 00:21
Do they appear to you as sort of white pixel flashes? They would be what I would describe as a 'sparkle'

Kind of, although most are just random pixels across the screen. A bit like lots of dots, some light coloured, some grey-ish.

Spuds
21st March 2008, 01:35
@Malcolm .. I've uploaded a .9b to the link in post number 2. To answer your questions, yes the latest version I intended to protect details more than the previous versions for lower strength settings.

That said I noted two issues that were causing diminished processing strength that were not intended. One was I used the number of frames instead of the strength value when setting up the prefilter, this left its effect weaker then it should have been. The other issue was well :o I basically nullified the prefilter effect on the motion search. The new version should be much more effective!

@archaeo .. Interesting finding on CCE, sounds like one of the filters is not playing nice with MT processing. Overall I would really expect some form of distortion / artifacts (like a entire bad frame now and then or odd seam in the middle of a frame) vs a stuttering or freezing.

I've run lots of setmtmode runs and they have been artifact free (since mvtools 1.9.1 I think), earlier versions of mvtools and MT did not play nice together.

On thing with setmtmode is that you need to set it as the first line in your script, prior to any processing or loading of videos, or you will not get any speedup. I also tend to go to mode 5 prior to loading a video or any changes in colorspace and then back to mode 2, for example

setmtmode(2,4)
Import("mc_spuds.avs")
setmemorymax(256)
setmtmode(5)
AVISource("some video")
ConvertToYv12()
setmtmode(2,4)
mc_spuds(frames=3,strength=4)

ChrisW77
21st March 2008, 02:20
Using what Spuds posted, This worked well, and so far I haven't seen any artifacts.

SetMTMode(2)
Import("C:\Program Files\AviSynth\plugins\MC_Spuds.avs")
SetMemoryMax(256)
SetMTMode(5)
AviSource("D:\VHS\test1.avi")
ConvertToYV12(interlaced=false)
SetMTMode(2)
mc_spuds(frames=3,strength=4,sharpp=2)

It seems, at least with the VHS material I'm working with, using only 'Mode' values, and not 'Thread' values, I get no problems and great speeds (now seeing 11-12 fps on 720x576 caps).
Using threads like SetMTMode(2,4), there are instances of overlaid pink or green garbage, and even white noise in the sound.

elguaxo
10th April 2008, 15:35
A really great noise removal script! thanks Spuds!!

Now I'm using this on a source that was previosly resized to 640x480

mc_spuds(frames=3,strength=5,debug=4)

All denoising parameters seem to work as expected, but I decided to try the debug option and the result looks like this:

http://img182.imageshack.us/img182/2632/debugzt0.th.png (http://img182.imageshack.us/img182/2632/debugzt0.png)

it's the first frame, which is black, but all the debugging text has been cropped. I'm using this version of your script:
# MC_Spuds()
# Motion compensated noise removal with sharpening -- version: 0.9c BETA - 23.Mar.08

Any hints? Thanks in advance!

Spuds
11th April 2008, 04:48
@elguaxo .. Thanks for complements on the script :)

Regarding the cropping of the debug info, yup its a bug that got introduced in the .9 version. I have a 0.9d that has a couple of small updates just about ready and I'll add a fix for the error you found. Just give me a couple of days!

McCauley
11th April 2008, 13:16
Hi Spuds,

before you post the 0.9d could you please send me 0.8 via PM, i deleted it accidently. With 0.9c colours are oversaturated after denoising (it looks like sat=1.05 or something like that). I'll see if can trace it back to the latest revision.


Regards
McCauley

PS: I don't know if you remember it, but i suggested strong deblocking for dark areas, here (http://forum.doom9.org/showthread.php?t=135739)'s what i came up with. maybe it is of use for your script, or you want to make some suggestions how to improve the function.

Spuds
11th April 2008, 22:47
@McCauley,

You can get the old versions of the script at the wiki (http://avisynth.org/mediawiki/Image:MC_Spuds.avs)
The .8 was the 2-28 one, the various versions of .9 are also available there. Please let me know what you find on the color saturation, seems odd.

I'll take a look at the stronger deblocking in dark areas.

Thanks

salawalas
11th April 2008, 22:52
Beautiful job, Spuds! Thank You.

Infrid
12th April 2008, 15:06
hi,
great script spuds, just what i need, but i don't understand if your script can handle an interlaced source. i have made some test and your nise remover looks better.

http://img86.imageshack.us/img86/4512/testmcnd4.jpg

the last question, i got 1pfs with virtualdub mod, is it normal? (with MT at last 3fps)

here my script, is for PAL VHS, i keep the movie interlaced

LoadPlugin("fft3dfilter.dll")
LoadPlugin("deblock.dll")
LoadPlugin("mt_masktools-26.dll")
LoadPlugin("mvtools.dll")
#LoadPlugin("RemoveDirt.dll")
LoadPlugin("RemoveDirtSSE2.dll")
#LoadPlugin("RemoveGrain.dll")
LoadPlugin("RemoveGrainSSE3.dll")
LoadPlugin("TTempSmooth.dll")
LoadPlugin("RepairSSE3.dll")
loadplugin("ChromaShift.dll")

SetMTMode(2)
import("mc_spuds.avs")

SetMTMode(5)

Avisource("rca_oro.avi")
trim(11861, 14650)
ConvertToYV12(interlaced=true)

ChromaShift(C=2, L=-2)

#FFT3Dfilter(plane = 0,bw=64, bh=64, ow = 32, oh = 32,bt=3, sigma=3.5, sharpen = 0.5)
SetMTMode(2)
mc_spuds(frames=2,strength=4)


thanks
Infrid

elguaxo
12th April 2008, 15:10
i don't understand if your script can handle an interlaced source
you must deinterlace before applying mc_spuds

the last question, i got 1pfs with virtualdub mod, is it normal? (with MT at last 3fps)

yes :p

Spuds
12th April 2008, 19:02
@Infrid

As elguaxo pointed out, you must deinterlace before your run the script. The basic reason for this is that when you consider a frame of video the denoiser expects that the frame is a single moment in time, ie all pixels are spatially related. An interlaced source is a interleave of two moments in time, so the pixels of an interlaced frame are temporally related which is a problem. The script will run on this but the results are not optimal.

re: speed ... yeah motion compensated stuff is slow, and just wait till you deinterlace first ! I will say that 3fps on a dual core for frames=2 seems a bit weak, I would get 4.x with the call you have on my laptop, but processor speed, memory, other programs, etc etc etc

One last thing, do not use RepairSSE3.dll, it has some issues with color corruption, just use plain old Repair.dll

Infrid
15th April 2008, 16:29
thanks guys.

Spuds, i have a strange problem, this is my script (denoiser.avs)


LoadPlugin("fft3dfilter.dll")
LoadPlugin("deblock.dll")
LoadPlugin("mt_masktools-26.dll")
LoadPlugin("mvtools.dll")
LoadPlugin("RemoveDirtSSE2.dll")
#LoadPlugin("RemoveGrain.dll")
LoadPlugin("RemoveGrainSSE3.dll")
LoadPlugin("TTempSmooth.dll")
LoadPlugin("Repair.dll")
loadplugin("ChromaShift.dll")
loadplugin("decomb.dll")

SetMTMode(2)
import("mc_spuds.avs")
SetMTMode(5)
Avisource("L:\primi_dinosauri.avi")
ConvertToYV12(interlaced=true)

ChromaShift(C=2, L=-2)

SeparateFields()
even_frame = SelectEven()
odd_frame = SelectOdd()

SetMTMode(4)
even_frame = mc_spuds(even_frame,frames=2,strength=4)
odd_frame = mc_spuds(odd_frame,frames=2,strength=4)

Interleave(even_frame, odd_frame)
Weave()


when i change strength=2 i get this error, why? :D

http://img167.imageshack.us/img167/2797/errornk7.png

i have an intel dual core E4500, and i still get 2.0fps even with this script that should be slower

45tripp
15th April 2008, 17:55
check mc_spuds dependencies,

unfilter:
http://www6.impacthosting.com/trbarry/downloads.htm