View Full Version : Soothe() - small helper function for sharpening with less temporal jitter
Didée
6th September 2005, 15:28
Hello friends,
this is a small postprocessor function for sharpening filters. The goal is temporal stabilization of clips that have been sharpened before. It is reasonably fast (contains 3 different YV12Lutxy operations and one TemporalSoften - that's about the cheapest possibility for what is done. Plugin coders are welcome :) ), and seems to work pretty well.
The introduction of jitter on the temporal axis is a general problem of sharpening operations, since sharpening (usually) considers spatial aspects only. Therefore, Soothe() does a very simple job: get the difference between [source] and [sharpened source], apply a TemporalSoften on this difference BUT allow only changes towards 128 ("neutral"), and then apply this temporally calmed difference back to the original clip.
Effectively, this will reduce the overall effect of sharpening - less in static areas, and more in moving areas.
Advantages:
- more steady appearance (less "nervous")
- less bitrate required
- somewhat positive effect on detail that is, due to the sharpening, prone to aliasing
- smoother motion compaired to plain-sharpening, since motion-blurred edges will be less sharpened
- less artefacts in moving areas
- LimitedSharpen can run faster, since one can get away with less supersampling ;)
- should only help, never harm
Disadvantages:
- overall sharpening effect is reduced, but this can be compensated by a little more initial sharpening.
Syntax:
Soothe( [sharpclip], [sourceclip], keep )
"keep" is an integer, range 0 - 100, that tells how much percent of the original sharpening will be kept at least. Default is 25.
Example:
We use LimitedSharpen() as sharpener, and we'll keep at least 20% of its result:
dull = last
sharp = dull.LimitedSharpen( ss_x=1.25, ss_y=1.25, strength=150, overshoot=1 )
Soothe( sharp, dull, 20 )
Easy, isn't it?
Script function: (needs the MaskTools (http://manao4.free.fr/), as usual)
edit 21 Nov 05: corrected LUT expression! (old one could cause weird blurring in certain places!)
function Soothe(clip sharp, clip orig, int "keep")
{
keep = default(keep, 24)
keep = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP = string(keep)
diff = yv12lutxy(orig,sharp,"x y - 128 +", U=1,V=1)
diff2 = diff.temporalsoften(1,255,255,32,2)
diff3 = yv12lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP
\ + " * 128 + x 128 - abs y 128 - abs > x " + KP
\ + " * y 100 " + KP + " - * + 100 / x ? ?", U=1,V=1)
return( yv12lutxy(orig,diff3,"x y 128 - -",U=2,V=2) )
}
Note: Basically, the function is as dumb as it can only be ... but that doesn't seem to hold it back from doing a nice job. :)
Feel free to post your impressions, and/or if you think something should be altered or improved.
unskinnyboy
6th September 2005, 16:04
Whoa! Another Didée product! Can't go wrong, I'm sure. Can't wait to see the effects of this with my own eyes. This seems to effectively address some of the concerns I had with LS() usage. Will be testing soon..
Thanks!
Pookie
6th September 2005, 17:29
Thank You, Thank You, Thank You !
Just tried it. Works with other, less sophisticated sharpeners as well. Great job.
shaolin95
6th September 2005, 17:46
Didee will this help the problem I posted I have with LimitedSharpen with some DVDs. I created a post about it recently. Some DVDs like Two Towers, Die Another Day looks simply awesome almost HD in perceived detail but others show many artifacts like the superbit titles Underworld and Fifth Element. They show artifacts mainly along vertical lines.
MOmonster
6th September 2005, 19:15
Thanks for this new function, Didee.
I´ll test it tomorrow. This is the first time I can fully understand how your function works (thanks for the explaination of the reverse polish notation ;) ).
Keep on the good work.
shaolin95
7th September 2005, 07:39
I just tried it like you posted here in the example and I like it! It helped me fix those DVDs I was having issues with when using LimitedSharpen (the artifacts in vertical lines).
This is my call:
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\colormatrix.dll")
dull = last
sharp = dull.LimitedSharpen( ss_x=1.0, ss_y=1.0,
\ Smode=3, strength=90, radius=2,
\ Lmode=1, wide=false, overshoot=1,
\ soft=false, edgemode=0, special=false,
\ exborder=0 )
ColorMatrix()
Soothe( sharp, dull, 20 )
I am a Avisynth super noob so most of my calls are copy paste and stich them together style. I am still able to resize 2.5x and get smooth playback with this Soothe and LS so to me is a keeper. Gonna try some other settings this weekend as my wife wasnt to happy I had yet another thing to try tonight with my projector...women!!!
Firesurfer
7th September 2005, 09:12
@shaolin95:
I hope you are aware, that the call of ColorMatrix() is not affecting the video in this script. Also ColorMatrix() should be used as first filter in the chain. (Im not sure with interlaced material, though.)
Audionut
7th September 2005, 09:50
I can't get it to work with limited sharpen.
error:
Invalid arguments to function "width"
test.avs, line 19
Script:
import("g:\x\ltsmc.avs")
import("g:\x\soothe.avs")
import("g:\x\blinddehalo3.avs")
import("g:\x\lsharpen2.avs")
source=mpeg2source("D:\test.d2v")
source=crop(source,8,8,-8,-8)
source=lanczos4resize(source,704,384)
video=mpeg2source("D:\test.d2v")
video=crop(video,8,8,-8,-8)
video=ltsmc(video,apmode=4,blcksze=4,chromame=true,sharpness=100)
video=lanczos4resize(video,704,384)
video=BlindDeHalo3(video, rx=3.0, ry=3.0, strength=50,
\ lodamp=0.0, hidamp=0.0, sharpness=1.0, tweaker=0.0,
\ PPmode=1, PPlimit=0, interlaced=false)
video=LimitedSharpen(video,ss_x=1.5, ss_y=1.5, dest_x=last.width, dest_y=last.height,
\ Smode=3, strength=300, radius=3,
\ Lmode=1, wide=false, overshoot=1,
\ soft=false, edgemode=0, special=false,
\ exborder=0 )
soothe(video,source,10)
Didée
7th September 2005, 09:59
Even without Soothe(), *that* script will not load.
Educational question: Why? ;)
edit: Oh, you cleaned up the script. Much better now ... almost good.
Remaining problem: you are assigning all sources directly to clip variables. Hence there's never anything assigned to the "last" variable, hence the "last.width" and "last.height" are causing the error. To make the script semantically correct, you have to write "source.width" and "source.height" in the LimitedSharpen line.
But even then, this is wrong usage. Actually, you're letting Soothe() reduce ALL effects that you have applied to "video", including the de-haloing and the noise reduction. Most probably that is not what you want to do ...
(BTW, opening the same source two times generally is not a smart idea.)
import("g:\x\ltsmc.avs")
import("g:\x\soothe.avs")
import("g:\x\blinddehalo3.avs")
import("g:\x\lsharpen2.avs")
video = mpeg2source("D:\test.d2v")
video = video.crop(8,8,-8,-8)
video = video.ltsmc(apmode=4,blcksze=4,chromame=true,sharpness=100)
video = video.lanczos4resize(704,384)
video = video.BlindDeHalo3(rx=3.0, ry=3.0, strength=50,
\ lodamp=0.0, hidamp=0.0, sharpness=1.0, tweaker=0.0,
\ PPmode=1, PPlimit=0, interlaced=false)
video2= video.LimitedSharpen(ss_x=1.5, ss_y=1.5,
\ Smode=3, strength=300, radius=3,
\ Lmode=1, wide=false, overshoot=1,
\ soft=false, edgemode=0, special=false,
\ exborder=0 )
soothe(video2,video,10)
Now Soothe() is postprocessing only LS's sharpening and nothing else, like intended.
Audionut
7th September 2005, 12:31
Thanks for the clarification.
Works like a charm.
psme
7th September 2005, 13:13
Will this work for REALTIME playback in FFDShow->avisynth, like LimitedSharpen? TIA.
regards,
Li On
Didée
7th September 2005, 13:19
Depends on the horsepower you've available. My elderly Athlon1800 definetly is too weak for that.
Just try it, and report. :)
mg262
7th September 2005, 13:57
Didée,
Yay!
a little relating to this on that thread at
http://videoprocessing.11.forumer.com/viewtopic.php?t=16&postdays=0&postorder=asc&start=15
(Right at the end of page 2 and onwards)
Didée
7th September 2005, 15:08
Note: Edited the thread title ("... helper function ...") to better reflect the function's purpose.
Clouded - yes, already saw it. Just can't dive into it ATM :(
psme
7th September 2005, 16:11
Initial test for realtime playback via FFDShow->avisynth:
Import("C:\Program Files\AviSynth 2.5\plugins\ModerateSharpen.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\Soothe.avs")
dull = last
sharp = dull.ModerateSharpen(0.3)
Soothe( sharp, dull, 20 )
VERY interesting. Need to test more.... :)
regards,
Li On
mg262
7th September 2005, 17:16
Clouded - yes, already saw it. Just can't dive into it ATM No hurry! As you may have noticed I'm being very slow at my end as well...
shaolin95
7th September 2005, 20:15
Sup Li On (I am Luis Gabriel Gerena from AVSFORUM),
I am already using it together with LimistedSharpen, check my previous post here and it works fine even using resize 2.5 x but I do need to run my CPU at 2660MHZ (stock is 2.4).
One question, why doesnt the ColorMatrix work in my call script? I just copied that from another thread about Limited Sharpen and all the scripts there had Color Matrix at the end. What is it for anyway and how do I use it?
Regards
communist
7th September 2005, 20:44
ColorMatrix (...) What is it for anyway and how do I use it?
Regards
http://forum.doom9.org/showthread.php?t=82217
mg262
8th September 2005, 02:50
As anyone who peeked at that link may have seen, I'm trying to write some auxiliary filter-lets to speed up LimitedSharpen and Soothe. Unfortunately, all the content I have at hand at present is a)animation and b) very noisy, which means that it's very hard to tell whether things are working correctly or not. So this is a plea for some small source on which the effect of both filters is very clear -- doesn't matter how small -- even five or 10 frames would be great. [I can keep working by using subtract, etc, but it does make life easier to be able to see what's happening!]
I can receive anything at blendarchive@gmail.com -- and anything will be very gratefully received! (But no 18-rated material or the like please!)
Firesurfer
8th September 2005, 10:05
First: My Apologies to Shaolin95. I typed my comment in a hurry without clarifying what I meant. I guess there's even a forum rule against that ;)
Second:
To make my point I repeat your script first:
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\colormatrix.dll")
dull = last
sharp = dull.LimitedSharpen( ss_x=1.0, ss_y=1.0,
\ Smode=3, strength=90, radius=2,
\ Lmode=1, wide=false, overshoot=1,
\ soft=false, edgemode=0, special=false,
\ exborder=0 )
ColorMatrix()
Soothe( sharp, dull, 20 )
You use the variables dull and sharp for your video, but you don't specify on which of these variables you want to use colormatrix(), so it uses implicit last, which could be sharp or even the unfiltered stream that AviSource gives (I would presume the second). both are not what you want. After that Sothe() is used on sharp and dull, but not on the stream that ColorMatrix() has filtered.
AviSynth documentation on variables should give you further clarification about this.
After all, I guess you read the ColorMatrix()-thread by now and know if you should be using it and why you should use it as the first filter after ...Source().
mg262
8th September 2005, 10:26
you don't specify on which of these variables you want to use colormatrix(), so it uses implicit last, which could be sharp or even the unfiltered stream that AviSource gives (I would presume the second). both are not what you want.I think in this case it will actually generate an error -- AVISynth is pretty good about that.
Firesurfer
8th September 2005, 10:56
I think in this case it will actually generate an error -- AVISynth is pretty good about that.
You are right! It should give an error. But since shaolin95 posted his script, I assumed he used it that way without errors and after I tried it myself I found, that it does in fact give not an error. So I'm not sure on which of the variables ColorMatrix() is used and I thougth it would be good to hint at that. :)
mg262
8th September 2005, 11:06
Really!? I'm amazed that even dull = last gets through. My mistake.
Piper
8th September 2005, 19:44
@Didée: Thanks very much for this filter. It's an elegant solution to a common problem. :D
shaolin95
8th September 2005, 22:14
Any ideas on how to improve my script to better use Soothe with my limitedsharpen script?
Didée
9th September 2005, 15:56
shaolin95 - I see no problem with the script you posted (except for no source is loaded). Just place ColorMatrix() either behind Soothe() instead before it, or put it directly after loading the source.
***
Hmmh ... it just revealed that Soothe seems to be the solver of the flickering issues of the threatened crystality enhancer, too ... :eek: :D
mg262
9th September 2005, 16:35
Oooh... sounds intriguing. But what exactly is crystality ;)?
Didée
9th September 2005, 16:46
In fact it's "weak detail overdrive sharpening" - but "crystality" sounds much cooler. :)
Uh, where were the links ... three examples were linked in this (http://forum.doom9.org/showthread.php?p=656722&highlight=crystality#post656722) post ... cant find the post where I linked to this (http://home.arcor.de/dhanselmann/_samples/LOST_comparison#2-2.mkv) example.
mg262
9th September 2005, 17:05
Didée, you terrify me. If only your interest was in animated material ;)
Incidentally, the last example doesn't load (but three is plenty).
shaolin95
9th September 2005, 18:59
Didee, what is that vertical line artifact that I get with LimitedSharpen and some DVDs. Ive been able to minimize it with Soothe but still is visible sometimes and while is not visible enough to bother me I wouldnt mind getting rid of it completely. Is it due to warp sharps or something like that being used by Limited Sharpen? Is there any special settings for Soothe to eliminate it completely?
Regards
Didée
9th September 2005, 22:12
shaolin95, I can guess some things, but reading minds still is slightly beyond. Please show an example of the problem, and make a sample of the original unprocessed source available.
Perhaps it's in the settings, but supposely it's already something present in the source ... slightly below usual perception, and gets just boosted to become noticeable.
LS does not actively care about source artefacts, and Soothe tames down the effect of sharpening only, not any discontinuities that were already present beforehand. If the result is not stable because of original instabilities, then you need additional pre- or post-processing. Possibilities are plenty ... - show a sample.
shaolin95
10th September 2005, 03:42
Gonna try to capture with my camera cause I am using VRM9 or perhaps let me try to get screenshots under overlay. Anyway, the problem could be describe as some vertical lines (borders of ojbects) having a "wave" effect to them (wavy lines?).
Regards
Pookie
10th September 2005, 05:46
Didée: Is this the 'Crystality' example you were linking to ? :
Lost (http://home.arcor.de/dhanselmann/_samples/LOST_comparison%232-2.mkv)
That one in particular is rather impressive. :cool:
kassandro mentioned elsewhere "With this improved algorithm ReduceFlicker v0.5 will catch much more flicker hopefully without a significant increase of artifacts". Perhaps that might be helpful for Crystality?
Didée
10th September 2005, 16:14
Pookie -
Let's see. As of now, ReduceFlicker's scope is slightly too narrow to combat the issue. But the methods are there by now, so hope is rising again ;)
@ shaolin95
camera! What's wrong with making screenshots in VirtualDub?
However, in LimitedSharpen there is no warpsharping done whatsoever - I feel rather confident that you just need additional filtering for stabilisation of the source itself.
@ Clouded
How, doesn't load? It does fine here - DL'ed it myself and played back without problems. Perhaps it's the setup on your machine, regarding MKV?
mg262
10th September 2005, 17:52
Sorry... I get this:
FEHLER 404
Die gewünschte Internet-Seite ist nicht erreichbar. Überprüfen Sie bitte die Adresse oder versuchen Sie es später noch einmal.
But like I said, don't worry about it!
@shaolin95,
Like Didée said, in this case you should look in the video menu of VirtualDub. But in general, if you press print screen the contents of the screen are dumped into the clipboard (with a couple of caveats).
shaolin95
10th September 2005, 18:59
@ shaolin95
camera! What's wrong with making screenshots in VirtualDub?
However, in LimitedSharpen there is no warpsharping done whatsoever - I feel rather confident that you just need additional filtering for stabilisation of the source itself.
Ok gonna try that tonight. What do you recommend for aditional source stabilisation. I makes sense what you say cause otherwise it will be equally visible with all DVDs right? BTW, thanks for helping a noob here.
Regards
Updated post: Just wanted to add that I am using Theater Tek with ffdshow to improve DVD quality to use with my Infocus 4805 DLP projector. My screensize is 9' wide (124" diag) so improving dvd image is a must.
Chainmax
15th September 2005, 00:37
Does this script include a good Soothe call with the default keep value:
LRemoveDust_YV12(17,2)
Deblock(quant=30)
dull = last
sharp = LimitedSharpen()
Soothe(sharp,dull)
AddGrain(3,0,0)
?
E-Male
15th September 2005, 01:16
i wonder if this could also be used with other combinations than dull&sharp
for example denoised&original
i'll look into that when i find the time
Didée
21st November 2005, 17:47
Oh my dear. The function originally posted had an error in the LUT, that caused some weird blurring in certain spots. (Didn't check for a special condition.)
Function in the first post is updated - *now* Soothe is working correctly, as it was supposed to be.
However it seems like no-one is using this little brownie ... else, someone would have noted the defect and have reported it, no? ;)
yidaki
21st November 2005, 18:57
hmm, I use it :-/
Perhaps I enjoy the blurring :D
Pookie
24th November 2005, 08:47
I thought it was my source and choice of codec.
iceborne
1st February 2006, 05:00
i keep on getting washed out color whenever i applied this script:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\removegrainsse2.dll")
LoadPlugin("C:\Program Files\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")
mpeg2source("e:\dvd\divergence.d2v")
Telecide(guide=1).Decimate()
crop(4,60,-4,-60)
trim(5000,10000)
dull = last
sharp = dull.LimitedSharpenfaster( smode=4, dest_x=720, dest_y=368 )
Soothe( sharp, dull, 20 )
undot()
but if i leave out the resizing parameter
"dest_x=720, dest_y=368 ",
everything's good.
can anyone tell me what's wrong with my script?
foxyshadis
1st February 2006, 05:32
Heh, I thought it was LSFaster for a few, until I noticed that you never resized dull. Pick a good scene with very sharply defined colors, and you'll notice the chroma will bleed horribly, since it gets copied from the second argument, not the first. Lesson: Always remember to resize both clips. ;)
iceborne
1st February 2006, 05:48
good man!
here's my new script
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\removegrainsse2.dll")
LoadPlugin("C:\Program Files\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")
mpeg2source("e:\dvd\divergence.d2v")
Telecide(guide=1).Decimate()
crop(4,60,-4,-60)
LanczosResize(720,368)
dull = last
sharp = dull.LimitedSharpenfaster( smode=4, dest_x=720, dest_y=368 )
Soothe( sharp, dull, 24 )
undot()
trim(5000,10000)
btw, does it matter where i put undot()?
Mug Funky
1st February 2006, 06:41
try:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\removegrainsse2.dll")
LoadPlugin("C:\Program Files\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")
mpeg2source("e:\dvd\divergence.d2v")
Telecide(guide=1).Decimate()
crop(4,60,-4,-60)
dull = last.LanczosResize(720,368)
sharp = dull.LimitedSharpenfaster( smode=4, dest_x=720, dest_y=368 )
Soothe( sharp, dull, 24 )
undot()
trim(5000,10000)
iceborne
2nd February 2006, 04:39
thanhs guy. another question do you think sooth(sharp, dull, 24) is too low? or should i raise it to make the image sharper
foxyshadis
12th February 2006, 01:46
In case anyone is feeling the burn and needs for speed, masktools 2:
function Soothe(clip sharp, clip orig, int "keep")
{
Assert(sharp.width == orig.width && sharp.height == orig.height,
\ "Soothe: clip dimentions must match!")
keep = default(keep, 24)
keep = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP = string(keep)
diff = mt_makediff(orig,sharp)
diff2 = diff.temporalsoften(1,255,0,32,2)
diff3 = mt_lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP
\ + " * 128 + x 128 - abs y 128 - abs > x " + KP
\ + " * y 100 " + KP + " - * + 100 / x ? ?")
return( mt_makediff(orig,diff3,chroma="copy first") )
}
[edit: Added a check for dimentions, since that's the most common misuse. :p Also Didée TS suggestion.]
[edit2: Added both to wiki: http://www.avisynth.org/mediawiki/Soothe ]
Didée
12th February 2006, 02:33
Even faster:
>> diff2 = diff.temporalsoften(1,255,0,32,2)
'cause here, chroma isn't interesting anyways, and TS runs faster when not having to also process the UV planes ... ;)
iceborne
12th February 2006, 06:03
cool, will try on next encode.
diazlaz
12th April 2006, 14:11
Is it possible to get the soothe function to work, when a frame is being resized by LS? Example, currently have a video that is sized at 352,480, and using LimitedSharpenFaster(ss_x=1.2,ss_y=1.2,dest_x=704,dest_y=480,Smode=4,soft=24) to resize it to 704x480, when soothe runs, it errors with:
YV12LUTxy: Clip size must be the same.
function Soothe(clip sharp, clip orig, int "keep")
{
keep = default(keep, 24)
keep = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP = string(keep)
diff = yv12lutxy(orig,sharp,"x y - 128 +", U=1,V=1)
diff2 = diff.temporalsoften(1,255,255,32,2)
diff3 = yv12lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP
\ + " * 128 + x 128 - abs y 128 - abs > x " + KP
\ + " * y 100 " + KP + " - * + 100 / x ? ?", U=1,V=1)
return( yv12lutxy(orig,diff3,"x y 128 - -",U=2,V=2) )
}
Thanks,
Laz.
foxyshadis
12th April 2006, 15:12
See Mug Funky's last post, on this page. Also consider using the version I posted. ;)
Oline 61
15th April 2006, 23:37
The output of this script is awesome, but it is extraordinarily slow. Like running pixiedust on a 4096x1920 image. Huffyuv can encode it at ~1.5 fps. Can anyone recommend a way to speed it up?
MPEG2Source("VTS_06_1.d2v",cpu2="ooooxx")
Telecide(guide=1,post=1,back=1)
Decimate()
Crop(2,56,716,362)
LanczosResize(1280,544)
RemoveGrain(mode=1)
dull=fft3dfilter(sigma=1.5)
sharp=LimitedSharpen(dull,
\ ss_x=1.5, ss_y=1.5,
\ dest_x=1280, dest_y=544,
\ Smode=3, strength=115,
\ Lmode=3, edgemode=1)
Soothe(sharp,dull)
krieger2005
16th April 2006, 19:46
@Oline 61: Don't use fft3dfilter. If the speed-improvement is not enought don't use limitedsharpen... and so on ;)
Oline 61
16th April 2006, 20:59
Without fft3dfilter there is no denoising. The output looks horrible because half of what is being sharpened is film grain.
I have tried putting fft3dfilter before the resize, and I think it might just be fast enough that way.
height=1280
width=544
MPEG2Source("VTS_06_1.d2v",cpu2="ooooxx")
Telecide(guide=1,post=1,back=1)
Decimate()
Crop(2,56,716,362)
in=fft3dfilter(sigma=1.5)
dull=LanczosResize(in,height,width)
sharp=LimitedSharpen(in,
\ ss_x=1.5, ss_y=1.5,
\ dest_x=height, dest_y=width,
\ Smode=3, strength=115,
\ Lmode=1, edgemode=1)
Soothe(sharp,dull,32)
foxyshadis
17th April 2006, 02:53
Well, ft3d isn't the only denoiser; for similar results you might try a degrainmedian (or two). Or possibly mipsmooth, but that's harder to control.
Oline 61
17th April 2006, 04:58
DegrainMedian doesn't do all of the things I need. Removing grain is great, but it doesn't clean up the compression artifacts from the DVD like fft3dfilter does. I've got it up to about 2.6 fps for a turbo first pass. That is acceptable. Here is the script:
SetMemoryMax(768)
width=1280
height=544
MPEG2Source("VTS_06_1.d2v",cpu2="ooooxx")
Telecide(guide=1,post=1,back=1)
Decimate()
Crop(2,56,716,362)
in=fft3dfilter(sigma=1.5)
dull=BicubicResize(in,width,height)
sharp=LimitedSharpen(in,
\ ss_x=1.5, ss_y=1.5,
\ dest_x=width, dest_y=height,
\ Smode=3, strength=100,
\ Lmode=1, edgemode=1)
Soothe(sharp,dull)
EDIT: I'ma give LimitedSharpenFaster() a shot too.
audioslave
5th June 2006, 23:59
I'm getting an error when using Soothe(). VDub says:
Script error: There is no function named "yv12lutxy".
What am I missing?
My script
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LimitedSupport_09Jan06B.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\LRemoveDust.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\Soothe.avsi")
Mpeg2Source("D:\Hea\Video\DVD\Temp\Temp.d2v")
LRemoveDust_YV12(17,2)
Crop(6,78,710,420)
dull = last.LanczosResize(704,416)
sharp = dull.LimitedSharpenFaster(dest_x=704,dest_y=416)
Soothe(sharp,dull,20)
Addborders(0,80,0,80)
audioslave
6th June 2006, 00:12
I solved it. I didn't have MaskTools in my plugin directory...
HeadBangeR77
20th January 2007, 06:47
I'm just thinking while writing ;) If we resize, we can't write like e.g.:
dull = last
sharp = dull.LimitedSharpenFaster(dest_x=720,dest_y=304)
provided we haven't resized (to our destination resolution) before. That's the mistake iceborne made above in his first script. Then the comparison clip /background (dull) would have a different resolution than the sharpened clip, and the whole function didn't make sense. However, if we write ...
dull = last.LanczosResize(720,304)
than we don't have to specify the resolution arguments in LSF, do we?! I mean sharp = dull + LSF, and dull has already been resized just one line above. So we can write afterwards ...
sharp = dull.LimitedSharpenFaster() ?
How blind & stupid have I been! (bangs his head against the wall :o) If the above is right, then LSF has the destination resolution, instead of the source resolution, as an input. That changes the supersampling effect, though the function's arguments don't change, and thus the sharpening strength too. Could anyone confirm /deny the above? :confused:
If that's true, I've spent all my day just in vain, encoding samples I didn't actually want to encode. :mad: It would rather not matter, if I was downsizing a bit, like in the above examples, but I'm upsizing atm, and that changes a lot ...
Didée
20th January 2007, 07:31
# how to soothe LimitedSharpen when LS is set up to change resolution
dx = your_target_width
dy = your_target_height
base = last.LanczosResize( dx, dy )
shrp = last.LimitedSharpen( dest_x = dx, dest_y = dy )
shrp.Soothe(base)
foxyshadis
20th January 2007, 07:32
sharp = dull.LimitedSharpenFaster(dest_x=720,dest_y=304)
is just a convenience. If you're going to go about resizing everything, you might use
sharp = LimitedSharpenFaster(dest_x=720,dest_y=304)
using implicit Last, or explicitly define an original. Or feed it the resize, LSF doesn't care - it'll work on anything. The worst you'll do is introduce a tiny bit of ringing and slow it down a bit.
HeadBangeR77
20th January 2007, 15:04
# how to soothe LimitedSharpen when LS is set up to change resolution
dx = your_target_width
dy = your_target_height
base = last.LanczosResize( dx, dy )
shrp = last.LimitedSharpen( dest_x = dx, dest_y = dy )
shrp.Soothe(base)
Thank you! :)
That's exactly what I wanted to achieve, but I lacked some basic knowledge about syntax :o The problem was I was going through some "standard" chain of
denoising -> sharpening with LSF -> denoising /another PP
like, for instance:
fft3dgpu(...) -> LSF(... dest_x=target_width, dest_y=target_height ...) -> BlindDeHalo3(PPmode=-3)
Both the first denoiser and LSF worked then with the original DVD resolution (after cropping black bars only), and LSF took care of resizing, as I intented. Supersampling was actually stronger than default, because I was downsizing:
712x360 anamorph -> LSF (supersampling & final resizing) -> 720x304 square pixels
After that, foxyshadis pointed Soothe to me, so I decided to give it a try, and I messed up with resolutions, more or less intentionally ;)
dull = last.LanczosResize(720,304)
sharp = dull.LimitedSharpenFaster(... dest_x=720, dest_y=304 ...)
Soothe(sharp,dull,XX)
Hence LSF was working with resized material already (what I didn't intend), and the SS was a bit different (weaker, but at the actual default *1.5) than in my former samples /clips, and thus the sharpening strength was different too (stronger). In this way I've lost the appropriate comparison, 'cause I had wanted to compare different pre-procesing and post-procesing methods, not the LSF itself. Now, at least the above is clear to me. :) Thanks once again!
HeadBangeR77
20th January 2007, 15:18
sharp = dull.LimitedSharpenFaster(dest_x=720,dest_y=304)
is just a convenience.
As I thought - thanks for clarifying :)
If you're going to go about resizing everything, you might use
sharp = LimitedSharpenFaster(dest_x=720,dest_y=304)
using implicit Last, or explicitly define an original.
That was & is my goal, exactly.
Or feed it the resize, LSF doesn't care - it'll work on anything. The worst you'll do is introduce a tiny bit of ringing and slow it down a bit.
I've already gone through almost all the possibilities, but that wasn't my intend - I wanted the LSF to do exactly the same supersampling, sharpening, and resizing, because I was comparing different pre- and postprocesing methods (see above) ;) I'm upsizing atm, but I won't bother you, until the final script is ready & tested ;) You've been both very helpful, thanks a lot!
HeadBangeR77
22nd January 2007, 02:41
At last I've managed to figure things out, while using LSF and Soothe with different resolutions. Hope someone might find this useful, and if not, I don't think I will bother anyone with this post. ;)
1) Anomorphic encode
There's not much to say really, 'cause this is the easiest case. We always work with unchanged resolution, using the simpliest Soothe like in the opening post:
dull = last
sharp = dull.LimitedSharpenFaster(...)
Soothe(sharp,dull,XX)
Supersampling between 1.25 and the default 1.5 seems to do the best job for me.
2) Downsizing
IMHO we should try to work and process the untouched (with the exception of cropping) material as long as it is possible. In this way LSF can enhance some details, that could potentially disappear due to resizing, and might be preserved after beeing sharpened properly. Hence my questions a few posts above. LSF takes care of resizing then, e.g.:
base = last.LanczosResize(720,304)
sharp = last.LimitedSharpenFaster(... dest_x=720,dest_y=304 ...)
sharp.Soothe(base,XX)
SS between 1.25 and 1.5 works best for me, though while downsizing one could lower the SS-factor. LSF works with higher resolution, and downsizes at the end, so the real SS is actually bigger than defined (or left at default).
3) Upsizing
I've been upsizing recently, achieving some decent results. Using the 2nd method and letting LSF take care of final resizing was my first guess. I had to use SS 2.0 in such a case, 'cause the default x1.5 wouldn't suffice, e.g.:
base = last.LanczosResize(1024,432)
sharp = last.LimitedSharpenFaster(ss_x=2.0,ss_y=2.0,dest_x=1024,dest_y=432,strength=100)
sharp.Soothe(base,80)
I decided later to try the basic way (the one I didn't want to use once, 'cause I was comparing samples that had to be done the same way) and resize before sharpening:
dull = last.LanczosResize(1024,432)
sharp = dull.LimitedSharpenFaster(ss_x=1.5,ss_y=1.5,dest_x=1024,dest_y=432,strength=100)
Soothe(sharp,dull,80)
The resulting clip was not only a bit sharper, but also had more "stability" (less nervous sharpening, no jittering or whatever it's called in this barbarian language ;)), though I used exactly the same Soothe settings. Having encoded and compared many samples I would recommend the last method, if someone is upsizing. In terms of speed it's the same (higher resolution to work with, but lower supersampling needed), in terms of quality it's imho better, "unless my eyes are cheated by some spell". ;)
PS. Don't worry, I'm not gonna post guides like J.D. :D
Didée
22nd January 2007, 03:29
though while downsizing [...] the real SS is actually bigger than defined
... and vice versa for upsizing.
In all the time LimitedSharpen has been around, I've been waiting for a suggestion like "make the ss factors relative to the _output_ resolution instead of input res." to come up.
Well, I'm patient. :)
HeadBangeR77
22nd January 2007, 03:46
(...)
In all the time LimitedSharpen has been around, I've been waiting for a suggestion like "make the ss factors relative to the _output_ resolution instead of input res." to come up.
Well, I'm patient. :)
Having very limited knowledge as to AviSynth, I've lernt all of that on my own errors (+ some helpful suggestions from some folks around here, but I can't recall their names so late at night ;)).
In case you're still waiting for suggestions, let me be the first to say:
Please, could you make the ss factors relative to the output instead of input resolution? Because the way it is now it's causing noobs like me a hard time, while working with different resolutions. :)
Didée
22nd January 2007, 03:57
In case you're still waiting for suggestions, let me be the first to say:
Please, could you make the ss factors relative to the output instead of input resolution? Because the way it is now it's causing noobs like me a hard time, while working with different resolutions. :)
Hey hey - that's a small but brilliant idea! I really should've thought of that myself! :D
It'll be included in the next version - whenever that might be.
Soulhunter
22nd January 2007, 14:38
In all the time LimitedSharpen has been around, I've been waiting for a suggestion like "make the ss factors relative to the _output_ resolution instead of input res." to come up.
I always thought it would be like this... ss factor = ss of the filtering... which is done on the upsized image... isnt it? If not 2x ss + 200% upsize = no ss... >.>
Bye
HeadBangeR77
22nd January 2007, 15:03
I always thought it would be like this... ss factor = ss of the filtering... which is done on the upsized image... isnt it?
As I undestand the matter, and finally I think I do understand, you're quite right. You feed LS(F) with input clip of certain input resolution, it upsizes the input resolution * supersampling factor, shapens the upsized image, downsizes to the output resolution, when specified.
If input resolution = output resolution, then the SS factor always works as specified (e.g. 1.5x, 2x).
In case of different input and output resolutions, well, just see my posts above: while downsizing or upsizing the real SS factor changes, and so the strength of sharpening. When Soothe is used, it gets things even more complicated (at least for me, though it's the past already ;)).
@ Didée
You are truely a gentleman and a scholar - may Freyja (http://en.wikipedia.org/wiki/Freya) and Freyr (http://en.wikipedia.org/wiki/Freyr) bless you! :D ;)
Didée
22nd January 2007, 15:18
I always thought it would be like this... ss factor = ss of the filtering... which is done on the upsized image... isnt it? If not 2x ss + 200% upsize = no ss... >.>
If things always would be like they should be, then I'd be a rich man. ;) - Alas, the world isn't perfect.
Looking into the LS script, there is
xxs = round(ox*ss_x/8)*8
yys = round(oy*ss_y/8)*8
where ox,oy are the original input resolution, ss_x,ss_y the factors, and xxs,yys are the resolution of the supersampled image. Obviously, the base is the original resolution ...
In english: when you're working with ss factors of 1.5, but you tell LS to make the output resolution 2x that of the input, then LS actually is doing the sharpening on a smaller framesize than that of the output. :)
It has ever been like that.
Soulhunter
22nd January 2007, 20:49
Oh, never noticed this... ^^;
Then I gonna replace "ox*ss" n' "oy*ss" with "dest_x*ss" n' "dest_y*ss" or what it was!
Thx n' Bye
R3Z
24th January 2007, 08:10
Pictures
Basic (http://www.slibe.com/fullimage/7e1b9c01-Basic.png)
Seesaw using Soothe (http://www.slibe.com/fullimage/7b1c7714-Deluxe_Seesaw.png)
Are you comparing the original to seesaw ? or the seesaw to the limited sharpen+soothe ?
:o
Jeremy Duncan
24th January 2007, 23:59
Didée,
If you made a version of Soothe that uses MT_Masktools instead of Masktools.Would it be faster ? :)
Didée
25th January 2007, 00:39
With Soothe at 100, it's the same as not using Soothe.
This is using FFDshow.
http://img253.imageshack.us/img253/7917/sootheresults3tn.png (http://imageshack.us)
This is Avisynth -> Vdub -> Xvid(q2) of "Soothe(sharp,orig,X)".
Didée
25th January 2007, 00:41
If you made a version of Soothe that uses MT_Masktools instead of Masktools.Would it be faster ? :)
It's already out there, somewhere ... IIRC foxyshadis once did the major effort of replacing all "XXX()" with "mt_XXX()". Search.
Adub
25th January 2007, 03:04
The version is on page 3 of this thread.
Hear is the direct link if you are lazy.
http://forum.doom9.org/showthread.php?p=784366&highlight=Soothe+Masktools+2.0#post784366
foxyshadis
25th January 2007, 03:50
I think he's wondering if Didée's magic touch will make it faster than the bad results he got with the existing version.
HeadBangeR77
25th January 2007, 04:10
@ Jeremy D.
Maybe I've written too much about LimitedSharpen(Faster) in this thread, but that was connected with Soothe, and because of Soothe I had come across all the above resizing & supersampling differences. Could you stop posting your various settings, which tend to change few times a day, in every thread connected with Didee's functions? You've got your own thread(s) already, and you're making many others non-transparent in this way, not to mention it's slowly getting irritating ... Savvy?
Boulder
25th January 2007, 10:19
Didée, and Foxyshadis, might want to see what people have done with their work.
I know what it's like to see a new post in my thread, so I like to add nice stuff, what I think is nice, to other peoples threads.I think Didée has asked you quite a few times to stop messing around with his functions. OK, it's nice to let people know what you've achieved with them but IMHO you are creating confusion among those who might not understand what's going on. Besides, you don't seem to understand that the optimal settings depend entirely on the source - and that's probably one reason why you post a new version every day or so.
Note that I don't mean to hurt your (or anybody else's) feelings, I'm just getting a bit tired of cluttered threads.
Jeremy Duncan
25th January 2007, 16:19
I think Didée has asked you quite a few times to stop messing around with his functions.
I can only remember the time I chopped up his Spresso code.
After I deleted the changed code he was not angry anymore.
:search: :thanks:
Boulder
25th January 2007, 17:03
I can only remember the time I chopped up his Spresso code.
After I deleted the changed code he was not angry anymore.
:search: :thanks:http://forum.doom9.org/showthread.php?p=934080#post934080
What I mean is that people are encouraged to do quite the incorrect things with the functions. I know Didée doesn't like that much, and considering the fact that he's done a lot for the Avisynth community, I'd really listen to his advice:)
EDIT: I hope that "casting pearls before the swine" isn't directed at me :p
Jeremy Duncan
25th January 2007, 21:48
Merlin7777,
No, I googled it and found it myself.
foxyshadis,
The version you made is nice.
HeadBangeR77,
You must understand.
Didée, and Foxyshadis, might want to see what people have done with their work.
I know what it's like to see a new post in my thread, so I like to add nice stuff, what I think is nice, to other peoples threads.
I'm sorry I'm aggravating you.
Here's what I've done with Seesaw, LSF, and Soothe.
I made one with Soothe and LSF, just so you know in case you wanted to see that.
Just download the folder, look at the FFDshow configurations and compare the pictures;
Pictures showing the Detail quality of the different configurations. Updated January 25, 2007 (http://rapidshare.com/files/13370518/Detail_Tests.zip.html)
The rules say there is no best, Boulder.
What you linked to in no way makes my work with Didée's stuff ant less important than the fine stuff anybody else has done with it.
Because there is no best according to the rules.
Didée is happy that I'm happy with the results.
That's all that's important.
In case your wondering why I keep deleting my posts. I'm scared I'm going to get the lash if I have more than one post in this thread.
HeadBangeR77
26th January 2007, 01:32
In case your wondering why I keep deleting my posts. I'm scared I'm going to get the lash if I have more than one post in this thread.
Fine for me, 'cause I've read through this thread several times, but from an objective point of view you're making it even less transparent now. If I was to search for some important info for the first time, I would get a headache, seriously :D
Could someone soothe (;)) this thread, so it does make sense again?
foxyshadis
26th January 2007, 17:49
No, mods don't sweep up threads, except to clean up flamewars or occasionally to update a badly out-of-date first post. The best route is to create an entirely new thread with as much pertinant information in the post as possible. I'm beginning to warm to the idea of a FAQs forum, at least as long as the wiki is down/readonly. (Although the soothe entry is live.)
HeadBangeR77
27th January 2007, 14:54
With Soothe at 100, it's the same as not using Soothe.
This is using FFDshow.
http://img253.imageshack.us/img253/7917/sootheresults3tn.png (http://imageshack.us)
This is Avisynth -> Vdub -> Xvid(q2) of "Soothe(sharp,orig,X)".
If I'm becoming a real pain in the ass, then just tell me straight. :D
Although I must admit that using Soothe(s,d,100) isn't the same as not using Soothe at all (yes, I've made some samples), one thing here troubles my mind: Since
"keep" is an integer, range 0 - 100, that tells how much percent of the original sharpening will be kept at least,
then
orig.avi < soothe(-100) < soothe(100) < sharp.avi
is correct. Soothe always soothes, even if we tell her to stop. ;) On the other hand, even with negative values, the function will never fully undo the sharpening effect. Why then soothe(15) > soothe(100) ??? This is too much for my exhauste humanistic brain. :confused:
Didée
29th January 2007, 13:13
Oh, oh-oh ... that's because I used the Soothe function of SeeSaw, which has the parameters inversed (in SeeSaw the meaning is not "keep", but rather "strength") ... Standalone Soothe doesn't even use "negative" values.
In this respect, it's all a big mess with Soothe. Agreed. :D
Worse is, that I shouted at Jeremy without a reason: When using the Standalone function of Soothe, then Soothe(100) in fact IS THE SAME as not using Soothe ... Jeremy was right, and I stumbled in my own trap. :devil:
HeadBangeR77
29th January 2007, 14:32
Thanks for clearing, now I get it. ;) A true genious is always a bit absent-minded, isn't he? :D
OT: Is Soothe (function) he/ she/ or it in english? The problem with this simplified-long-forgotten-anglo-saxon-bad-pronounced-latin-distorted-french-language is, that almost noone teaches grammatical genders, so I don't have the flexibility I've got in german or in polish. :p
McCauley
27th March 2007, 01:53
Hi,
at first i have to thank you for your great filters Didée!
I played with Soothe and asked myself how it would be possible to use use soothe in combination with the inbuild resizer of LSF.
I after hours of thinking how it could work, i came up with this idea:
MPEG2Source("whatever.d2v")tfm()tdecimate().removegrain().crop(whatever)
dull = last
sharp = dull.LimitedSharpenfaster(ss_x=1.0,ss_y=1.0,Smode=3,strength=XXX)
Soothe( sharp, dull, 30 )
Lanczos4Resize(1280,720)
After that thought why not reading the entire Soothe-Thread and found your suggestion for resizing:
# how to soothe LimitedSharpen when LS is set up to change resolution
dx = your_target_width
dy = your_target_height
base = last.LanczosResize( dx, dy )
shrp = last.LimitedSharpen( dest_x = dx, dest_y = dy )
shrp.Soothe(base)
My question is now, if my script delivers (theoretically) better quality, because im soothing at the full resolution (source is 1920x1080) and lanczos resize it at the end to the destined resolution (which is the same, because i just externalized the last resizing step of LS(F), or not?), or is it just a waste of cpu cycles?
Regards
McCauley
EDIT:After some addititonal toying with it, i realized that i make sharpening a bit useless with the first one and found these settings satisfiing:
MPEG2Source("whatever.d2v")tfm()tdecimate().removegrain().removegrain().crop(whatever)
dull = last.Lanczos4resize(1280,720)
sharp = dull.LimitedSharpenfaster(ss_x=1.0,ss_y=1.0,Smode=3,strength=XXX,dest_x=1280, dest_y=720)
Soothe( sharp, dull, 30 )
My thoughts to that are that using supersampling with 1.5 at a full HD makes the sharpening obsolete, if you resize it down to 1280x720.
251121
14th July 2007, 03:46
can some give me direct link to download what exactly needs to have in avisynth plugins folder in order to work with this filter. many thanks.......
TheRyuu
14th July 2007, 05:51
can some give me direct link to download what exactly needs to have in avisynth plugins folder in order to work with this filter. many thanks.......
Sure.
function Soothe(clip sharp, clip orig, int "keep")
{
Assert(sharp.width == orig.width && sharp.height == orig.height,
\ "Soothe: clip dimentions must match!")
keep = default(keep, 24)
keep = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP = string(keep)
diff = mt_makediff(orig,sharp)
diff2 = diff.temporalsoften(1,255,0,32,2)
diff3 = mt_lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP
\ + " * 128 + x 128 - abs y 128 - abs > x " + KP
\ + " * y 100 " + KP + " - * + 100 / x ? ?")
return( mt_makediff(orig,diff3,chroma="copy first") )
}
Copy and paste into text file, save as Soothe.avsi, put that in plugins folder.
Get mt_masktools v2 here. (http://manao4.free.fr/) (latest one is this one. (http://manao4.free.fr/masktools-v2.0a30.zip)) Throw that in plugins folder too.
Not sure if this one needs removegrain. :p (don't think so, anyone?)
Boulder
14th July 2007, 08:46
Yes, MaskTools v2 should be the only external dll that is needed.
251121
14th July 2007, 17:09
Sure.
function Soothe(clip sharp, clip orig, int "keep")
{
Assert(sharp.width == orig.width && sharp.height == orig.height,
\ "Soothe: clip dimentions must match!")
keep = default(keep, 24)
keep = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP = string(keep)
diff = mt_makediff(orig,sharp)
diff2 = diff.temporalsoften(1,255,0,32,2)
diff3 = mt_lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP
\ + " * 128 + x 128 - abs y 128 - abs > x " + KP
\ + " * y 100 " + KP + " - * + 100 / x ? ?")
return( mt_makediff(orig,diff3,chroma="copy first") )
}
Copy and paste into text file, save as Soothe.avsi, put that in plugins folder.
Get mt_masktools v2 here. (http://manao4.free.fr/) (latest one is this one. (http://manao4.free.fr/masktools-v2.0a30.zip)) Throw that in plugins folder too.
Not sure if this one needs removegrain. :p (don't think so, anyone?)
first of all thanks, can u tell what version? i need to download because there are so many v2 versions :confused: Thanks...
Thanks to Boulder as well.
Boulder
14th July 2007, 18:06
Just download the latest MaskTools v2 version and you're fine.
Prim3
15th July 2007, 02:19
Very nice function Didée. I've got an extraordinary output using it. Great job.
Vesi
23rd October 2007, 12:04
Any help, how i have to use soothe and LSF with this script?
i'm using megui to make my script.
@ should i call soothe avs or avsi in my plugin dir?
DGDecode_mpeg2source("C:\Documents and Settings\Vesi\Desktop\HDDCS-Test\Test.d2v",info=3)
ColorMatrix(hints=true,interlaced=true)
#Not doing anything because the source is progressive
crop( 2, 92, -2, -72)
BicubicResize(640,272,0,0.5) # Bicubic (Neutral)
salehin
23rd October 2007, 14:50
Any help, how i have to use soothe and LSF with this script?
i'm using megui to make my script.
@ should i call soothe avs or avsi in my plugin dir?
DGDecode_mpeg2source("C:\Documents and Settings\Vesi\Desktop\HDDCS-Test\Test.d2v",info=3)
ColorMatrix(hints=true,interlaced=true)
#Not doing anything because the source is progressive
crop( 2, 92, -2, -72)
BicubicResize(640,272,0,0.5) # Bicubic (Neutral)
Just rename the soothe.avs to soothe.avsi and drop it in your avisynth plungins directory. That would allow your avs script to access and work soothe.
Also check here (http://forum.doom9.org/showpost.php?p=1056555&postcount=3) whether you actually require colorcorrection or not (i doubt it is required)
Vesi
23rd October 2007, 22:28
Thanks alot salehin, i have few questions.
1.how do i know that my source is rec 709, and i don't need colorcorection?
2.o Resolution: Always use mod16 resolution for your output?
please make it a bit clear, coz i'm new:)
o Always start off with using the least powerful sharpening filters. The idea is bring out background details slightly clear without introducing artificial sharpening. LSF (the customised one), Soothe comes my mind - see intro and an example of settings
the links you provided for some details here is not working.
foxyshadis
23rd October 2007, 22:56
DGIndex and the d2v has that information. If it doesn't, colormatrix won't do anything with hints=true, don't worry. (Never use it if you're making a DVD from a DVD, though, unless you change the colormatrix in your encoder's advanced settings.) Mod16 isn't required, but it's preferred unless you have to really go out of your way to get it.
salehin
23rd October 2007, 23:56
Thanks alot salehin, i have few questions.
1.how do i know that my source is rec 709, and i don't need colorcorection?
2.o Resolution: Always use mod16 resolution for your output?
please make it a bit clear, coz i'm new:)
the links you provided for some details here is not working.
o Colorimetry:
Load the source file onto DGIndex (version 1.4.9+) and do a preview. You'll find the colorimetry (http://forum.doom9.org/showpost.php?p=1056555&postcount=3) info there. Always use AvsP (http://forum.doom9.org/showthread.php?t=129385) for previews to be more certain (with and without CM). It gives a very good preview- impacts of using various filters.
o Detailed reason behind mod16 (quoting check):
Encoders work in blocks of 16x16. They can subdivide into smaller blocks below this (16x8, 8x8 and 4x4), but the encoder requires 16x16 blocks. If the size is not mod16, the encoder will simply duplicate the edge pixels, encode those instead and the decoder will not display them on playback.
Instead of encoding non-mod16, resize to mod16 and set the correct AR in the matroska file. Then you have the correct AR and a more compressible movie
o LSF and Soothe:
I have updated the links (http://forum.doom9.org/showpost.php?p=1032304&postcount=623) (re: LSF and soothe eg)
o Resize filter:
May I also suggest you try Spline36neutral or Lanczos (Sharp). I tend to prefer spline36neutral as it gives as good results as lancsoz sharp, in some cases, slightly better than Lanczos (Sharp)
Vesi
24th October 2007, 10:34
foxyshadis and salehin thank you guys for the replays.
- I did open my source with DGIndex and found it BT.470-2 B,G, so in this case i don't need colorcorection, am i right?
@ salehin please don't get angry on me :), i releay don't get this mod16, should i change this in megui before i start my rip?
please explain it in some simple words as i'm noob and bad english :o.
is this the right way to make script soothe with LSF?
dull = last
sharp = dull.LimitedSharpenfaster( ss_x=1.25, ss_y=1.25,smode=4, strength=150, overshoot=1 )
Soothe( sharp, dull, 20 )
Tweak(sat=1.2,bright=-8,cont=1.3)
Or any other ways too?
salehin
24th October 2007, 12:23
Re mod16: As foxyshadis said, it's not mandatory. But if you do that, then it is generally better for compression.
ok,but if i want to do it,how?
For more details see here (http://mewiki.project357.com/index.php/Guides:HDTV_Transcoding_Guide#Cropping_.26_Resizing)
ps: If you need further help then search doom9 for related thread and read. Then post your queries over there (not here, as it is not related this thread)
Vesi
24th October 2007, 13:36
ok,thanks again for your helps
Edit Firstly, download this collection of x264 matrices,
link is broken.
Nikos
27th August 2008, 18:52
With MC'ed temporal limiting which is the right place for soothe()?
a. Before limiting:
s = last
den =s.myden
sharp = den.mysharpen
calm = soothe(sharp, den, 49)
calm.mt_clamp(pmax, pmin, 1, 1, U=2, V=2)
b. after limiting:
s = last
den =s.myden
sharp = den.mysharpen
limS = sharp.mt_clamp(pmax, pmin, 1, 1, U=2, V=2)
soothe(limS, den, 49)
c. before and after limiting:
s = last
den =s.myden
sharp = den.mysharpen
calm = soothe(sharp, den, 49)
limS = calm.mt_clamp(pmax, pmin, 1, 1, U=2, V=2)
soothe(limS, den, 49)
orion44
13th July 2023, 13:59
Oh, oh-oh ... that's because I used the Soothe function of SeeSaw, which has the parameters inversed (in SeeSaw the meaning is not "keep", but rather "strength") ... Standalone Soothe doesn't even use "negative" values.
In this respect, it's all a big mess with Soothe. Agreed. :D
Need some clarification.
Can we use the standalone Soothe function with SeeSaw, or does SeeSaw already has a Soothe function built in?
real.finder
13th July 2023, 16:26
Need some clarification.
Can we use the standalone Soothe function with SeeSaw, or does SeeSaw already has a Soothe function built in?
you can use soothe of seesaw (SootheSS) from https://github.com/realfinder/AVS-Stuff/blob/54de25b916b9c816af57cc506eb572fb1762ded7/avs%202.5%20and%20up/Zs_RF_Shared.avsi#L140 (it is sh_SootheSS now)
TwoToad
28th August 2023, 02:21
Just an update:
Using Soothe() today with Avisynth+ x64, and MaskTools2 x64, I've been getting an error saying yv12lutxy is an invalid function. I believe this can be fixed by editing the soothe.avsi script and replacing yv12lutxy with mt_lutxy instead. There are 3 instances that need to be replaced.
Example:
"diff = yv12lutxy(orig,sharp,"x y - 128 +", U=1,V=1)" changes to "diff = mt_lutxy(orig,sharp,"x y - 128 +", U=1,V=1)".
Seems to work for me, but I'm an Avisynth idiot, so maybe someone better than me can confirm?
kedautinh12
28th August 2023, 04:16
Or you can try other development ver of Soothe
https://github.com/realfinder/AVS-Stuff/blob/8f401a28aca1eb742e2ab17d62042780dc2f58e7/avs%202.5%20and%20up/Zs_RF_Shared.avsi#L142
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.