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
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 25th June 2015, 16:37   #1  |  Link
surgical
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:
Setmemorymax(1024)
SetMTMode(3,6)
LoadPlugin("C:\CODIFICACION VIDEO BD\MeGUI 2525\tools\dgindexnv\DGDecodeNV.dll")
DGSource("E:\CARPETA CODIFICACION\*******.dgi")
SelectRangeEvery(10000,500)

SetMTMode(2,0)
l_width = last.width
l_height = last.height
sss=1.5
dispWidth = round(sss*l_width/8)*8
dispHeight = round(sss*l_height/8)*8
mWidth = float(l_width)
mHeight = float(l_height)
ratio = (mWidth/mHeight)
newHeight= round((dispWidth/ratio)/8)*8
newHeight > dispHeight ? Eval("""
newHeight=dispHeight
newWidth=round((newHeight*ratio)/8)*8
""" ) : Eval("""
newWidth=dispWidth
""" )
LanczosResize(newWidth,newHeight)

Repair(Gaussresize(newWidth,newHeight,p=100),1)
source=last
s=60
w=12
w=w*(128/s)
subtract(source.binomialBlur(varY=0.4515, varC=0, Y=3, U=2, V=2, useMMX=true),source)
levels(0+s,1,255-s,0,255)
levels(127-w,1,128+w,127-w,128+w)
subtract(source,last)

LimitedSharpenFasterHC(strength=80)

UnsharpHQ(THRESHOLD=80,SHARPSTR=2.6,SMOOTH=0.0, SHOW=false)
aWarpSharp2(thresh=100, blur=2, type=0, depth=16, chroma=4)

source.mt_makediff(mt_makediff(source.binomialBlur(varY=0.0001, varC=0, Y=3, U=2, V=2, useMMX=true),last),U=2,V=2)

SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb=true,chroma=false,plane=0)
GradFun3()
FastLineDarkenMod()
LinearResize(1920,1080, kernel="spline36", mode=0)
changes recommended by colours ( with his comments )

Quote:
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)

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)

LimitedSharpenFasterHC(strength=80)

UnsharpHQ(THRESHOLD=80,SHARPSTR=2.6,SMOOTH=0.0, SHOW=false)
aWarpSharp2(thresh=100, blur=2, type=0, depth=16, chroma=4)
# do you really need four sharpening filters in a row?

last.MergeChroma(source)

FastLineDarkenMod() # moved this before denoising/debanding, but is this even necessary?

Spline36Resize(1920,1080)
# 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)
GradFun3(lsb_in=true)
surgical is offline   Reply With Quote
 


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 23:38.


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