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 > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st June 2022, 17:06   #41  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
You'll need to put your file on some file hosting site, it takes ages to get approve in the forum if you uploaded as attachment.
lansing is offline   Reply With Quote
Old 1st June 2022, 18:43   #42  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,041
So small scripts possibly faster to post in text form. v3 is possibly equal to posted in https://forum.doom9.org/showthread.p...64#post1969764 .
DTL is offline   Reply With Quote
Old 1st June 2022, 21:34   #43  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by lansing View Post
You'll need to put your file on some file hosting site, it takes ages to get approve in the forum if you uploaded as attachment.
https://www.mediafire.com/file/twbbj...se_v3.zip/file

Last edited by takla; 1st June 2022 at 21:38.
takla is offline   Reply With Quote
Old 2nd June 2022, 00:00   #44  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by DTL View Post
One possible way to estimate initial thSAD value is to get MVs for single frame delta and add MShow(showsad=true) and run through footage a bit. It will show 2 numbers at the top left corner and first number is the mean SAD of blocks in frame. So initial thSAD for denoise should be as bit higher (like mean SAD * 1.2..1.5).

I typically use like this:
Code:
super = MSuper(pel=1, mt=false)
forward_vec1 = MAnalyse(super, isb = false, chroma=false, delta = 1, mt=false)
MShow(super, showsad=true, forward_vec1, thSCD1=2000, thSCD2=2000)
For the very high noise levels it something required to set higher thSCD values or the filters stop working (all frames and blocks detected as scene change). Default common mvtools params are thSCD1 (int, 400) , thSCD2 (int, 130). But to process very high noise levels footages increasing required.

You may add it as service function MeasureSAD().

So typical workflow is:
1. Run MeasureSAD() function to look for mean SAD of footage.
2. Setup initial EZdenoize param of thSAD ~ mean SAD * 1.5
3. Adjust TR param to get initial required speed/denoise ratio.
4. Make recursive adjustments of thSAD and TR to finetune denoise/blur/speed ratios.

For this test anime sample mean SAD is about 180..190 so the minimum working thSAD to start MDegrain working should be about 200..250+.
It's pointless going through all that work for a mediocre result. There's a limit in MDegrain on how much noise can be removed, just like from my sample video. Turn up thSAD all you want and there are still going to grain on the image.
lansing is offline   Reply With Quote
Old 2nd June 2022, 00:40   #45  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by lansing View Post
There's a limit in MDegrain on how much noise can be removed, just like from my sample video. Turn up thSAD all you want and there are still going to grain on the image.
Yeah no sh!t. And I wouldn't call the result mediocre. I was conservative with the TR value because I don't know what CPU you have or how much speed matters to you. If you really want to remove ALL grain, use Topaz Video Enhance AI

Last edited by takla; 2nd June 2022 at 04:27.
takla is offline   Reply With Quote
Old 2nd June 2022, 04:22   #46  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Here you go:

Topaz Video Enhance AI v2.6.4 using Artemis Medium Quality v13 (Note: Medium Quality refers to the source material)


Using my AMD Radeon RX 5700 GPU I get about 16 FPS on that type of video.

And here is EZdenoise again, this time with TR8 and settings as before:



I get about 90 FPS with my AMD Ryzen 3900X CPU. Pretty darn good for being over 5 times as fast, if you ask me.

Last edited by takla; 2nd June 2022 at 04:35.
takla is offline   Reply With Quote
Old 2nd June 2022, 05:42   #47  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by takla View Post
Here you go:

Topaz Video Enhance AI v2.6.4 using Artemis Medium Quality v13 (Note: Medium Quality refers to the source material)


Using my AMD Radeon RX 5700 GPU I get about 16 FPS on that type of video.

And here is EZdenoise again, this time with TR8 and settings as before:



I get about 90 FPS with my AMD Ryzen 3900X CPU. Pretty darn good for being over 5 times as fast, if you ask me.
Your EZdenoise support live action???
kedautinh12 is offline   Reply With Quote
Old 2nd June 2022, 07:13   #48  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by kedautinh12 View Post
Your EZdenoise support live action???
You mean real time denoising? Yeah, if your CPU is good enough. With default settings at 1920x1080 8bit I get about 44 FPS

Or you mean if EZdenoise supports real world videos, and not just anime? Of course it does.
takla is offline   Reply With Quote
Old 2nd June 2022, 08:29   #49  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Yeah, real world
kedautinh12 is offline   Reply With Quote
Old 2nd June 2022, 10:31   #50  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 113
Here my quick attempt with TemporalDegrain2; a KNLMeansCL post processing may be more appropriate than dfttest I used:

https://ibb.co/MDZBcFK

Code:
TemporalDegrain2(degrainTR=8, postFFT=3, postsigma=6)
Comparison with takla's EZdenoise: https://imgsli.com/MTEwNjE5; with given settings TD2 removes more noise but uses post processing, so the comparison may not be accurate.

Comparizon with Topaz VEAI: https://imgsli.com/MTEwNjE3; with given settings TD2 removes more noise but blurs the edges more; changing its setting, TD2 can perform better.

Thanks takla for EZdenoise, for sure is competitive and is worth a try (for live action Topaz is not adequate)
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g

Last edited by lollo2; 2nd June 2022 at 10:37.
lollo2 is offline   Reply With Quote
Old 2nd June 2022, 10:55   #51  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,041
" live action???"

In theory it can be tested with FFDSHOW +AVS script RAW processing. So with some in-out capture-playback card (or may be easier with newer IP-based live video streaming) it can process live. Or a set of capture card + some video output card. I plan someday the MDegrain-based cleaner can be installed before MPEG4 live broadcast encoder to help with output quality. For 'large tr' and overlap processing it may be hardware accelerated with a set of DX12-ME accelerators arranged same as typical 'mining rig'. Or may be just with fast enough multicore CPU.

For live with low-delay it is required special mode of mvtools for 'backward search only'. So it can have about 1 frame delay only. But it will cause noise burst after scene change to about tr-number of frames. Or may be some 'intermediate asymetric search' mode with adjusted shift of forward and backward frames to balance between delay and noise burst at scene change.

In theory with MDegrainX (1-6) it can be simulated now with simply collecting MVs from asymetric forward-backward MAnalyse params. MAnalyse need special new shift param to control frames request from MDegrainN in multi mode.

Last edited by DTL; 2nd June 2022 at 11:05.
DTL is offline   Reply With Quote
Old 2nd June 2022, 10:57   #52  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by lollo2 View Post
Here my quick attempt
Hello. Thanks for joining the conversation. And thanks for that website. I'll make use of it in the future.

It would have been great if you had also provided some benchmarks for time spent with each filter.
The last time I tested other degrain filters TemporalDegrain2 was by far the best but also by far the slowest. Has this changed?

And as you correctly pointed out, comparing spatial-temporal denoising vs just temporal, the result is to be expected, especially for anime, where you can use strong sigma without many drawbacks.
takla is offline   Reply With Quote
Old 2nd June 2022, 11:25   #53  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 113
Quote:
Has this changed?
No. TD2 is still very very slow!

Quote:
And thanks for that website. I'll make use of it in the future.
It is somehow useful, but it is just image comparison, which is not enough to judge. The artifacts of a denoise must be evaluated on the running video
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g
lollo2 is offline   Reply With Quote
Old 2nd June 2022, 12:28   #54  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Here is another comparison. This time from a real world video.

https://imgsli.com/MTEwNjM4

I can confirm, the denoising is just as effective in motion.

Settings used:
Code:
ConvertBits(16)
EZdenoise(thSAD=200, TR=8, Chroma=true)
ConvertBits(10, dither=1)
takla is offline   Reply With Quote
Old 2nd June 2022, 13:11   #55  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 113
Quote:
I can confirm, the denoising is just as effective in motion.
I had no doubt! I was just saying that the evaluation should be done watching the video in addition to comparing the images, so my samples did not tell the complete story
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g
lollo2 is offline   Reply With Quote
Old 2nd June 2022, 15:57   #56  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 113
Quote:
Comparizon with Topaz VEAI: https://imgsli.com/MTEwNjE3 with given settings TD2 removes more noise but blurs the edges more; changing its setting, TD2 can perform better.
I changed my mind. It is true that TD2 with that given setting sharpen less the edges, but is more accurate than Topaz VEAI (and eventually an edge enhacement can be added in the AviSynth script). Look to the diagonal lines https://ibb.co/f93tfnN while comparing watching https://imgsli.com/MTEwNjE3 and using full screen option.

The power of AviSynth!

The only doubt I have is that I resized the topaz image from takla for the comparison on imgsli, but I see the artifacts on the original topaz image as well.

P.S.: On the other hand the red stripes on the face are less "defined": a less aggressive denoise in TD2 is required anyhow.
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g

Last edited by lollo2; 2nd June 2022 at 16:20.
lollo2 is offline   Reply With Quote
Old 2nd June 2022, 18:08   #57  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
That true TD2 better than Topaz cause it's slower than Topaz
kedautinh12 is offline   Reply With Quote
Old 3rd June 2022, 02:47   #58  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by lollo2 View Post
I had no doubt! I was just saying that the evaluation should be done watching the video in addition to comparing the images
Yep. I agree and just wanted to clarify.
takla is offline   Reply With Quote
Old 1st July 2022, 18:19   #59  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Added ShowMe()
Can be used to more easily find a good thSAD value.
(Look at the top left corner during preview with AvsPmod)
(And make sure to ignore any value that is shown on frames right after a scene change)
Should be placed right after your Source filter (except for when your video has black bars, in which case you need to crop them first)

Example:

Code:
LWLibavVideoSource("C:\Users\Admin\Documents\INPUT.mkv")
Crop(0, 140, -0, -140)
ShowMe()
I recommend you view 5 different scenes, write down the displayed value, calculate an average, and round it up.

Last edited by takla; 1st July 2022 at 18:31.
takla is offline   Reply With Quote
Old 17th October 2022, 15:57   #60  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
EZdenoise can also work as "DeRainbow" very effectively.

Comparison here

Used with
Code:
EZdenoise(Chroma=true, thSAD=0, thSADC=2000)

Last edited by takla; 17th October 2022 at 16:06.
takla 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 22:38.


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