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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 19th June 2020, 14:48   #1  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 394
CAS - Contrast Adaptive Sharpening

https://github.com/HomeOfVapourSynth...apourSynth-CAS
HolyWu is offline  
Old 19th June 2020, 16:50   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,827


Is it a new implementation of CAS?

Seems very fast but also happily sharpens artifacts
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 20th June 2020, 01:11   #3  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 394
Quote:
Originally Posted by ChaosKing View Post
Is it a new implementation of CAS?

Seems very fast but also happily sharpens artifacts
I think the implementation is kinda the same as the official one. What's your parameter and the result? It should look ok for small sharpness value.
HolyWu is offline  
Old 20th June 2020, 11:37   #4  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,827
I used higher values sharpen=0.8 / 1.0
I like the sharpness. Even with high values it produces only minimal oversharpening effects.

CAS(0.8)


Look at the hair ( Don't use zoom in your Browser. Set it to 100% )


p.s. I saw on github that you're adding cas to LSFmod. Will test it later.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 25th June 2020, 08:23   #5  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,836
This looks quite interesting indeed Would it be possible to have an Avisynth+ version as well?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline  
Old 30th June 2020, 13:40   #6  |  Link
masterkivat
変身!
 
masterkivat's Avatar
 
Join Date: Dec 2008
Location: Brazil
Posts: 38
I really liked this filter, the tests I made gave pretty good results, thank you for this, HolyWu!
masterkivat is offline  
Old 5th July 2020, 15:20   #7  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 394
Update r2:
  • Default to process only luma plane for non-RGB formats.
  • Change default sharpness to 0.5.
HolyWu is offline  
Old 5th August 2020, 14:16   #8  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,827
Quote:
Originally Posted by Boulder View Post
This looks quite interesting indeed Would it be possible to have an Avisynth+ version as well?
Avisynth port is rdy https://github.com/Asd-g/AviSynth-CAS
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 5th August 2020, 15:02   #9  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,836
Quote:
Originally Posted by ChaosKing View Post
Thanks for the heads up

And also a big thank you to HolyWu for the original version
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline  
Old 5th August 2020, 15:03   #10  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
you could also make arbitrary filtering contrast adaptive, your own custom sharpening kernels or some other filters, it's basically
Code:
# assume clp is an fp32 clip
clpmax = core.std.Maximum(clp)
clpmin = core.std.Minimum(clp)
contrast = core.std.Expr([clpmax, clpmin], "x y - {eps} +".format(eps=1e-8)) # avoid division by zero

flt = core.xxx.Filter(clp) # some filtering here

adaptive_dif = core.std.Expr([flt, clp, contrast], "x y - z / {strength} *".format(strength=0.05))
clp = core.std.MergeDiff(clp, adaptive_dif)
it's not the exact same algorithm but you get the main idea

EDIT:
this one is closer to the original algorithm, its still not the exact same tho.
Code:
# assume clp is an fp32 clip
clpmax = core.std.Maximum(clp)
clpmin = core.std.Minimum(clp)
maxneg = core.std.Expr(clpmax, "1 x -")
clpmin = core.std.Expr([clpmin, maxneg], "x y min")
contrast = core.std.Expr([clpmin, clpmax], "x y / 0 max 1 min sqrt")

flt = core.xxx.Filter(clp) # some filtering here

adaptive_dif = core.std.Expr([flt, clp, contrast], "x y - z * {strength} *".format(strength=4.0))
clp = core.std.MergeDiff(clp, adaptive_dif)

Last edited by feisty2; 5th August 2020 at 16:15.
feisty2 is offline  
Old 14th November 2020, 23:54   #11  |  Link
Selur
.
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,853
btw. just wanted to note that I really like this filter.
Thanks
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline  
Old 18th November 2020, 07:35   #12  |  Link
sixthofmay
Registered User
 
Join Date: Jan 2009
Posts: 10
Can anyone share the binary for Avisynth 2.6 32bit? I prefer 32bit versions (with XP 32bit support) if possible. I searched the web but only found a binary for Vapoursynth (which I've not used before).

If not possible, how do I create a binary? What developent platform was this created on? I'm a developer but mainly Delphi and Lazarus. It looks like MS Visual Studio. How would I begin?
sixthofmay is offline  
Old 18th November 2020, 08:28   #13  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,827
I don't know about xp support but here is an avisynth version https://github.com/Asd-g/AviSynth-CA...ases/tag/1.0.1
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 18th November 2020, 09:33   #14  |  Link
sixthofmay
Registered User
 
Join Date: Jan 2009
Posts: 10
Thank you! I installed the 32bit version from the link you posted. It tests good in XP SP3 32bit, Windows7 Pro SP1 64bit, and Windows 10 Pro 64bit. I'm using Avisynth 2.6 32 bit.

I'm checking if CAS can reduce or eliminate the Warpsharping on a video I'm working on.
sixthofmay is offline  
Closed Thread

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 18:15.


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