Ich habe vor ein paar Tagen fuer Lugi hier ein Skript entworfen.
Da Interesse an dem Skript und den verwendeten Funktionen bekundet wurde, habe ich diesen Thread erstellt um Fragen beantworten zu koennen.
Die Erklaerungen zu den Funktionen sind zurzeit noch sehr duerftig und deutsch wird bis jetzt nur rainbow_smooth erklaert. Die englische Beschreibung ist direkt in den avs Datein zu finden. Aber das wird bei Zeiten alles vervollstaendigt, versprochen.
Das Skript:
LoadPlugin("D:\marko\vidwork\dgmpgdec\DGDecode.dll")
#LoadPlugin("D:\marko\vidwork\filters\mt_masktools.dll")
#LoadPlugin("D:\marko\vidwork\filters\tivtc.dll")
#LoadPlugin("D:\marko\vidwork\filters\tdeint.dll")
#LoadPlugin("D:\marko\vidwork\filters\leakkerneldeint.dll")
#LoadPlugin("D:\marko\vidwork\filters\de.dll")
#LoadPlugin("D:\marko\vidwork\filters\ChromaShift.dll")
#LoadPlugin("D:\marko\vidwork\filters\eedi2.dll")
LoadPlugin("D:\marko\vidwork\filters\removegrains.dll")
#LoadPlugin("D:\marko\vidwork\filters\RepairS.dll")
#LoadPlugin("D:\marko\vidwork\filters\awarpsharp.dll")
#LoadPlugin("D:\marko\vidwork\filters\frfun7.dll")
#LoadPlugin("D:\marko\vidwork\filters\Temporalcleaner.dll")
#LoadPlugin("D:\marko\vidwork\filters\deen.dll")
#LoadPlugin("D:\marko\vidwork\filters\SmoothUV.dll")
#LoadPlugin("D:\marko\vidwork\filters\TTempSmooth.dll")
#LoadPlugin("D:\marko\vidwork\filters\hqdn3d.dll")
#LoadPlugin("D:\marko\vidwork\filters\fft3dfilter.dll")
#LoadPlugin("D:\marko\vidwork\filters\degrainmedian.dll")
#LoadPlugin("D:\marko\vidwork\filters\gradfun2db.dll")
#LoadPlugin("D:\marko\vidwork\filters\Sangnom.dll")
#LoadPlugin("D:\marko\vidwork\filters\TUnsharp.dll")
#LoadPlugin("D:\marko\vidwork\filters\asharp.dll")
#LoadPlugin("D:\marko\vidwork\filters\warpsharp.dll")
#import("D:\marko\vidwork\functions\functions\all\Mrestore.avs")
#import("D:\marko\vidwork\functions\functions\all\rainbow_smooth.avs")
#import("D:\marko\vidwork\functions\functions\all\FastLineDarken.avs")
#import("D:\marko\vidwork\functions\functions\all\linedarken_toon.avs")
#import("D:\marko\vidwork\functions\functions\all\LimitedSharpenFaster.avs")
#import("D:\marko\vidwork\functions\functions\all\aaf.avs")
#import("D:\marko\vidwork\functions\functions\all\moderate_dering.avs")
## it´s absolutly recommed to load only the needed plugins and functions manually in your script ##
#setmemorymax(100)
###### source ######
MPEG2Source("D:\marko\vidwork\samples\dvd.d2v") #use the internal deblock if necessary
#AviSource("D:\marko\vidwork\samples\ntsc norm.avi")
#ConvertToYUY2(interlaced=true)
#ConvertToYV12()
### correct colours ###
#Tweak(Sat=1.1) #more saturation
#ColorYUV(gain_u=18) #to repair white areas (yellow back to white)
## if there is a chromashift in your source, repair it with the same named plugin here ##
#ChromaShift(C=4,L=4)
### dot crawl removal ###
#DeDot()
#crop(8,56,-8,-56) #crop to the next mod8 value for speed up, but don´t crop the complete black corner!!!
###### pattern work ######
ord = 1 #fieldorder [0,1] - change if motion of bobbed clip is not fluid
#leakkernelbob(ord,2,true,true) #fast smart bobbing with sharp output, but more flickering than tdeint
#tdeint(order=ord,mode=1,type=2) #type=3 is faster than type=2 or leakkernel + aaf, but if time
#is not important for you, try also the second possibility
#yadif(mode=1) #fast alternative for tdeint type 1 and 3
#Mrestore(ani=true) #for fieldblended sources, needs bobbed/progressive input
###### enhancement ######
### edge enhancment erasing \ dehaloing ###
#removegrain(24) #for light ee (good and very fast)
#moderate_dehalo(protrange=-1,ss=1.5) #works like dehalo_alpha -> for light and middle strong ee
#moderate_dehalo(hprot=10.5,lprot=3.8) #with default settings and smaller protection values for stronger processing
#for really strong ee you can use moderate_dehalo also for postprocessing
### rainbow removal ###
#rainbow_smooth(4) #my fast spatial rainbow removal function
#FFT3DFilter(Sigma=0,Sigma3=9,plane=3,wintype=1) #if rainbow_smooth is not enough, use this with a high sigma3
### hot pixel removal ###
#DeGrainMedian(limitY=6,limitUV=8,mode=3)
### denoising ###
#hqdn3d(ls=1.6,cs=2.0,lt=2.5,ct=2.5) #fastest - setted for light/normal noise
#Temporalcleaner(3,6).Deen("a2d",3,5,7) #fast - setted for normal noise
#TTempSmoothF(maxr=1) #extra temporal denoising, higher maxr -> slower, better quality
#FFT3DFilter(Sigma=3,plane=4,wintype=1) #for high quality denoising, slow, higher Sigma -> stronger denoising
#FFT3DFilter(Sigma=3,wintype=1) #works only on luma plane, slow, higher Sigma -> stronger denoising
## of course you can combine these denoisers for a better denoising ##
### sharpen & antialiasing ###
#aaf("repair",aas=-0.7) #my modded version of aaa, with small aam much faster
#FastLineDarken(strength=42,thinning=0) #what the name says - use the faster mt version (fastest)
#linedarken_toon(fast=true,warpdepth=0) #my extrem lite mf_toon mod :) -> for line darken
#use default settings if time is not the most important for you
#awarpsharp(depth=11,cm=1,blurlevel=1) #don´t set this, if you allready use it in linedarkentoon()
#Repair(last.sharpen(1),last,16) #ModerateSharpen -> really fast
#asharp(0.8,2,0.25,true) #fast adaptive sharpen -> use with awarpsharp, can be used also with repair (instead sharpen(1))
#LimitedSharpenFaster(smode=1,strength=64) #anybody who don´t love this function ??
#awarpsharp(depth=8,cm=1,blurlevel=1) #if you like the effect, activate this and don´t increase parameters of first call
## tunsharp is for example also a really useful sharpen filter, but a more special filtering is recommed, so I don´t give any settings ##
### banding removal ###
#gradfun2db(thr=1.6) #fast nice function to finalize the enhancment
###### layout ######
owidth = width(last) #output width / you should set the size
oheight = height(last) #output height / mod4, other parameters don´t
cropr = 0 #crop right / have this limit, but all should
cropt = 0 #crop top / be positive
cropl = 0 #crop left
cropb = 0 #crop botton
addr = 0 #add border right / these added borders
addt = 0 #add border top / don´t change the
addl = 0 #add border left / output width & height
addb = 0 #add border botton
## only calculation - don´t change! ##
ar = round( (width(last)-cropr-cropl)/float(owidth-addr-addl)*addr )
at = round( (height(last)-cropt-cropb)/float(oheight-addt-addb)*addt )
al = round( (width(last)-cropr-cropl)/float(owidth-addr-addl)*addl )
ab = round( (height(last)-cropt-cropb)/float(oheight-addt-addb)*addb )
ar>cropr || at>cropt || al>cropl || ab>cropb ? addborders(ar>cropr ? ar*4-cropr*4 : 0,at>cropt ? at*4-cropt*4 : 0,al>cropl ? al*4-cropl*4 : 0,ab>cropb ? ab*4-cropb*4 : 0) : last
letterbox(at>cropt ? at*4-cropt*3 : cropt, ab>cropb ? ab*4-cropb*3 : cropb, al>cropl ? al*4-cropl*3 : cropl, ar>cropr ? ar*4-cropr*3 : cropr)
## choose your favourit resizer ##
LanczosResize(owidth, oheight, ar>cropr ? ar*3-cropr*3 : cropr-ar, at>cropt ? at*3-cropt*3 : cropt-at, al>cropl ? cropl*3-al*3 : al-cropl, ab>cropb ? cropb*3-ab*3 : ab-cropb)
#BicubicResize(owidth, oheight, 1.0/3.0, 1.0/3.0, ar>cropr ? ar*3-cropr*3 : cropr-ar, at>cropt ? at*3-cropt*3 : cropt-at, al>cropl ? cropl*3-al*3 : al-cropl, ab>cropb ? cropb*3-ab*3 : ab-cropb)
Removegrain(1)
## if you don´t want to resize (only cropping for example) disable this code! ##
Alles anzeigen
Ausser dem Resizing Algorythmus, wird in dieser Form keine Funktion aufgerufen. Das soll den Benutzer dazu noetigen darueber nachzudenken, welche Filter er ueberhaupt benoetigt und welche Einstellungen bei seiner Quelle gerade die geeigneten sind.
kurz zu den Funktionen:
- rainbow_smooth :: kleine schnelle derainbow Funktion
- aaf :: modifizierte antialiasing Funktion, vergleichsweise schnell
- linedarken_toon :: stark vereinfachte und deutlich schnellere Modifikation von mf_toon
- FastLinaDarken :: einfach nur fuer Masktools v2 umgeschrieben (schneller)
- LimitedSharpenFaster :: nichts veraendert, so gut wie immer (eine Modifikation, die Didee selbst vorgeschlagen hat wird demnaechst noch vorgenommen)
- moderate_dehalo :: zum Entfernen von Edge Enhancment
ist eine Mischung aus moderate_ee, sharpen2 und dahalo_alpha, mit den richtigen Einstellungen arbeitet die Funktion praktisch genauso wie dehalo_alpha und aufgrund der Masktools v2 noch einen kleinen Tick schneller (Didee ist hoffentlich nicht boese, dass ich seine Funktion so verumstaltet habe)
Alle Anregungen und Verbesserungsvorschlaege sind natuerlich willkommen.