View Full Version : Opposite action of two filters.
Lan4
25th June 2023, 04:23
I use denoise first, like KNLMeansCL. Since I am greatly reducing the video bitrate, I need to use a sharpener after that, such as FineSharp. But the sharpener brings back all the noise (especially blocks) that KNLMeansCL removed. But after all, the denoiser has already removed it?
It seems to me that the filters work as one double processing, rather than a serial process. How to act correctly?
lollo2
25th June 2023, 14:11
Just compare side-by-side or interleaving a simple
KNLMeansCL(...)
FineSharp(...)
versus
FineSharp(...)
There should be a difference, in the first the two filtering actions are both active, and the sharpener takes as input the output of the denoiser
Lan4
25th June 2023, 15:06
KNLMeansCL(...)
FineSharp(...)
I am writing this. But the sharpener somewhere finds the blocks that the denoiser removed.
poisondeathray
25th June 2023, 15:39
But the sharpener somewhere finds the blocks that the denoiser removed.
The blocks were probably not removed entirely. If you zoom in to the denoiser output, you can probably see residual blocks
Finesharp enhances edges, so residual blocks will be enhanced. Finesharp is probably not an ideal sharpener in your situation. There are dozens of other choices, try another one
Or use different settings, or different denoiser/deblocker
Lan4
27th June 2023, 16:48
I have tried other Sharpeners. Some of them do not increase the blocks, while increasing the edges. The problem is that Finesharp thinks blocks are edges. Although the FineSharpPlus mod has separate edges and textures (LSTR and PSTR), the filter refers blocks to edges, not textures. But FineSharp is good because it can adjust the sharpness of textures, unlike most other sharpeners.
poisondeathray
27th June 2023, 17:18
I have tried other Sharpeners. Some of them do not increase the blocks, while increasing the edges. The problem is that Finesharp thinks blocks are edges. Although the FineSharpPlus mod has separate edges and textures (LSTR and PSTR), the filter refers blocks to edges, not textures. But FineSharp is good because it can adjust the sharpness of textures, unlike most other sharpeners.
So get rid of the blocks
Selur
27th June 2023, 17:23
# It's a generic sharpener. Only for good quality sources!
# (If the source is crap, FineSharp will happily sharpen the crap.) ;) source: http://avisynth.nl/images/FineSharp.avsi
Lan4
27th June 2023, 18:33
Thanks for answers.
I have read this information. And I read the topic of the author of this filter. It is not clear what the author means by a bad source by the standards of a decade ago. And my blocks appear due to bitrate reduction and using AMD VCE.
StainlessS
27th June 2023, 20:17
Call DeBlock() as first filter ???
(do not crop prior to deblock)
EDIT: Google
avisynth deblock
https://www.google.co.uk/search?q=avisynth+deblock
Selur
28th June 2023, 03:25
It is not clear what the author means by a bad source by the standards of a decade ago.
He, wrote what the filter is for: "for 1080p, or after scaling 720p -> 1080p during playback (to make 720p look more like being 1080p)"
in my book, a bit rate starved encode isn't really a source that FineSharp was meant to be used, but StainlessS is right if you just bound enough on the source you probably can make it so that FineSharp will work on it.
=> I would too suggest using another sharpener.
Lan4
12th July 2023, 19:57
I have tried many different options. The result has not improved. It's like a swing. Either the blocks are removed, but the details are lost. Either the sharpness is good, but there are also blocks. No sequential processing occurs.
Perhaps this is due to the use of the AMD VCE encoder. At the last stage, he acts according to his principles. I want to try x265 on low presets so as not to lose speed. Perhaps it will be even better than AMD VCE.
Another thought. Avisynth-Deblock and KNLMeansCL have separate settings for Y, U and V. Perhaps this will affect the quality? Let's say real blocks have only borders from brightness. And real textures also have a difference in color. Therefore, increase the deblocking of Y, and decrease the deblocking of U and V.
StainlessS
12th July 2023, 20:46
Maybe try McDegrainSharp(), maybe do a mild debock beforehand [maybe Deblock(~18->22 <default 26 is maybe a bit strong, I never use it, too destructive>)].
Temporal nature of McDegrainSharp may assist in reducing blocking,
and the sharpen stuff is done only on good matching MC blocks, and blurring done on bad MC block matches.
[EDIT: "MC blocks", meaning mvtools motion compensated block matching, not your blocking artefact stuff]
Suggest do McDegrainSharp before any resize.
EDIT: McDegrainSharp v1.05 here:- https://forum.doom9.org/showthread.php?p=1926403#post1926403
(I've got v1.07 but think is in non final state [although I use it])
EDIT: Someone suggested (maybe Boulder) better default for csharp=0.3, default 0.6.
I tend to use 0.3 or 0.4 now.
EDIT: Maybe try changing McDegrainSharp(frames=2<default>).
EDIT: McDegrainSharp, smoothing/sharpen done simultaneously rather than in two steps.
EDIT: Also, TemporalDegrainV2() may be worth a try <I aint ever used it>, its supposed to be good <not sure if it has sharpening or not>.
https://forum.doom9.org/showthread.php?t=175798
Lan4
12th July 2023, 21:32
thanks, but McDegrainSharp is too complicated and slow for me.
StainlessS
12th July 2023, 22:44
is too complicated and slow for me.
I use denoise first, like KNLMeansCL.
Strange, I was under the impression that KNLMeansCL is cripplingly slow.
You actually tried McDegrainSharp() ? <or maybe you like to squeal even before you are hurt>
Also, not too complicated to just do McDegrainSharp().
EDIT: something like [Untested]
Import(".\McDegrain.avs") # whatever the McDegrainSharp script is called <in current directory>.
Avisource(".\whatever.avi") # in current directory
Deblock(18) # Maybe comment out
FRAMES=2 # or 1 <faster> or 3 <slower>
CSHARP=0.3 #~ 0.3 -> 0.6
McDegrainSharp(frames=FRAMES,csharp=CHARP)
return last
Lan4
13th July 2023, 03:44
Coding comparison.
1. x265 CRF24 Faster, without filters - 21 seconds.
2. x265 CRF24 Faster + KNLMeansCL (with SetMTMode Filter) - 24 seconds.
3. x265 CRF24 Faster + McDegrainSharp() - 1 minute 4 seconds.
I think MVTools is not suitable for older computers.
StainlessS
13th July 2023, 04:13
Fair enough, but what are the results like for McDegrainSharp, does it do any better or not.
Or is it only speed that counts and your block artefacts less important.
I think MVTools is not suitable for older computers.
I hope that you are using Pinterf updated mvtools.
Also really old machine (without SSE2) might be very slow. [your timings really surprised me]
EDIT: Also FRAMES=1 faster, and Deblock() would add overhead too. (also you did not mention your sharpener).
EDIT: A few years back on Core Duo [or maybe Pentium D], I spent about 58 Hours on a single encode [~3Hr 20Min src, PAL DVD, 2 disk].
Lan4
14th July 2023, 03:56
It's true. McDegrainSharp with Frames=2 does not create blocks. And it looks great! Even without using deblocking, only with KNLMeansCL(h=2). But this is only with Frames=2. Nothing special happens when Frames=1 is used. But Frames=2 increases the encoding time, by an unacceptable difference.
Clarification. I used the VapourSynth version and settings (plane=0, bblur=0, csharp=1).
Another shortcoming. This sharpener is linear. It will sharpen lines and edges too much if texture detail is to be preserved.
P.S. If everything related to MVtools is of the same quality, then it is better to buy a new computer.
Lan4
14th July 2023, 04:02
Or is it only speed that counts and your block artefacts less important.
The most important are encoding speed and file reduction.
I hope that you are using Pinterf updated mvtools.
i use last version 2.7.45.
also you did not mention your sharpener
I use FineSharpPlus by Dogway. This is a non-linear sharpener. It sharpens edges and textures separately.
Lan4
14th July 2023, 12:31
i use last version 2.7.45.
I am wrong. Mvtools version for VapourSynth v.23, May 8, 2020 by dubhater. Probably the versions of VapourSynth and AviSynth are different. Now I'm looking for a ready-made McDegrainSharp script file for AviSynth.
Selur
22nd July 2023, 12:45
Save:
function McDegrainSharp(clip c, int "frames", float "bblur", float "csharp", bool "bsrch", int "thsad")
{ # Based on MCDegrain By Didee, http://forum.doom9.org/showthread.php?t=161594
# Also based on DiDee observations in this thread: http://forum.doom9.org/showthread.php?t=161580
# "Denoise with MDegrainX, do slight sharpening where motionmatch is good, do slight blurring where motionmatch is bad"
# In areas where MAnalyse cannot find good matches, the blur() will be dominant.
# In areas where good matches are found, the sharpen()'ed pixels will overweight the blur()'ed pixels
# when the pixel averaging is performed.
frames = default(frames, 2)
bblur = default(bblur, 0.6)
csharp = default(csharp, 0.6)
bsrch = default(bsrch, true)
thsad = default(thsad, 400)
bs = (c.width>960) ? 16 : 8
c2 = c.blur(bblur)
super = bsrch ? c2.MSuper(pel=2, sharp=1) : c.MSuper(pel=2, sharp=1)
super_rend = c.sharpen(csharp).MSuper(pel=2, sharp=1,levels=1)
backward_vec3 = MAnalyse(super, isb = true, delta = 3, blksize=bs, overlap=bs/2)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=bs, overlap=bs/2)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=bs, overlap=bs/2)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=bs, overlap=bs/2)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, blksize=bs, overlap=bs/2)
forward_vec3 = MAnalyse(super, isb = false, delta = 3, blksize=bs, overlap=bs/2)
(frames<=0) ? c :\
(frames==1) ? c2.MDegrain1(super_rend, backward_vec1,forward_vec1,thSAD=thsad) :\
(frames==2) ? c2.MDegrain2(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=thsad) :\
c2.MDegrain3(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=thsad)
return(last)
}
into MCDegrainSharp.avsi and place it into your plugins folder,....
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.