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. |
![]() |
#1 | Link |
Registered User
Join Date: Sep 2009
Location: Poitiers (Fr)
Posts: 77
|
SoftSharpen 8.2 - avisynth script
Hello.
I try to develop an avisynth script: SoftSharpen. The main idea consists to apply different effects on different areas of a picture: sharpening static areas, blurring motion, temporal and spatial denoising. With this strategy, SoftSharpen tries to preserve the compressibility of the video. Some other processings are also implemented: deringing, debanding, deblocking, and an experimental antialiasing. SoftSharpen is provided with some presets ("film","light","anim","vhs",...) in order to use the script easily. Some examples: All options of SoftSharpen (except debanding and deblocking) are compatible with avisynth MT : use setMTmode(2,0). Code:
SoftSharpen(Video, "Blur", "Sharp", "DeNois", "DeNoisT", "Move", "DeBan", "DeRin", "DeBl", "AA", "Overlap", "dct", "Preset", "Fast", "Width", "Height", "Verbose", "Show") Video.SoftSharpen() # medium process Video.SoftSharpen(preset="film") # my favorite process Video.SoftSharpen(preset="light") # weak process Video.SoftSharpen(preset="vhs") # stronger process Video.SoftSharpen(show=true) # to see detected areas on screen All these filters (and many others!) can be downloaded from http://avisynth.org/mediawiki/External_filters or http://avisynth.org/warpenterprises . If someone makes time to test it quickly, I would be happy to have his/her comments to improve this script (a "read me" file is included in the zip file). Thanks ![]() Download : click on this Link to obtain the last version ChangeLog version 7.8 new option Line (integer between 0 and 255) increases dark in lines. Useful especialy for anim. By default, Line=0 (no process) version 7.7 minor modification of Sharp versions 7.4 , 7.5 , 7.6 Optimised sharpening process. The type of Sharp has changed (float now). version 7.3 Optimization of the preset "light" (denoising & speed) version 7.2 The type of DebrT has changed (float now). version 7.1 RemoveGrain (mode 1, 2 or 27) is used for spatial denoising. version 7.0 New option "Overlap" for a better compatibility with MDegrain[1,2,3] and AviSynth MT. version 6.9 Experimental antialiasing (not perfect, but very fast) Fixed a bug when "Sharp=0" in version 6.8 ![]() version 6.8 Faster debanding. Less constraint on the resolution: now, needs only mod4. Optimised sharpening process. version 6.7 Changed the "anim" preset (slower but better). Now, use of UnDot at the end of the script. Some optimizations. version 6.6 Changed the blurring process: now, it is less destructor, but always efficient. version 6.5 Fixed a bug when "fast=true". Anyway, prefer "fast=false" (except for anim perhaps). Last edited by leon1789; 20th January 2012 at 13:47. Reason: new version |
![]() |
![]() |
![]() |
#2 | Link |
Actually in reserve
Join Date: Oct 2004
Posts: 1,605
|
Hi and welcome to the forum Leon,
I am glad you finally made it to doom9 ![]() If a mod could examine and approve the attachment file (1 avsi file + 1 or 2 readme) thanks. If not, I suppose Leon could post the script of the avsi as quoted text to get things started. I have used this multi-usage script (older french revs) for a quite a while with good results. Presets is to get started, but any param can be tuned separately for desired results. ![]() Did
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first Want to exchange on AutoGK? try doom10.org In reserve (inactive) for an undefined period of time. Last edited by BigDid; 10th September 2009 at 18:21. Reason: Alternate link integrated in 1st post |
![]() |
![]() |
![]() |
#3 | Link |
HDConvertToX author
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
|
could you post some screenshots of this filter at work ?
BHH
__________________
HDConvertToX: your tool for BD backup MultiX264: The quick gui for x264 AutoMen: The Mencoder GUI AutoWebM: supporting WebM/VP8 |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Sep 2009
Location: Poitiers (Fr)
Posts: 77
|
Of course, here two images.
The first shows a car moving quickly: in fact, on the video, the car is almost motionless, but the background moves much. So the cars (in green) is sharpened and the background blurred (in blue). ![]() On the second image, an object moves, and man and flower are motionless. So the object is blurred (in blue) and the men and flower are sharpened (in green). (Denoising is red) ![]() Last edited by leon1789; 8th September 2009 at 18:15. |
![]() |
![]() |
![]() |
#5 | Link |
Actually in reserve
Join Date: Oct 2004
Posts: 1,605
|
Hi Buzz,
The blur effect can be disturbing but very useful to raise compressability, like for a 2 pass encode. It can be disabled by using softsharpen(blur=0) If you look at the car and the roof picture, you loose details on the roof because the effects of softsharpen(), without presets or params, are quite strong. You get them with softsharpen(verbose=true): Blur 21 Sharp 20 Spatial and Temporal denoising 7 Deringing 4 Movement detection 41 On this source you could adjust the blur to a lower level, Ex: blur=12 (only on motion/moving parts) and/or the denoising like Denois=3 (all parts of the source needing denoising as analysed by/for Mdegrain) to regain details on the roof but loose some compressibility. Preset="film" or Preset="light" are good starting points and you can use estimsoftsharpen() on a small part (comptest) to compute a more precise sharp level ![]() Did
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first Want to exchange on AutoGK? try doom10.org In reserve (inactive) for an undefined period of time. Last edited by BigDid; 8th September 2009 at 18:15. Reason: Oops, older rev, params missing |
![]() |
![]() |
![]() |
#7 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,687
|
Wow, very cool. Thanks for the new script! I'll have to try this out on a couple of encodes. Wonder what the speed is like...
Edit: Okay, um... how does EstimSoftSharpen() work? I just insert it and wait for my estimsoftsharpen.txt file, correct? I'm not getting any text file. Last edited by Adub; 10th September 2009 at 00:27. |
![]() |
![]() |
![]() |
#8 | Link |
Actually in reserve
Join Date: Oct 2004
Posts: 1,605
|
Hi Adub,
It is fair, I suppose because the filters/functions used like: Deen, Msharpen, BlindPP or gradfun2b are less sophisticated than in the big scripts. Therefore the usage is more suited for conventionals sources and less for "extreme" restoring . Hey, who does restore the Startrek1,2 or 3 everyday? Anyhow, give it a try you could have good surprises ![]() It can even be full MT with some tweaks if interested ![]() Did PS: Note to Leon1789; bug with the preset "anim" in the 6.4 rev; enter parameters manually if needed until bugfix. Preset "anim" has the following parameters: Blur 21 - Sharp 15 - Derin 3 - Move 38 -Denois 10 - DenoisT 10 - Deban 2 - debl 0 PS2: Estimsoftsharpen() needs an encode to trigger the text file, use a short length or a SelectRangeEvery()
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first Want to exchange on AutoGK? try doom10.org In reserve (inactive) for an undefined period of time. Last edited by BigDid; 10th September 2009 at 01:25. Reason: anim parameters |
![]() |
![]() |
![]() |
#9 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,412
|
Quote:
Code:
VB = Fast ? nop : Super.MAnalyse(isb=true, blksize=blk, TrueMotion=true) ... Video1 = Video0.MDegrain1(Super, VB, VF, thSAD=DeNoisT*50) |
|
![]() |
![]() |
![]() |
#10 | Link |
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
It would be safer to do:
Code:
VB = Super.MAnalyse(...) ... Video1 = Fast ? Video0.MDegrain(...) : Video0
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
![]() |
![]() |
![]() |
#11 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,412
|
You've got that the wrong way round. It should be
Video1 = Fast ? Video0 : Video0.MDegrain(...) Quote:
So it will throw a type mismatch when used as a vector clip. |
|
![]() |
![]() |
![]() |
#13 | Link |
Registered User
Join Date: Sep 2009
Location: Poitiers (Fr)
Posts: 77
|
EstimSoftSharpen is a minor function: it measures the motion of the video. The result (a candidat number for the "sharp" parameter) is readable in the EstimSoftSharpen.txt file after a real execution of the script on (a part of) the video, for example after an encode as BigDid said.
|
![]() |
![]() |
![]() |
#14 | Link | |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,687
|
Okay, that's dandy, I had no trouble understanding what it did, but my EstimSoftSharpen.txt file is not being created. Both after playing and encoding.
Script: Quote:
|
|
![]() |
![]() |
![]() |
#16 | Link |
Actually in reserve
Join Date: Oct 2004
Posts: 1,605
|
Hi Adub,
Sorry about that. I re-checked with the new rev, no problem here with XP-SP3. Conditions: Vdubmod, short xvid encode with a selectrangeevery() It should be created in the directory where your encode file will take place (xxx.avi or .other). You may want to make a search; exact spelling is "EstimSoftSharpen.txt" Is your script using a mod 16 source? Did
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first Want to exchange on AutoGK? try doom10.org In reserve (inactive) for an undefined period of time. Last edited by BigDid; 11th September 2009 at 02:11. |
![]() |
![]() |
![]() |
#17 | Link | |
Registered User
Join Date: Sep 2009
Location: Poitiers (Fr)
Posts: 77
|
Quote:
I change the version -> 6.6 now Last edited by leon1789; 12th September 2009 at 20:12. |
|
![]() |
![]() |
![]() |
#18 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,412
|
Taking another look at this, I can suggest a couple of minor coding changes (optional, the existing code 'works'):
Code:
function Diff(clip vid, clip v1, clip v2, string color) ... b = Eval("BlankClip(vid, color=" + color + ")") You can pass $0000FF, etc, directly to the function as valid int literals. Code:
Masq = Video.ScriptClip(""" WriteFile("EstimSoftSharpen.txt", \ Round(13+Net/6).string, append=false) """) Code:
Masq = Video.WriteFile("EstimSoftSharpen.txt", \ "Round(13+Net/6)", append=false) |
![]() |
![]() |
![]() |
#19 | Link |
HDConvertToX author
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
|
@leon1789
i would like to include your filter in my HDConvertToX package could i add it ? i think about adding at max 2 preset, SoftSharpen() SoftSharpen(preset="film") would you suggest something different ? BHH
__________________
HDConvertToX: your tool for BD backup MultiX264: The quick gui for x264 AutoMen: The Mencoder GUI AutoWebM: supporting WebM/VP8 |
![]() |
![]() |
![]() |
#20 | Link | |
Registered User
Join Date: Sep 2009
Location: Poitiers (Fr)
Posts: 77
|
Quote:
![]() For preset, I suggest SoftSharpen(preset="film") and SoftSharpen(preset="light"), because spatial denoising is strong with SoftSharpen(). Last edited by leon1789; 15th September 2009 at 10:46. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|