Not really too good if inside gScriptclip,
Reason, will scan and install FillBorders2_TestBord() function as GScript function at every iteration of gScriptclip, ie slow + memory consuming.
Above written for using GScript(""" FillBorders2_TestBord()""") inside scriptCip, also applies to GScript(""" for( ... etc """) and Eval().
FillBorders2_TestBord() is better outside of function at main level, or maybe after FillBorders2_dBugS() in FillBorders2().
Quote:
However, there was an error in AviSynth 2.6.
|
Would you like to clarify, was no promblem here for v2.60 std.
I'm still working on this a bit.
And dont worry bout this, its OK.
Code:
Function FillBorders2_TestBord(clip c,int edge, Float thr, int MaxB, Int Pad) {
# edge: 0=lft, 1=rgt, 2=top, 3=bot
result=0 w=c.width h=c.height
for(i = 1, MaxB) {
crpd=c.Crop((edge==1)?w-i:0,(edge==3)?h-i:0,(edge==0)?i:0,(edge==2)?i:0)
if(crpd.AverageLuma < thr) { result=i+pad }
else { i=MaxB }
}
return result
}
Where clip = 640x480, and crop width = 8. [ w=640, h=480, crop width below is i ]
Code:
# edge: 0=lft, 1=rgt, 2=top, 3=bot
#crpd=c.Crop( (edge==1)?w-i:0 , (edge==3)?h-i:0 , (edge==0)?i:0 , (edge==2)?i:0)
#crpd=c.Crop( ( RGT)?640-8:0 , ( BOT)?480-8:0 , ( LFT)?8:0 , ( TOP)?8:0)
LFT = crop( 0, 0, 8, 0) # Width = 8
RGT = crop( 640-8, 0, 0, 0) # Width = 0, means from left coord(640-8) all the way to right edge
TOP = crop( 0, 0, 0, 8) # Height = 8
BOT = crop( 0, 480-8, 0, 0) # Height = 0, means from top coord(480-8) all the way to bot edge
crop(0,0,0,0) is Full Frame.
EDIT:
For for() loop, dont need specify increment if its 1 (default = 1),
ie
Code:
for(i = 1, MaxB, 1)
for(i = 1, MaxB)