Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th August 2017, 11:01 | #21 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
also MDeGrain being one of the inter-patch (self-similarity) based approaches, is theoretically equivalent to a sparse coding unit, you can have one or many of those sparse coding layers in your denoising autoencoder and it would reasonably give you results similar to MDeGrain but better
|
16th August 2017, 11:30 | #22 | Link |
Registered User
Join Date: Aug 2006
Posts: 2,229
|
I've updated the script with a setting for that sharpening amount. This is optioned as 'enh' as it targets detail. A setting of 0 completely disables it. Default setting is 20, which is approximately half of what it was. I realise you can't resurrect lost details, that's not the intention. It's impossible to truly resurrect lost details regardless of how it's done, simply because if it's 'lost' then it's not there to recover. The best you can do is use algorithms to determine what is expected to be there, but that's still not recovering the true detail.
I started looking into other filters because I found KNLMeansCL, as well as other filters, had output that just wasn't as clear as it should be. I then thought of ways to circumvent this, the result being mClean. Another consiration is for it to be pretty fast, suitable for most scenarios, and also keeping things relatively simple. The future intention is to add dehalo, dering, derainbow etc as options, and hopefully deblock as well. Strong enough to be effective but not to reduce wanted detail, whilst still remaining relatively fast. Last edited by burfadel; 16th August 2017 at 11:45. |
16th August 2017, 11:57 | #23 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
quality and performance are on the opposite sides of the tradeoff, you simply can't have them both in general
some denosing filter kills a lot of details along with the noise, some kills less, if you're not happy with what you already got, the healthy choice would be making a new denoising filter that kills less details in the first place, not sharpening what's left of the crap |
16th August 2017, 12:36 | #24 | Link |
Registered User
Join Date: Aug 2006
Posts: 2,229
|
That's why the sharpening is only targetting detail, the non-detail is actually being spatially cleaned . Currently it's an 'adaptive' denoiser, but the intention is for it eventually to be an 'adaptive' noiser by default and an cleaner with the options set.
Last edited by burfadel; 16th August 2017 at 13:23. |
16th August 2017, 13:28 | #25 | Link |
Registered User
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
|
burfadel, I'm noticing in this version of MClean no longer has this:
Code:
# Masks LumaMask=mt_binarize(c, threshold=64, upper=true).greyscale().BilinearResize((c.width/16)*2, (c.height/16)*2).BilinearResize(c.width,c.height).mt_binarize(threshold=254) EdgeMask=mt_edge(c, mode="prewitt",thy1=0,thy2=16).greyscale().mt_binarize(threshold=16, upper=true).BilinearResize((c.width/16)*2, (c.height/16)*2).BilinearResize(c.width,c.height).mt_binarize(threshold=254) GrainMask=mt_logic(LumaMask,EdgeMask,mode="and") DegrainMask=GrainMask.mt_invert() |
16th August 2017, 18:40 | #27 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I like this version
first MClean version / MClean 1.1 / KNLMeans(D=2, A=2, h=1.5, channels="YUV") I like this one (middle) best, and it is notably better than your first version. Default Enh=20 looks good, eh=40 is too much.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 16th August 2017 at 18:46. |
16th August 2017, 21:37 | #29 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
This doesn't solve blocking at all. I'll need to run a separate filter for that. You're right, hand in the air on the right is better defined for KNLMeans. The biggest difference, however, is in the curtains and roof, where KNLMeans discards the subtle details as noise giving a slight plastic or washed out effect.
Note than in my sample, I'm applying upscaling and interpolation after denoising which amplifies the denoising difference. Small variations can however cause large variations in interpolation, explaining why one hand would be clearer while other objects have less details. Sometimes it simply changes the motion estimation so that the hand appears clearer one frame earlier or later. So we really have to look at the whole picture.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 16th August 2017 at 22:09. |
17th August 2017, 05:29 | #30 | Link |
Registered User
Join Date: Aug 2006
Posts: 2,229
|
It's hard to compare spatial images when any filter has a temporal component. The temporal stability of motion and detail is something you can't judge in images but can have a huge impact on video quality. I've got another idea that I'll put in this week, many will say it's pointless but it's really simple and some may find it useful.
|
19th August 2017, 16:33 | #32 | Link |
Registered User
Join Date: Aug 2006
Posts: 2,229
|
Updated the script in the first post with a new feature, ReNoise. It's range is from 0 (default, disabled), to 20. This feature allows you to add back some of the luma noise that was removed, which may sound counterintuitive. However, the noise has been temporally cleaned and also spatially modified, so it's not the same as when removed and should have better compressibility. An advantage of doing the modifications to the noise is that it changes only the noise, not also the underlying picture which would be the case if it were applied to the whole picture. There is an option from 0 (disabled), 1 to 10, which adds back 10-100 percent of the modified noise, and 11-20 adds an additional 10 to 100 percent. The modified noise is much weaker, so I thought it would be good to give the option to apply it more strongly . A setting of 5 is probably a good starting point if you wish to use it.
Last edited by burfadel; 19th August 2017 at 16:46. |
20th August 2017, 01:14 | #33 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Interesting. As a denoiser before upscaling, renoising is useless.
As a prefilter on HD content... I've encoded with x264 to see the difference in encoding and taken screenshots afterwards. FrameRateConverter is with preset=Normal... preset=Slower just wasn't working with this at all performance-wise. - RemoveGrain(21) [1.43MB) - MClean() [1.46MB] - MClean(rn=5) [1.46MB] - MClean(rn=10) [1.46MB] - MClean(rn=10), 16-bit processing [1.57MB] MClean gives a plastic effect as a prefilter, or perhaps it could work with lower settings, but with rn=10 it looks better than RemoveGrain. Note that there are considerable rounding errors in 8-bit. If I do the whole processing in 16-bit, quality is much better. I think MClean should internally work in 16-bit if the source is 8-bit, otherwise there are rounding differences on subtle details applied several times in a row. For some reason, I'm unable to convert to 16-bit and back to 8-bit for the prefilter. Code:
Pref=last.ConvertBits(16).MClean(rn=10).ConvertBits(8, dither=1) FrameRateConverter(NewNum=60, NewDen=1, Prefilter=Pref) In terms of performance, this is using MvTools2 which has MT performance issues. With FRC Preset=Normal which uses DCT=0, the encoding won't start at all, it jams, even though MT normally works with DCT=0. With FRC Preset=Slower (non-MT), it drags extremely slowly. |
20th August 2017, 03:35 | #34 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
As for running MClean separately instead of as a prefilter, it considerably decrades the quality.
Prefilter / Denoise (both in 16-bit) I'm getting best results with MClean(rn=10) in 16-bit, but am unable to use it as a prefilter in 16-bit and can't figure out why. Additionally, I'm unable to get a decent encoding done with FRC Preset=slower combined with MClean. But ultimately, that would give the best. |
20th August 2017, 10:55 | #35 | Link |
Registered User
Join Date: Aug 2006
Posts: 2,229
|
I've updated the script again, just note that rn strength may need to be adjusted . You would think that it would work okay as a prefilter, but I suspect using a tempoeral filter for temporal analysis may be the issue? For the down dither, I'm using dither=0 as it would be better for compressibility and for running before framerateconverter.
|
20th August 2017, 16:48 | #37 | Link |
Registered User
Join Date: Aug 2006
Posts: 2,229
|
The whole script doesn't seem to run as a prefilter though, as the script instructs it to convert back to 8 bits. It's as if the MAnalyse of FrameRateConverter is pulling the MSuper/MAnalyse data directly from mClean, hence mixing 16 bit with 8 bit and the error.
|
20th August 2017, 16:52 | #38 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
What's concerning is that it looks like a bug in the core. Perhaps try AVS 2.6?
Duh, there's no ConvertBits in 2.6, never mind!
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 20th August 2017 at 18:34. |
21st August 2017, 22:05 | #39 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Interesting bug.
This freezes when opening in VirtualDub. Later on I ran this through the encoder and it went just fine... Code:
file="Video.mp4" LWLibavVideoSource(file, cache=False) ConvertBits(16).MClean(rn=10).ConvertBits(8, dither=0) Prefetch(8) Code:
ColorBarsHD() ConvertBits(16).MClean(rn=10).ConvertBits(8, dither=0) Prefetch(8) Code:
file="Video.mp4" LWLibavVideoSource(file, cache=False) MClean(rn=10) Prefetch(8) Code:
Pref=AviSource("PreviewPref.avs") FrameRateConverter(NewNum=60, NewDen=1, Prefilter=Pref)
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 21st August 2017 at 22:33. |
21st August 2017, 22:43 | #40 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
OK I've done some comparison tests as a prefilter, running MClean in 16-bit and FRC in 8-bit. These tests take longer because I need to encode the prefilter output as an AVI file and then use that interim file. It gives the quality comparison though.
What did you change in this version? Renoise seems softer. Any settings you recommend for better results as a prefilter? Here I didn't test H264 encoding which may show additional benefits. RemoveGrain(21) / previous MClean(rn=10) / new MClean(rn=10) / new MClean(rn=12) The prefilter AVI interm file is 392MB for previous MClean and 400MB for this version, which indicates there are more details. Performance-wise, MClean in 16-bit encodes into AVI at 6fps on 1080p content. It's a bit slow for a prefilter unless it gives very clear benefits. Burdafel, you don't want to convert back to 8-bit at the end if the source isn't 8-bit.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 21st August 2017 at 22:57. |
Tags |
cleaning, denoise, denoiser, mclean |
Thread Tools | Search this Thread |
Display Modes | |
|
|