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. |
25th June 2015, 16:37 | #1 | Link | ||
Dopax
Join Date: Dec 2009
Posts: 17
|
Help for improve my script
Greetings to all:
Recently, making some inquiries about using MP_pipeline on a Avisynth script, I received valuable advice regarding optimizing the code of the script (Thanks, colours). Clearly, for maximum quality and efficiency with respect to what I wanted to achieve with this script , I've much to learn. Therefore, since that thread wasn't the right to further discuss that , I decided to seek help from experts in this excellent forum for further optimizing it. Not surprisingly, it's all of them, and the many hours reading these forums, where I started building my "primitive" script. Never my intention wasn't to make a universal script; I know that each source has its peculiarities and filtering needs ; my intention is starting from a base with which to emphasize, define , "improve" visually (hopefully well be expressing the idea) HD high quality sources (mainly 1080, but also 720) before encoding (also with high scale quality) on x264, avoiding artifacts as far as possible. Something that would allow me, it could say , as a base template, range from uncompressed HD sources with low noise and smooth grain to those with less quality and more noise and / or grain. I leave the script I posted in the beginning and then, changes, recommended by colours at first instance. Thank you all in advance " primitive script " Quote:
Quote:
|
||
26th June 2015, 07:31 | #2 | Link |
Registered User
Join Date: Mar 2014
Posts: 308
|
My goal was to optimise for readability, not speed. (Mostly; mt_lut is a lot faster than Levels so I switched that in, even though RPN is kind of unreadable.)
Complicated scripts are often unnecessary, and even if they're necessary, you can often abstract huge chunks of the script into functions that can be reused for other scripts, rather than copy/pasting the same few lines every time. What you're doing seems like the opposite: you copied some lines out of a dehaloing and sharpening filter directly into your script, rather than calling it as a function. In the process, you also got the implicit last mixed up so the dehaloing part does nothing at all. Don't do this. If you need to modify a script filter's behaviour, don't copy its source into your script and edit that; edit the script filter directly. And of course, keep a backup of the original in case things break so you can easily roll back.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource! |
26th June 2015, 11:02 | #3 | Link |
Dopax
Join Date: Dec 2009
Posts: 17
|
Thanks colours .........obviously still have much to learn about this subject and, thanks to tips like these eventually go getting that knowledge. Again, thank you.
Regarding your script and, according to my claims and the kind of sources that I want to encode, agree on putting quality before speed and I would appreciate a lot, if not too much to ask, to accept and learn better in these last tips you have given me, you finished optimizing it, or polish (if they really need ..... if not express myself well) to take it as a good example of learning. Regards |
28th June 2015, 20:58 | #4 | Link |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Taking colours' version, what I would do with this script is below.
It may sound a bit too harsh but I think you'll be best starting from scratch taking all colours' advices into account and using only filters that you understand and if video you are dealing with really can benefit from it. I hardly doubt that any video can benefit from your script if used as-is. Code:
DGSource("E:\CARPETA CODIFICACION\*******.dgi") SelectRangeEvery(10000,500) sss = 1.5 newWidth = round(sss*width(last)/8)*8 newHeight = round(sss*height(last)/8)*8 LanczosResize(newWidth,newHeight) # Get rid of this. If some sharpening function benefits from this, it should be already doing it internally source = last s = 60 w = 24 mt_makediff(source.RemoveGrain(11),source) mt_lut("x 128 - "+string(128.0/(128.0-s))+" * 128 + "+string(128-w)+" max "+string(128+w)+" min") mt_makediff(source,last,u=2,v=2) # This is horrible. It might be useful as a part of some complex script but that's all. LimitedSharpenFasterHC(strength=80)# This is some old function meant for realtime playback. Get rid of it UnsharpHQ(THRESHOLD=80,SHARPSTR=2.6,SMOOTH=0.0, SHOW=false)# If you use this, don't use other sharpening aWarpSharp2(thresh=100, blur=2, type=0, depth=16, chroma=4)# Never use this for sharpening something directly. Only as a building block for complex functions # do you really need four sharpening filters in a row? # You absolutely don't want to use more than one sharpening function. # Whatever stick to UnsharpHQ if you think its good, or get proper limitedsharpen(faster)(mod) last.MergeChroma(source) # This shouldn't be required assuming you remove everything above FastLineDarkenMod() # moved this before denoising/debanding, but is this even necessary? # this is mainly used for anime. Looking at what you did above, I really hope # your source is not anime, but rather some horrible old blurred live-action DVDrip from some Indian DVD. # Even if your source IS anime, you should reconsider using line darkening Spline36Resize(1920,1080) # possibly not required assuming changes to the above will be made # don't do the denoising/debanding with supersampling because # that doesn't help with quality and makes things slower SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb_in=false,lsb_out=true,chroma=false,plane=0) # this might need some tweaking dpending on the stuff above. Like contrasharp off. # Also I would use this before sharpening. If sharpening afterwards makes some artifacts/noise visible, # that's because you're overdoing it. GradFun3(lsb_in=true) Last edited by Keiyakusha; 28th June 2015 at 21:12. |
|
|