View Full Version : MC noise removal script
Nightshiver
12th August 2008, 21:44
I get this error: "There is no function named 'MVAnalyseMulti' "
I have all the latest plugins.
talen9
12th August 2008, 21:53
Did you read the announcement of this version?
First is that it has been changed to run with the version of mvtools that josey_wells created, so the function is now called mc_spuds_mvt. It will not run with the last official version of mv_tools, you need the 1.9.6.1+ branch.
You'll find it in the MVTools thread, look at the last posts, not the first one.
Nightshiver
13th August 2008, 02:14
what does the +branch mean? On page 49 of the discussion, there are several links to several different versions of 1.9.6.1, but I think the correct one is the 1.9.6.1 final, right?
Ranguvar
13th August 2008, 02:31
Get the last posted one by josey_wells ;)
moviefan
14th August 2008, 14:44
When I use MC_Spuds_mvt, I still have dancing pixels left in static flat areas... Even when I enable postprocessing, there is movement left and the picture gets blurred more... Is there a way to remove this dithering even more in FLAT AREAS without touching other parts of the picture and harming sharpness in detailed areas?
By the way: I use prefilter=3, frames=1-3 (tried all of them), sharpp=3, blocksize=16, overlap=4-8 any my source is 720x576p
Ranguvar
14th August 2008, 17:26
Try adding a FluxSmoothT. If there's already one in MC_Spuds, use higher settings for it.
Spuds
14th August 2008, 21:56
I still have dancing pixels left in static flat areas
You can try various increased settings but you run the risk of killing detail in other areas ... everything is a tradeoff :) Also various issues are still being worked out on the threaded version of mvtools so be careful.
To further increase cleaning try things like:
(aggressive=true) .. This is a two pass mvdegrain option
(temporal=true) .. Another form of two pass mvdegraining but with special limiting
(flow=true) .. This sometimes helps, I think it hurts more often, but depending on the source you may like its results. It uses mvcompensations in place of mvdegrains
(sharpp=0) .. temporarily turn off sharpening to see if that is what is making the pixels stand out.
(strength=4 or strength=5) with prefilter=2, increasing strength changes several items that may help catch those pixels.
You can also just try (mode="high") or (mode="very high") which does much of the above expect for the sharpp=0
Other options are (postprocess=true) for a final 'dusting' or (chro=true) for full luma and chroma plane processing
If none of that works, post a short clip, it might just need some more specific mvanalysis parameters.
Spuds
17th August 2008, 22:48
I made some minor tweaks to the _mvt version of the script and rolled all of those updates (mode, motion compensated pre filter, see changelog for full list) into the original script. I also added a "medium high" mode since the delta from medium to high modes was to big.
Both versions are available here (http://www.rcboataholic.com/MC_Spuds.zip) along with the updated help file and change log.
Edit: Updated file at link, had one with the old block/overlap defaults
mozzle
18th August 2008, 01:32
First, thanks a lot for your work on this very cool script!
It's effective and it's very fun to play with. Thanks especially for modifying for the new, faster version of MVTools.
I was reviewing the documentation and I believe there might be a typo in the thSAD description. The value range is listed as 0-255.
Thanks again for the update!
ankurs
18th August 2008, 15:18
been trying to make mcsharpening() work , i get an error saying invalid arguements to the function mcsharpening() whilst i am putting in the denoised clip , any help ? tips on usage ?t :
edit : i am using the latest mvtools , but i am not denoising from mc_spuds , using udegrain /fft3dgpu and taking the clip from there ..
Lux Delux
18th August 2008, 17:20
Awesome Spuds, with the latest MT mvtools my FPS increased by 4 :eek: without raising CPU usage (using medium_high with tweaked thsad, which is awesome btw)
only thing, when using sharpp=2 I still get this weird 2px border like thingie in my video, example:
http://img228.imageshack.us/img228/2050/borduk8.th.png (http://img228.imageshack.us/my.php?image=borduk8.png)
look at the very top zoomed. When using limitedsharpenfaster outside of the script it doesn't happen. Any ideas?
Didée
18th August 2008, 18:30
@ ankurs: The way mcsharpening() is layed out, you can not use it "externally" for arbitrary post-processing. It works only for internal usage in MC_Spuds.
(You need either motion vectors or MV-compensated frames for this operation, but you don't have them available when you're starting with source.AnyOfTheMCDenoisers(). Therefore, it's needed to modify the "AnyOfTheMCDenoisers()" script itself.)
@ Lux Delux: Hmm ... that could be caused by some plugin filters that silently don't process the outmost border pixels. Such behaviour can cause a slight "edge" (processed pixels beneath not-processed pixels), which subsequently might get amplified by upfollowing filtering operations.
Just a guess, needs further investigation at which stage that border thingy gets introduced.
Nikos
18th August 2008, 21:15
Didée for the contra mcsharpening which is the most suited sharpening routine.
a. mt_lutxy(clp,clp.RemoveGrain(11,-1), "x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+"
\ * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?"), with Srt in the range 0.8-1.5
b. mt_lutxy(clp, clp.RemoveGrain(11,-1), "x x y - "+Str+" * +"), with Srt~1.5
c. the above with Srt=1, mt_lutxy(clp, clp.RemoveGrain(11,-1), "x x y - +")
d. Something else... for sharpening on several frequency ranges, not just a simple 3x3 kernel.
In my test without temporal limiting, the sharpening effect of a is very strong. With temporal limiting, the results are almost identical.
ankurs
18th August 2008, 22:37
@ ankurs: The way mcsharpening() is layed out, you can not use it "externally" for arbitrary post-processing. It works only for internal usage in MC_Spuds.
(You need either motion vectors or MV-compensated frames for this operation, but you don't have them available when you're starting with source.AnyOfTheMCDenoisers(). Therefore, it's needed to modify the "AnyOfTheMCDenoisers()" script itself.)
so i am supposed to denoise using mc spuds before using mcsharpening ?
noob here , dont know how to internally put mcsharpening in mc_spuds.avs and use it :confused:
which mc denoiser :confused: i assume ur asking me to edit mc spuds or mc spuds mvt isnt it ?
edit : so dumb of me , got it :p thanks a lot didee !
Spuds
19th August 2008, 18:16
@Lux Delux ... Glad you are seeing the speed increase, the new mvtools is a nice improvement. I'm not sure what would be causing that top line error, could you please let me know how you were calling the script and the clip size? Also does this appear on all clips you process or was that one somehow a special case?
@ankurs ... mcsharpening is inside of mc_spuds and is on by default, you can turn it off with sharpp=0 or change it to contra with sharpp=1 or LSF with sharpp=2. Its not a standalone function as it needs some value information that is calculated from within mc_spuds, notably the motion vectors. Could you make it standalone, yes, is it worth it if not already doing mc work, most likely not.
@Nikos ... Not sure if one is more suited or not, its the old do you like smode=4 or smode=3? I have made a small update to the routine so that it performs the sharpening to an upsized clip, more in full spirit of LSF so the results are now different.
The files at the old link have been updated if you want to give it a try.
Lux Delux
20th August 2008, 11:12
Hey Spuds :), here's an example where it happens with an NTSC source
mpeg2source("D:\EXTREME_LIMITS\d2v\VTS_01_1.d2v",info=3)
ColorMatrix(hints=true,interlaced=true)
TFM(order=1)
TDecimate()
vinverse()
crop(8,12,-8,-12)
mc_spuds_mvt(mode="medium_high",edgeclean=true,edm_lo=25,edm_hi=25,thsad=200,sharpp=2)
or a different PAL
mpeg2source("D:\BATMAN_1966\d2v\VTS_01_1.d2v",info=3)
ColorMatrix(hints=true)
crop(4,14,-4,-14)
mc_spuds_mvt(mode="high",thsad=170,sharpp=2)
BTW is no one else experiencing this? So I know whether it's perhaps a .dll that screws up with the rest.
Didée
20th August 2008, 11:40
Aahh ... the script is adding black borders to pad the input clip to mod16 resolutions. Black borders introduce a hard edge, that can cause unwanted effects.
Instead, try padding by repeating the border pixels:
# calculate the appropriate borders so its width and height are mod 16, these will be removed later
x_temp = ab16(clp.width)
x1 = round(x_temp / 2.0)
x0 = int(x_temp - x1)
y_temp = ab16(clp.height)
y1 = round(y_temp / 2.0)
y0 = int(y_temp - y1)
# add blank borders (to improve frame edge processsing and make the clip mod 16), we will remove these at the end.
# clp = clp.addborders(x0,y0,x1,y1)
clp = clp.pointresize( clp.width()+x_temp, clp.height()+y_temp, -x0, -y0, clp.width()+x_temp+.001, clp.height()+y_temp+.001 )
nullclp = blankclip(clp) ("+.001" is there for compatibility with Avisynth 2.5.6, not needed for 2.5.8)
This should improve on the issue given that the borders of the input clip are clean. However, if there're any dark pixels left over from original borders, YMMV.
Lux Delux
20th August 2008, 11:51
:thanks: I'll try it out once a current encode using MC is finished :)
Didée
20th August 2008, 12:46
Oops, there was an error in the suggested modification (I misinterpreted what ab16() is calculating).
Code above has been corrected.
Lux Delux
20th August 2008, 17:15
Can't find any borders for now so it seems that fixed it. Thanks again Didee :)
tengo6dedos
21st August 2008, 01:49
help!
im getting this error
mc_spuds_mvt.avs, Line 66, Evaluate: operands of `==' and `!=' must be comparable
thanks
Spuds
21st August 2008, 02:51
@tengo6dedos ... Download the script again, I made the fix for that error plus updated border section with Didées suggestion. Your error was because I had not initialized sharpp to its default value before using it in a logic statement.
@Didée ... Thanks so much for the find and suggestion. Quite the kick in the pants as I added the extra borders just to try and avoid border artifacts from sharpening, doh!
As always updates are here (http://www.rcboataholic.com/MC_Spuds.zip)
ChrisW77
21st August 2008, 13:43
Nice, as always, but I can't seem to get anything out of gpu=true.
setmemorymax(512)
LoadPlugin("C:\Program Files\AviSynth\plugins\DGDecode.dll")
Import("C:\Program Files\AviSynth\plugins\MC_Spuds_mvt.avs")
mpeg2source("D:\DVB-T-Caps\WildChina\china1.d2v", cpu=4, iPP=true, idct=0)
ConvertToYV12(interlaced=true)
AssumeTFF()
LeakKernelDeint(order=1,threshold=12,sharp=false)
Crop(4,4,-4,-4,align=true)
Spline36Resize(640,352)
MC_Spuds_mvt(frames=2,strength=4,sharpp=2,flow=false,focus=false,preprocess=false,postprocess=false,gpu=true)
Simple script, gets me about 12-14fps on a E7200, 4Gb RAM, ATI 4850 512Mb, with GPU=false. Change GPU=true, and it stays the same. :confused:
Would have thought I would at least see a small increase, especially for a 4850.
Spuds
21st August 2008, 14:38
I can't seem to get anything out of gpu=true. The use of fft3dXXX is located in the prefilter stage and in some areas of flow processing, both of which you have turned off in your call to the script, hence no change. You should notice a change if you set preprocess=true, what that would be I don't know as my graphics card is a lamer.
ChrisW77
21st August 2008, 19:59
Cheers, I'll give that a try.
tengo6dedos
21st August 2008, 22:59
Download the script again, I made the fix for that error
yes, now that error is gone but now when i try to use "aggressive" or goin above frames=2 or strengh=2 when having anime=true i get an error saying "dont know what bv2 means"
using mc_spuds_mvt
maybe i have a plugin missing?
LoadPlugin("D:\video\plugins\Unfilter.dll")
LoadPlugin("D:\video\plugins\Undot.dll")
LoadPlugin("D:\video\plugins\RemoveGrain.dll")
LoadPlugin("D:\video\plugins\Repair.dll")
LoadPlugin("D:\video\plugins\SSETools.dll")
LoadPlugin("D:\video\plugins\RemoveDirt.dll")
LoadPlugin("D:\video\plugins\hqdn3d.dll")
LoadPlugin("D:\video\plugins\despot.dll")
LoadPlugin("D:\video\plugins\AddGrainC.dll")
LoadPlugin("D:\video\plugins\dfttest.dll")
LoadPlugin("D:\video\plugins\fft3dfilter.dll")
LoadPlugin("D:\video\plugins\aWarpSharp.dll")
LoadPlugin("D:\video\plugins\WarpSharp.dll")
LoadPlugin("D:\video\plugins\mt_masktools.dll")
LoadPlugin("D:\video\plugins\mvtools-v1.9.6.7.dll")
LoadPlugin("D:\video\plugins\deblock.dll")
LoadPlugin("D:\video\plugins\dctfilter.dll")
LoadPlugin("D:\video\plugins\DGDecode.dll")
Import("D:\video\plugins\LimitedSharpenFaster.avsi")
Import("D:\video\plugins\Deblock_QED.avs")
Import("D:\video\plugins\MC_Spuds_mvt.avs")
thanks
Adub
21st August 2008, 23:40
It's probably a spelling error. Make sure that you are importing your d2v correctly.
If you are, then it is somewhere in the script. Just use "Find".
talen9
21st August 2008, 23:50
"bv2" is actually a clip variable used into the script ... I suspect a little bug caused by the change to the MVMulti functions.
@tengo6dedos: the complete error message should report the line number where the error happens ... if you can write it here, it should simplify the debugging operations ;)
tengo6dedos
22nd August 2008, 01:14
sure,
"dont know what bv2 means: mc_spuds_mvt Line 257, Line 176"
Spuds
22nd August 2008, 04:17
"dont know what bv2 means: mc_spuds_mvt Line 257, Line 176"
Thanks for the bug report, yup another little bug from the conversion to the threaded version of mvtools. I forgot that I used bv2/fv2 frames for a blocking check with the anime flag that can occur during large luma swings over just a few frames. I made the changes and updated the files at the old link.
Looks like more changes will be required based on the very latest version of mvtools just posted, the current script will work but will probably need some more updates to be optimal.
Adub
22nd August 2008, 18:54
It will be best if you wait till that MVtools has been finalized. It's going through alot of changes, and with more to come as well.
elguaxo
5th September 2008, 13:51
Is there a way to avoid these spots that are being introduced by MC_Spuds:
http://img403.imageshack.us/img403/9020/spotsdu8.png
comparison - previous | current | next
http://img123.imageshack.us/img123/928/prevhw6.th.png (http://img123.imageshack.us/img123/928/prevhw6.png) http://img527.imageshack.us/img527/5018/currentju1.th.png (http://img527.imageshack.us/img527/5018/currentju1.png) http://img527.imageshack.us/img527/5696/nextqw5.th.png (http://img527.imageshack.us/img527/5696/nextqw5.png)
VOB Sample: http://www.mediafire.com/?e3utfwxdxki
I'm using Avisynth 2.57, MC_Spuds 1.1 BETA - 21.AUG.08 (non multithreaded version) and MVTools 1.10.2.1. And my script is this:
crop( 24, 0, -24, 0)
mc_spuds(mode="low")
Any hints? TIA.
edit: I'm seeing more frames that show this problem. I think it's always during a scene change.
Terranigma
5th September 2008, 19:07
Those look like the chroma artifacts I was referring to when thsad in mvdegrain was raised to a very high amount, like, 800 back when i was trying to get thsadc implemented.
Lower thsadc and see what happens. ;-)
elguaxo
5th September 2008, 19:43
mode="low" is not using a very high thsad, it's using Thsad=400 and the default value for chro is false, so it shouldn't process it. I lowered Thscd1 from 500 (default for mode="low") to 400 and this solved the problem completely:
http://img363.imageshack.us/img363/6259/nospotsfi6.png
:)
Terranigma
5th September 2008, 20:25
and the default value for chro is false
Yea that's right. i've forgotten that I personally edited mc_spuds so that chroma is set to true by default (which is why I recommended that you try altering that parameter).
I'm glad you managed to figure out what the problem was though. :)
elguaxo
10th September 2008, 13:04
One question regarding Thscd2. I'm using v1.1 BETA - 21.AUG.08. The manual says:
Strength Settings
Strength 0 1 2 3 4 5 6
Thscd2 Regular/Anime 105/130 105/130 105/130 105/130 105/130 105/130 105/130
but lines 89-90 are:
thscd2 = (defined(thscd2)) ? thscd2 : (anime) ? select(strength , 85 , 85 , 85 , 85 , 85 , 85 , 85) \
: select(strength , 115 , 115 , 115 , 115 , 115 , 115 ,115)
so, the defaults are 85 for anime and 115 for the rest? It's a long script and I get a little http://img355.imageshack.us/img355/5836/orccrazy21ub5.gif trying to understand it. Thanks! :)
Adub
17th October 2008, 19:23
Bug report:
I am receiving some weird artifacts while working through my Heroes dvd's (on which MC_Spuds does wonders by the way). I have zipped everything together for testing, so see if you can replicate my issue.
I am using MVTools 1.11.4.4. and MC spuds 1.1 Beta 21.Aug.08.
http://www.mediafire.com/download.php?mlj0zyzhmll
Please confirm.
Also, Debug=1,5, etc seems to be broken. Something about "fv1".
Spuds
18th October 2008, 01:04
Thanks for the full bug report and files !
I see the defects you are referring to ... I believe the issue is that with the medium setting its using a blocksize of 16 and an overlap of 4 which can in some cases lead to block development.
You can try leaving it as medium and override the blocksize with blocksize=8 and see if that takes care of the problem. Likewise leaving the blocksize alone and setting overlap=8 may also cure the issue.
Another way to approach the issue is with changing the thscd1 value to something pretty low like thSCD1=50 (with the blocksize=16). The moving background is like mini scene changes and things are getting tripped up with the larger blocksize. I don't know if lowering it that much will cause other issues.
The computer that I'm on at the moment does not have a good screen so I can't tell if that will take care of all the problems. Let me know what you find with the above suggestions.
Oh I'll post an update to fix the fv1 thing, I remember fixing that but never posted the update.
Adub
19th October 2008, 07:12
Yes, changing the blocksize or the overlap does fix the problem. The problem is that decreasing the block size also slows the script down a lot. The overlap adjust fixes most of the artifacts, but they are still there a little bit. But it is a lot faster. Hmm. I might just use MCTemporalDenoise on this one. It destroys a little more facial details, but overall it cleans up the content a little bit better. Plus it's dehaloing is working pretty well with the burned in subtitles.
Sagekilla
19th October 2008, 22:58
Well, blksize for MVAnalyse determines performance rather directly -- In terms of speed (generally speaking) it's as follows: 4x4 < 8x8 < 16x16. Where 4x4 is slower than 8x8 etc..
Adub
19th October 2008, 23:53
Yeah, I understand that. The block size directly specifies the search window. Another thing I might try is using mvcompensate. Just to see how it works.
Adub
21st October 2008, 19:00
Another bug report:
When using "Flow=true" with mode=medium, I get an error saying "Valid modes for bt are (-1,0,1,2,3,4)". Line 343 of spuds has fft3dgpu using bt=5. It seems to be caused by the use of frames==2. The bug is contained in the f14_flow function.
Spuds
22nd October 2008, 01:02
Thanks for the report, I did not know that fft3dgpu did not allow bt=5 since its allowed in fft3dfilter. I'll make the changes and post and update soon.
Adub
22nd October 2008, 07:12
Huh, that is weird. You would think fft3dgpu would be able to do it, but I guess not.
Edit: and is it just me or is line 337 weird?
ov = (temporal) ? 8 : 8
Spuds
23rd October 2008, 02:38
I posted a quick update which should fix the bt=5 issue with fft3dgpu and the fv1 issue during debug views (actually forgot to check the fv1 thing but I remember fixing it some time ago). Anyway the update is available at the link in post #2.
Edit: and is it just me or is line 337 weird? I'll follow the forum rules and say its not you :) Really for me that's a common practice when I'm trying different things. I put in the flexibility in for playing. At some point I was trying different overlay values with temporal processing but for now have left it to be the same.
Adub
23rd October 2008, 03:59
Okay, I just thought I would check. I will download the latest script and keep using/testing ;)
Also, is there a reason why the flow=true function causes excessive banding unless i really turn down the sigma value's? It's kind of insane. I like the flow functionality, but it seems kind of odd that it will always cause insane banding.
Edit: So are you holding off on updating the Multithreaded version for some reason? I have just been testing the single threaded version so far, but I am considering switching to the Multithreaded version soon.
Edit2: Okay, I am going to stick with single threaded for now. The multithreaded version of mvtools is too unstable. Plus there are a few bugs in the MC_Spuds_mvt script.
For example, using the settings:
MC_Spuds_mvt(mode="low", edgeclean=true, gpu=true, sharpp=2, postprocess=true)
I get an error about "MVMultiExtract: Index must be between 0 and number of elements in array minus 1".
Then it complains about line numbers 246, and 176.
Now, I think I understand the error with mode="low", as is only uses 1 frame, and yet you are using the statement "frames - 2" in the multiextract line.
Spuds
23rd October 2008, 22:43
I'm probably not going to update the mutli version, I did it mainly as an experiment. I'll update the script at some point to use the new official 2.0 version of mvtools.
Oh yes I am aware of the banding issue with flow=true, its always been a problem and I think some of that is inherent in how it works. That said I have not worked on that function in some time so I'm sure there are improvements that can be had!
canuckerfan
16th December 2008, 00:17
I'm trying to get mc_spuds working here. i'm calling this: MC_Spuds(frames=3,strength=1,chro=true,edgeclean=true)
but it keeps saying there is no function named "Clense". but I have RemoveGrain and RemoveGrainT in my plugins folder. here's what I have: http://img95.imageshack.us/my.php?image=plugswa7.png
running avisynth 2.5.7
edit: nevermind. i've figured it out. had an old removegrain version.
Vesdaris
27th January 2009, 11:17
Im kinda lost here.
DOwnloaded the latest version.
Checked what plugins i need to get it started
Then tried to call this( just to check if it works and if there are any problems) mc_spuds(frames=2,strength=3)
and i got this
http://img121.imagevenue.com/aAfkjfp01fo1i-28051/loc205/55081_27.01_122_205lo.jpg
does it have smth to do with masktools or mvtools?
Leak
27th January 2009, 18:03
i got this
http://img121.imagevenue.com/aAfkjfp01fo1i-28051/loc205/55081_27.01_122_205lo.jpg
You might want to check that link:
Not Found
The requested URL /aAfkjfp01fo1i-28051/loc205/55081_27.01_122_205lo.jpg was not found on this server.
np: The Bug - Insane (London Zoo)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.