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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th August 2021, 11:21   #161  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,510
Quote:
Originally Posted by Dogway View Post
contrasharpening function was fixed to either use spatial or temporal limiting.
Which are the best case scenario to choose from spatial or temporal?
Quote:
Originally Posted by Dogway View Post
Besides that BM3D prefiltering has been added.
Great, I will try it ASAP.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th August 2021, 12:32   #162  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Julek: I had a look into Otsu's method a month ago but wondered whether it would be useful at all. Well it uses histogram bins so that's not something I can do in Expr but I just implemented a cheap dynamic thresholding to ex_binarize() will upload soon. If Adaptive Thresholding doesn't use histogram bins it can be possible, I will have a look.

tormento: Currently in SMDegrain contrasharpening is stuck to spatial limiting. Spatial limiting is like the defacto method, I like it over temporal for anime to keep faithful lineart. Temporal could be useful for situations like poor interframe correlation like noisy sources, shaky or very action oriented films. One option would be to switch from one to another automatically depending on sequence content (via motion vectors).
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 5th August 2021, 12:56   #163  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,510
Quote:
Originally Posted by Dogway View Post
tormento
Thanks.

I tried the prefilter=5 and it gives me the error:

Script error: There is no function named 'MatchColorFormat'.
(D:/Programmi/Media/AviSynth+/plugins64/SMDegrain-3.2.3d~Dogway.avsi, line 657)
(D:/Programmi/Media/AviSynth+/plugins64/SMDegrain-3.2.3d~Dogway.avsi, line 159)


Would you please explain me better what the trymany option does? I have tried to understand thru MVTools manual but it keeps being of obscure meaning to me.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th August 2021, 13:08   #164  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
You need Utils-r41 for MatchColorFormat(). I haven't worked on format conversions lately because Transforms Pack is on halt so for the time being I use internal or other scripts.

trymany I don't know it's a remnant from real.finder's mod. There are still a few things I have to look up.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 5th August 2021, 13:22   #165  |  Link
zorr
Registered User
 
Join Date: Mar 2018
Posts: 447
Trymany is obscure to me as well but my tests indicate that trymany=false gives better results. At least on one test case.
zorr is offline   Reply With Quote
Old 5th August 2021, 14:09   #166  |  Link
Julek
Registered User
 
Julek's Avatar
 
Join Date: Dec 2020
Posts: 83
Quote:
Originally Posted by Dogway View Post
Julek: I had a look into Otsu's method a month ago but wondered whether it would be useful at all. Well it uses histogram bins so that's not something I can do in Expr but I just implemented a cheap dynamic thresholding to ex_binarize() will upload soon. If Adaptive Thresholding doesn't use histogram bins it can be possible, I will have a look.
I think Adaptive is more useful than Otsu's, actually I already use Adaptive in Vapoursynth via numpy, but I believe that a direct implementation via Exp (or std.Convolution in VS) would help the speed.
Julek is offline   Reply With Quote
Old 5th August 2021, 14:54   #167  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,510
Quote:
Originally Posted by Dogway View Post
You need Utils-r41 for MatchColorFormat().
I guess for floating point format used by BM3D or what else?

Edit: tried and can't run both in StaxRip and in VirtualDub2. StaxRip plainly hangs, Virtualdub2 spits the following:



My script:

SetMemoryMax()
SetFilterMTMode("DEFAULT_MT_MODE", 2)
LoadPlugin("D:\Eseguibili\Media\DGDecNV\DGDecodeNV.dll")
DGSource("F:\In\1_33 Grosso guaio a Chinatown\grosso.dgi",ct=132,cb=132,cl=0,cr=0)
ConvertBits(16)
SMDegrain (tr=4, thSAD=400, trymany=false, refinemotion=true, contrasharp=false, PreFilter=5, truemotion=true, plane=4, chroma=true)
Prefetch(6)


AVSMeter64 output:

AVSMeter 3.0.8.0 (x64), (c) Groucho2004, 2012-2021
AviSynth+ 3.7.1 (r3431, master, x86_64) (3.7.1.0)

Exception 0xC000001D [STATUS_ILLEGAL_INSTRUCTION]
Module: C:\WINDOWS\System32\KERNELBASE.dll
Address: 0x00007FFB8450467C


No problems whatsoever with prefilter=4.
__________________
@turment on Telegram

Last edited by tormento; 5th August 2021 at 15:20.
tormento is offline   Reply With Quote
Old 5th August 2021, 19:39   #168  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
Illegal instruction mostly means that your CPU lacks certain instruction (AVX2 on sandy/ivy bridge?) support.
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 5th August 2021, 20:25   #169  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,510
Quote:
Originally Posted by DJATOM View Post
Illegal instruction mostly means that your CPU lacks certain instruction (AVX2 on sandy/ivy bridge?) support.
Yep, I confirm it's a BM3D test2 issue. With test1 I have no problems at all with a simple test script.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th August 2021, 21:03   #170  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Sorry I took the day off. Did you include both dll in the plugin folder, both are needed I think?

About MatchColorFormat() it just converts the clip back to input format since BM3D needs YUV444 (for chroma processing). Ideally I would use a personal function from Transforms Pack, but currently it's in WIP state.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 5th August 2021 at 21:07.
Dogway is offline   Reply With Quote
Old 5th August 2021, 21:31   #171  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,485
Quote:
Originally Posted by Dogway View Post
wonkey_monkey: Is the variable reference output option included in the tool? It's not showing in any of my browsers, it could come very handy for these long sorting networks.
Now updated. It only inserts pixel references for 3x3 or 5x5 networks, with or without the central pixel, so any network with 8, 9, 24, or 25 inputs.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 5th August 2021, 21:59   #172  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Thanks a lot, super time saver, I was wasting more than half an hour each time. I needed it to update "medianST" so a 3x3x3, that means 27 inputs, but you can also clip to closest neighbour (26 inputs) and save in this case about 9 lines of min/max.

Something was a bit wrong though (picking output 12 and 13 for 26 inputs 13 layers):
Code:
K M                   dup1 dup1 min K^ max M^
swap1  M P                      min M^
K N                                    max N^
M N                   dup1 dup1 min M^ max N^

M N
There's nothing to swap, I replaced with:
Code:
K M                   dup1 dup1 min K^ max M^
M P                             min M^
K N                                    max N^
M N                   dup1 dup1 max swap2 min 

x swap2 clip
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 5th August 2021, 23:32   #173  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,135
Quote:
Originally Posted by tormento View Post
Yep, I confirm it's a BM3D test2 issue. With test1 I have no problems at all with a simple test script.
Cause BM3D_VAggregate() move from BM3DCUDA to BM3DCPU in test2
https://github.com/Dogway/Avisynth-S...2.3d.avsi#L653

Last edited by kedautinh12; 6th August 2021 at 00:36.
kedautinh12 is offline   Reply With Quote
Old 6th August 2021, 00:18   #174  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,485
Quote:
Originally Posted by Dogway View Post
Something was a bit wrong though (picking output 12 and 13 for 26 inputs 13 layers)
I think I've fixed it.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 6th August 2021, 10:24   #175  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,510
Quote:
Originally Posted by Dogway View Post
Sorry I took the day off. Did you include both dll in the plugin folder, both are needed I think?
Yep, it was an AVX2 issue.

Please notice that utils-r41 and ZS_shared have duplicate functions in common. I hope it won't give secondary issues.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 6th August 2021, 10:57   #176  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,135
Just delete function duplicate from utils-r41 or ZS_shared
kedautinh12 is offline   Reply With Quote
Old 6th August 2021, 13:36   #177  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,510
Quote:
Originally Posted by Dogway View Post
Sorry I took the day off.
Tested and working with test3 of BM3D.

Now I just have to understand which is better at prefiltering between BM3D and KNLMeansCL, as speeds are comparable when encoding.

Would it be difficult to introduce a function in SMDegrain to show only the differences (as pixels) between the original clip and the resulting one?
__________________
@turment on Telegram

Last edited by tormento; 6th August 2021 at 13:40.
tormento is offline   Reply With Quote
Old 6th August 2021, 14:38   #178  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
As I could observe BM3D is better at motion estimation and probably also at denoising.

There's a function in ExTools that can be used for comparisons:

ex_makediff(a, aug=true, UV=128)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 6th August 2021, 15:24   #179  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,135
Yes, BM3D in my opinion is best denoiser
kedautinh12 is offline   Reply With Quote
Old 7th August 2021, 04:39   #180  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,336
Thanks for the toys Dogway,

Can you check GrainFactory3mod - it appears to do nothing for me, even when using high values for g1str, g2str, g3str and tried different pixel formats. GrainFactory3 ok

colorbars(pixel_type="YV12")
GrainFactory3mod
#GrainFactory3
poisondeathray is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

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 12:07.


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