Log in

View Full Version : mClean spatio/temporal denoiser v3.2 (01 March 2018)


Pages : 1 2 3 4 5 6 [7] 8 9 10

Micheal813
18th January 2018, 04:28
MClean is working fin with 64 bit Avisynth+. When I try to use 32 bit with Avisynth 2.6, I get:

Avisynth open failure:
Script error: there is no function named "bitspercomponent"
mClean.avsi, line 72

StainlessS
18th January 2018, 04:33
bitspercomponent is AVS+. [If using 32bit Avs+, then maybe need update]

drizzit
18th January 2018, 10:50
Edited, Never mind problem is fixed, found an older post by burfadel with the version he uses and it now works!
(did go to https://forum.doom9.org/showthread.php?t=161411 for the ones I tried but had no luck with those)


That's weird. I've uploaded the version used here. It's the latest version (for now). 7-Zip archive.
https://1drv.ms/u/s!AmGuHbW3zvrBmb4tmBP2-KUToKUpVQ

-----------------------Problem Fixed but leaving incase it helps anyone else-----------------
Trying to update to the latest version while using staxrip I get the following error

System exception - Access Violation
(D:\StaxRip-x64\Apps\Plugins\avs\mClean\mClean.avsi, line 143)
(D:\Temp movies\Stax\random.file.name_temp\random.file.name, line 13)


Line 142 and 143 being the following

filt_chroma = deband==0 ? filt_chroma : deband<>2 ? mt_adddiff (combined, TemporalSoften(mt_makediff(combined, f3kdb (combined, preset=chroma?"high":"luma", range=17,
\ grainY=35, grainC=chroma?38:0)), 1, 255, chroma?255:0, 255, 2)) : combined

I saw Michael813 got an error on the same line but mine does not mention preset and I did make sure I have the 64bit 2pre version of f3kdb.
could it still be the same problem @pinterf found? And if so any chance you could send me that test version too?


My Basic specs
-------------------------- System Environment --------------------------

StaxRip : 1.7.0.4
Windows : Windows 7 Professional
Language : Swedish (Sweden)
CPU : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
GPU : NVIDIA GeForce GTX 980, VNC Mirror Driver
Resolution : 2560 x 1440
DPI : 96

burfadel
19th January 2018, 11:22
It can be downloaded from here:
http://nmm.me/10z

It doesn't have 'modern' high bit depth support along with autolevels, although there is a workaround for that which I'll use. This is just in case it doesn't get updates. Autoadjust is an issue though, since it appears closed source it's up to LaTo to fix it and it appears he may not longer be active on this forum. Ideally f3kdb and autoadjust should be combined. I did try the major change to renoise, but it wasn't any better in 90 percent of cases so I scrapped that particular concept, but there are some other changes I can make to improve it

burfadel
27th January 2018, 11:50
Updated first post to version 2.1. There are lots of changes :). I still haven't added the depth and detail enhancement options, I will need to look into the most optimal base settings for these. Additionally, I need to change the sharpness parameter scaling :).

I probably should also add a list linking the latest required filters, at some stage. In any case, hope you like the new version and it would be great to know what people think of the changes.

ChaosKing
27th January 2018, 14:43
It produces artifacts for me. Tested version 2.1 and also some previous versions.
Lower thSAD dosen't seem to affect (or reduce) the "artifacts".


https://i.imgur.com/IHuiy2m.png

burfadel
27th January 2018, 15:07
The source look pretty clean apart from the aliasing and 'clean' pixellation, so in general the denoising probably isn't necessary. Were those artifacts in areas where there is motion? I can look into it, but on the test clips I have I didn't notice them. Do you have a clip of a few seconds including the above frame? On a side note, it may be possible another feature I will be adding could remove the aliasing. I'll also make it so you can run it independently from denoising, as Avisynth+ allows scripts to contain more than one function. That way, I can call the function from within the mClean part of the script, whilst also allowing the other functions to be applied independently.

ChaosKing
27th January 2018, 16:22
I used PointResize to better show the problem hence the pixelation.
I think the artifacts mostly appear on large flat areas with strong edges.

Here's a sample https://www.dropbox.com/s/ktizz9vxwtkwq26/cut_for_mclean.mkv?dl=1

burfadel
27th January 2018, 17:21
Thanks, I'll look in to that!

burfadel
28th January 2018, 09:33
Updated to v2.2. Fixed chroma not being processed with deband, resolved an issue with chroma debanding features (which didn't affect anything since it wasn't applied!), and added a luma diff so higher bitdepth detail isn't lost when using deband, since it can only be done in 8 bit.

@ Chaosking
I was intending to look into that issue of yours, but instead resolved the issues above. I'll look into soon :).

MysteryX
28th January 2018, 18:57
Can debanding be enabled/disabled?

ChaosKing
28th January 2018, 19:22
# +++ Deband +++
# This will perceptibly improve the quality of the image by reducing banding effect and adding a small amount of temporally stabilised grain to
# both luma and chroma. The settings are not adjustable as the default settings are suitable for most cases without having a large effect on
# compressibility. Auto balance uses Autoadjust, it calculates statistics of the clip, stabilises temporally and adjusts luminance gain & colour
# balance of the noise reduced clip.
# 0=disabled, 1=deband only, 2=auto balance only, 3=both deband and auto balance, 4=deband and veed, 5=all

burfadel
29th January 2018, 06:56
Updated first post to v2.3.

I think the artifacts mostly appear on large flat areas with strong edges.

Issue should be resolved now!

Can debanding be enabled/disabled?

As Chaosking highlighted, yes, deband etc can be disabled.

lansing
29th January 2018, 08:19
Issue should be resolved now!


No it still doesn't. Seriously have you ever test out your script on actual videos? I mean the issue existed for 4+ months and it was so obvious to spot.

UPDATE:
I double checked on every plugin I have for the script and looks like I have an outdated RGtools.dll. Artifacts are gone now.

ChaosKing
29th January 2018, 10:05
Unfortunately the artifacts are still present. I also updated all plugins just in case.
The only older version I have on my drive is 1.3c_2 (29 August 2017), and it produces artifacts too.

EDIT

Sorry, I forgot the dehalo filter in my script. It seems like the problem is fixed now!

Taurus
29th January 2018, 12:46
@burfadel
You should really make it clear in the first post of your thread, that your script is only running on Avisynth+.
Would have saved me a lot of messing around with plugins and error messages...
Groucho2004's AVSMeter finally sorted it out for me.
And an exact list of all the needed plugins with download list would really be appreciated.
Thank you.:thanks:

zub35
3rd February 2018, 13:45
There is a great plugin chroma denoise for VirtualDub - "Camcorder color denoise" http://acobw.narod.ru
If use it before mClean, on the digital record / very-lossy encode, gives excellent results. Alas, only 32bit and rgb

burfadel
3rd February 2018, 15:52
Yes, chroma is probably more difficult than luma. Currently making some changes, although there will likely be a delay as I may have found an issue with MVTools that affects one of the changes.

Selur
4th February 2018, 09:14
You should really make it clear in the first post of your thread, that your script is only running on Avisynth+.
I agree, since a few users asked me about adding support for the filter in Hybrid, but I had to decline that request due to the Avisynth+ dependency. (I only use AvisynthMT and Vapoursynth in Hybrid.)

That said, are there any plans to port this to Vapoursynth?

Cu Selur

burfadel
6th February 2018, 07:59
I agree, since a few users asked me about adding support for the filter in Hybrid, but I had to decline that request due to the Avisynth+ dependency. (I only use AvisynthMT and Vapoursynth in Hybrid.)

That said, are there any plans to port this to Vapoursynth?

Cu Selur

I'll make a list of required depenedencies and versions with the next release. No plans for vapoursynth conversion, as not sure the actual syntax. Also aren't the plugins a little different now, such that the output wouldn't be the same?

Taurus
6th February 2018, 13:13
I'll make a list of required depenedencies and versions with the next release.

Thank You :thanks:!

ryrynz
8th February 2018, 01:14
Anyone done any comparisons vs FluxSmooth?

Khun_Doug
16th February 2018, 18:34
I noticed something peculiar with v2.3. I have not done regression testing so the problem may exist in older versions. I am attempting to clean a B&W HD rip. The source is cropped 220 on the left and 220 on the right. I believe the HD source is VC1. I am using an I7-6850K with 12 threads. I use a prefetch of 8, and later I tried 10. What I notice is the speed starts at 22 fps. Inevitably at around the 6 minute point into the film the speed slows to around 15 fps and CPU also drops significantly. The script to pre-render the lossless video is now running 5 hours and the speed is 5.6 fps. This is only reading the source, cropping, and using mClean. I also noticed that ffmpeg went from 2.5 GB up to 3.3 GB of memory.

Does this sound like some type of memory leak? Why would it only seem to occur on this particular video? I have used mClean on several other sources, some of those also B&W, and I have not seen this happen. Any thoughts? Perhaps something with AviSynth+?

burfadel
18th February 2018, 08:38
Are all the filters used the latest? I'll release a major update to the script shortly. It's kind of ready now apart from one thing I want in the release.

Khun_Doug
21st February 2018, 19:24
As far as I know, the filters are the latest versions. I began to think the problem was the source video. The ripping software identified the soundtrack incorrectly and nothing could detect any playable audio in the rip. My thought is the odd audio frames confused the readers, causing them to slow down as they got further into the source. I did a second rip of the BD and forced the audio to AC3, and the problem went away.

However, I did notice something else. I have seen this happen on two different rips so I know the problem is not a unique thing. On some of the older sources the borders are not completely clean. I've see this on Summer Lovers and Forbidden Planet, so far. The result is at the edge where the source isn't clean the border seems to get amplified, or widened. The rest of the image is clean, just not at the edge. And it can be very noticeable depending on the scenes. Is there a setting that will have the script to be less aggressive on the borders? If not, is there that such a thing could be added? For instance, a parameter to be less aggressive on the right, bottom, etc. I can get a screen shot if needed.

burfadel
21st February 2018, 19:42
It might need a bit more padding. Still working on the next version, there are considerable changes.

Khun_Doug
21st February 2018, 21:57
If you would like some testing to see how the new version handles this, I am willing to do some testing. These are examples of what I see.

burfadel
24th February 2018, 10:43
Just posted a new version in the first post with considerable changes. There's still some minor tweaking and another feature I want to add to it, but that's to come later.

burfadel
24th February 2018, 10:46
I'll make a list of required depenedencies and versions with the next release. No plans for vapoursynth conversion, as not sure the actual syntax. Also aren't the plugins a little different now, such that the output wouldn't be the same?

Forgot about this post :). I don't have time currently to do this, I'll post it within the next few days.

If you have the very latest RGTools, Avisynth+ build, modplus, MVTools, Masktools, f3kdb, and chikuzen DCTFilter update, you should be fine :)

Please note I just updated the first post with the correct v3.0 version, not the earlier test version as previously.

zub35
24th February 2018, 22:18
On 3.0 again compatibility issues. Only works with "Intel SDE"
Maybe problem in masktools. First MT-mode, second ST-mode.
http://images2.imagebam.com/f2/65/15/c93acb760586423.png

burfadel
25th February 2018, 03:21
Are you using the latest MaskTools and MVTools by Pinterf?

zub35
25th February 2018, 03:30
Yeah. I tried not only the latter, alas, everywhere this problem.
Try to check yourself through the flag -p4p (sde.exe -p4p -- AVSMeter64.exe test.avs)
This will be emulation Pentium4-Prescott and Core2Quad-Kentsfield even on new CPUs

burfadel
25th February 2018, 09:32
Yeah. I tried not only the latter, alas, everywhere this problem.
Try to check yourself through the flag -p4p (sde.exe -p4p -- AVSMeter64.exe test.avs)
This will be emulation Pentium4-Prescott and Core2Quad-Kentsfield even on new CPUs

If it's a problem with one of the tools, it would be best to post it in the appropriate thread. Most of the tools were updated by Pinterf, who did a great job :), but it may have caused problems with older processors with certain functions.

For the relevant versions:
Masktools: https://forum.doom9.org/showthread.php?t=174333
MVTools: https://forum.doom9.org/showthread.php?t=173356
RGTools: http://forum.doom9.net/showpost.php?p=1809183&postcount=239 (although it's not a specific thread for it)
Avisynth+: https://forum.doom9.org/showthread.php?t=168856&page=199

I've updated the first post with v3.1 that has some tweaking. The changes won't resolve the issue you mentioned.

burfadel
25th February 2018, 09:45
Recommended versions (or later):

Avisynth+ r2636: https://github.com/pinterf/AviSynthPlus/releases
RGTools 0.96: https://github.com/pinterf/RgTools/releases
Masktools2 2.2.14: https://github.com/pinterf/masktools/releases/
MVTools2 2.7.25: https://github.com/pinterf/mvtools/releases/
Modplus: http://www.avisynth.nl/users/vcmohan/modPlus/modPlus.html (link down the bottom)
f3kdb 2.0pre2: https://forum.doom9.org/showthread.php?t=161411 (link at top of code window for 2.0pre2, http://nmm.me/tr)
AutoAdjust v2.60 : https://forum.doom9.org/showthread.php?t=167573

pinterf
25th February 2018, 10:39
Masktools, rgtools, mvtools2 and avs+ should work with sse2 and up. Earlier there were a couple of issues with sse2 only computers with specific filter parameters, but they were fixed (I was aware of).

zub35
25th February 2018, 13:28
I've updated the first post with v3.1 that has some tweaking. The changes won't resolve the issue you mentioned.

This will sound very strange, but version 3.1 has worked without compatibility issues. While the 3.0 version gives a problem.

pinterf, Let's try to figure it out. I will send you in private messages script version 3.0 and we will try to find out why this happens, so that in the future there was no such.

burfadel
25th February 2018, 14:01
That's weird, I can't think of a valid reason for that. The changes were with MAnalyse thSAD, and using reduceflicker function of clense only if it proved beneficial.

pinterf
25th February 2018, 14:12
There was a non-guarded SSE4.1 instruction in the convolution code in masktools2. Interactive test is on the way.

zub35
25th February 2018, 16:06
burfadel, if deband=0 BitsPerComponent error

phazer11
26th February 2018, 03:41
Love the filter burfadel, really the only thing saving one of my encodes atm. Perhaps you could help me eliminate a filter?

Currently I'm having to use the following script (after a solid few weeks of working on it) to get good results for this aggravating source. I had hoped mClean by itself might be able to do everything I needed but the defaults aren't quite good enough and I was having trouble sorting through for the syntax so had to combine it with my previous best script to have it eliminate the final resistance of noise.


SMDegrain(tr = 12, thSAD = 800, thSADC = 400, contrasharp = false, refinemotion = false, interlaced = false, pel = 1, subpixel = 3, prefilter = 0, blksize = 16, search = 5, Truemotion = false, thSCD1 = 2400, lsb = false)
mClean()


Also would anyone of you fine people be able to help burfadel port his beautiful filter over to Vapoursynth?

burfadel
26th February 2018, 10:09
Could you upload a short few seconds clip? It's hard to make suggestions without knowing what you're working with :D :)

phazer11
2nd March 2018, 10:58
When I can. Rig is going full bore on a batch job atm. A bit about the source. it's an anime from the 90's on BD it's from film stock not sure what kind can't find a description of the type film used. At any rate, hoping to cut out SMDegrain as it's bogging things down, it's also not completely able to get rid of the grain on it's own. In order to get any results with SMDegrain I had to use the thSCD1 parameter at 2400 then add in the settings from my next best setup. When I thought to add in your filter (at default settings mind you) it fixed all the remaining imperfections, well the ones that can be fixed without destroying details. Though there are some super fine details the script can't help but do something to
SMDegrain(tr = 12, thSAD = 800, thSADC = 400, contrasharp = false, refinemotion = false, interlaced = false, pel = 1, subpixel = 3, prefilter = 0, blksize = 16, search = 5, Truemotion = false, thSCD1 = 2400, lsb = false)
mClean()

My laptop isn't great so it'll take several hours overnight to get to the 7-9% point in the first episode (my benchmark as it's easily the worst section I've seen so far). If you could give me a better run down on the syntax for your filter I could try things out. From reading it looked like your filter shares several of the functions as I'd expect though I'm having trouble with syntax. It's been a while since I looked at syntax or code, especially for filters as I didn't have a computer capable for a while, just got some help with a deinterlacing issue (man I'm glad things are progressive these days, though the one I needed help with was fairly nasty).

Here's a before and after shot with the current settings on one of my test frames. The grain is quite dancy and changes pretty much every frame, the script works it just has a lot of overhead from running two filters that I'd like to cut out by cutting SMDegrain out.
http://screenshotcomparison.com/comparison/133368

Edit: Also, updated to your latest version and am getting an error through MVtools (clip and super clip have different bit depths) no idea why.

zub35
3rd March 2018, 22:15
burfadel Is it possible to add a multiplier or passes. For example, with ultra high compression (periscope streams), have to apply mClean twice, which worsens the speed.
Example

ccd(20,1) #Camcorder color denoise
mClean(deband=0,rn=0)
mClean(rn=0)
aWarpSharp2(100)

two adjacent frames before and after (apng) http://images2.imagebam.com/76/ec/3d/6b32f7769202563.png

UPD: After my requests,the author (Sergey 1400) of plugin "Camcorder color denoise" updated and made a 64-bit version. http://acobw.narod.ru
I Propose to add/replace chroma denoise to him in your script mClean.

burfadel
6th March 2018, 04:02
I can work something out there! There's also something what I want to do, I won't have much time until the weekend.

javidial
6th March 2018, 09:05
Where can I download the avs file for this plugin. I've been using the version 1.8 in staxrip and it works very well. I'm impressed. Thanks

Taurus
6th March 2018, 11:35
Where can I download the avs file for this plugin. I've been using the version 1.8 in staxrip and it works very well. I'm impressed. Thanks
Heh:confused:
Just look at the first page of this thread :sly:!
It's not a plugin, it's a script!
Just copy and paste the content of the code to a new avsi.
Make clear you name this script mClean.avsi and you should be done.....

burfadel
6th March 2018, 15:25
Check the dependencies, v3.2 requires recent versions and the output should be a bit nicer as well.

ryrynz
4th April 2018, 11:19
Link to flash3kyuu_deband 2.0pre2 is down, someone up it for me?
Found it (https://www.mediafire.com/folder/2izh9abzep52o/Video_works)

Stereodude
1st May 2018, 14:59
How does mClean compare to MCTD or QTGMC for SD and HD content?

(yes I know QTGMC is a deinterlacer, but InputType=1 works pretty well on progressive content)

Stereodude
2nd May 2018, 16:08
Link to flash3kyuu_deband 2.0pre2 is down, someone up it for me?
Found it (https://www.mediafire.com/folder/2izh9abzep52o/Video_works)
That's the 32-bit version. Do you have a link to a 64-bit one?

Also, this 32-bit one reports that it doesn't have an argument called presets.

Edit: A 64-bit one with a preset argument is available here:
https://1drv.ms/u/s!AmGuHbW3zvrBmb4tmBP2-KUToKUpVQ