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.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th June 2023, 04:23   #1  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
Opposite action of two filters.

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?
Lan4 is offline   Reply With Quote
Old 25th June 2023, 14:11   #2  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 115
Just compare side-by-side or interleaving a simple

Code:
KNLMeansCL(...)
FineSharp(...)
versus

Code:
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
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g
lollo2 is offline   Reply With Quote
Old 25th June 2023, 15:06   #3  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
Quote:
Originally Posted by lollo2 View Post
Code:
KNLMeansCL(...)
FineSharp(...)
I am writing this. But the sharpener somewhere finds the blocks that the denoiser removed.
Lan4 is offline   Reply With Quote
Old 25th June 2023, 15:39   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,416
Quote:
Originally Posted by Lan4 View Post
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

Last edited by poisondeathray; 25th June 2023 at 15:42.
poisondeathray is offline   Reply With Quote
Old 27th June 2023, 16:48   #5  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
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.
Lan4 is offline   Reply With Quote
Old 27th June 2023, 17:18   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,416
Quote:
Originally Posted by Lan4 View Post
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
poisondeathray is offline   Reply With Quote
Old 27th June 2023, 17:23   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,347
Quote:
# 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
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 27th June 2023, 18:33   #8  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
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.
Lan4 is offline   Reply With Quote
Old 27th June 2023, 20:17   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,981
Call DeBlock() as first filter ???
(do not crop prior to deblock)

EDIT: Google
Code:
avisynth deblock
https://www.google.co.uk/search?q=avisynth+deblock
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th June 2023 at 22:00.
StainlessS is offline   Reply With Quote
Old 28th June 2023, 03:25   #10  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,347
Quote:
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.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 12th July 2023, 19:57   #11  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
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.
Lan4 is offline   Reply With Quote
Old 12th July 2023, 20:46   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,981
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.p...03#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
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 12th July 2023 at 21:19.
StainlessS is offline   Reply With Quote
Old 12th July 2023, 21:32   #13  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
thanks, but McDegrainSharp is too complicated and slow for me.
Lan4 is offline   Reply With Quote
Old 12th July 2023, 22:44   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,981
Quote:
is too complicated and slow for me.
Quote:
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]
Code:
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
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 12th July 2023 at 23:00.
StainlessS is offline   Reply With Quote
Old 13th July 2023, 03:44   #15  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
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.
Lan4 is offline   Reply With Quote
Old 13th July 2023, 04:13   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,981
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.

Quote:
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].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 13th July 2023 at 22:50.
StainlessS is offline   Reply With Quote
Old 14th July 2023, 03:56   #17  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
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 is offline   Reply With Quote
Old 14th July 2023, 04:02   #18  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
Quote:
Or is it only speed that counts and your block artefacts less important.
The most important are encoding speed and file reduction.

Quote:
I hope that you are using Pinterf updated mvtools.
i use last version 2.7.45.

Quote:
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 is offline   Reply With Quote
Old 14th July 2023, 12:31   #19  |  Link
Lan4
Registered User
 
Join Date: Dec 2022
Posts: 64
Quote:
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.
Lan4 is offline   Reply With Quote
Old 22nd July 2023, 12:45   #20  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,347
Save:
Code:
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,....
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.