As D2S add a "ConvertToYUY2" in front of every script using an avi as source, it's very painful to adapt the last MA script (that claim YV12).
But if you want to use it, all you have to do is to modify all the settings of D2S according the official specification of KVCD(Notch Matrix and GOP setting to 1-24-2-1-24, see home page of the site), set the MIN and MAX bitrate according the template you want (64-900 for ULBR, 150-1300 for LBR, 300-2300 for normal KVCDx3), and add these lines to the end of DVD2SVCD.ini :
Code:
[AVISYNTH_Adaptative Filter]
0=ConvertToYV12()
1=nf=0
2=GripCrop(^TargetWidth, ^TargetHeight+^BorderTop+^BorderBottom, overscan=^overscan, source_anamorphic=^source_ana, dest_anamorphic=^dest_ana)
3=GripSize(resizer="BiCubicResize")
4=Undot()
5=Asharp(1, 4)
6=STMedianFilter(^S_FilterThreshHold, ^S_EdgeThreshHold, 0, 0 )
7=MergeChroma(blur(^blur_chroma))
8=MergeLuma(blur(^blur_luma))
9=SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
10=ScriptClip("nf = round(YDifferenceToNext())"+chr(13)+ "nf >= SwitchThreshold ? unfilter(-(fmin(nf*2,100)),-(fmin(nf*2,100))) : TemporalCleaner(6+nf,11+nf) ")
11=GripBorders()
12=function fmin(int f1, int f2) { return (f1<f2) ? f1 : f2 }
^overscan=1
^source_ana=false
^dest_ana=false
^S_FilterThreshHold=8
^S_EdgeThreshHold=32
^blur_chroma=1.58
^blur_luma=0.1
(note: this is not the official MA script, I slightly changed it)
This will add a new entry under "Frameserver" tab that is called : Adaptative Filter).
You need to have avs2.52 in order to use this.
Note: this script won't allow to use KVCDx3 resolution (D2S doesn't give choice other than VCD,SVCD,CVD and DVD) but you can use them by doing :
Code:
2=GripCrop(^Width, ^Height, overscan=^overscan, source_anamorphic=^source_ana, dest_anamorphic=^dest_ana)
and adding this 2 lines at the end of the file :
Code:
^Width=544 <- or 528
^Height=480 <- or 576 for PAL