logo Sign In

Post #331650

Author
Oldschooljedi
Parent topic
GOUT image stabilization - Released
Link to post in topic
https://originaltrilogy.com/post/id/331650/action/topic#331650
Date created
26-Sep-2008, 5:49 PM

g-force,

I've done some testencodings and I'm getting some errors. Here are some screenshots:

Image Hosted by ImageShack.us

Here I did do some markings arround the area I mean:

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

 

Image Hosted by ImageShack.us

Here is also a short sample-clip:

http://rapidshare.com/files/148657334/1.m2v.html

Did I use a wrong avisynth-plugins again? I'm actually using the plugins I used the last months for the encodings.

 

Because I prefer selectable subtitles, I did change your script a littlebit:

#######################################################################################
############################ GOUT Filter By G-force V.3.05 ############################
#######################################################################################

########## setup stage
sw_frame_no = 689 # <-----Enter number of first frame of "Star Wars" logo
PAL = true       # <-----Set to false for NTSC, true for PAL
Mpeg2Source("C:\Users\d\Videos\demuxed\ANH.d2v") # <-----Set path

########## cut off some of the black bars for faster processing (but keep mod 16)
PAL==false ? Crop(0,96,0,-96,align=true) : Crop(0,120,0,-120,align=true)

########## set black level/gamma, saturation/hue
Levels(10,1.13,255,0,255)
Tweak(sat=1.08,hue=-4)

########## global motion stabilization stage
temp = last.TemporalSoften(7,255,255,25,2)
Interleave(temp.Repair(last.TemporalSoften(1,255,255,25,2)),last)
DePan(last,data=DePanEstimate(last,trust=0,dxmax=1,dymax=0),offset=-1)
SelectEvery(2,0)

########## local motion stabilization/degrain stage
source  = last
sigma   = 3
filt    = source.fft3dfilter(sigma=sigma,sigma2=sigma*.75,sigma3=sigma*.5,sigma4=sigma*.25,sharpen=.3)
temp    = temp.Repair(filt,9)

fw_vec2 = temp.MVAnalyse(isb=false,delta=2,pel=2,sharp=1,overlap=4,plevel=0,idx=1)
fw_vec1 = temp.MVAnalyse(isb=false,delta=1,pel=2,sharp=1,overlap=4,plevel=0,idx=1)
bw_vec1 = temp.MVAnalyse(isb=true, delta=1,pel=2,sharp=1,overlap=4,plevel=0,idx=1)
bw_vec2 = temp.MVAnalyse(isb=true, delta=2,pel=2,sharp=1,overlap=4,plevel=0,idx=1)

fw2     = source.MVCompensate(fw_vec2,idx=2,thSAD=375)#previous previous moved forward
fw1     = source.MVCompensate(fw_vec1,idx=2,thSAD=475)#previous frame moved forward
bw1     = source.MVCompensate(bw_vec1,idx=2,thSAD=425)#next frame moved back
bw2     = source.MVCompensate(bw_vec2,idx=2,thSAD=325)#next next moved back

Median2(filt.Repair(source,9),fw2,fw1,bw1,bw2)

Median1(source,last,filt)

fw2_2   = last.MVCompensate(fw_vec2,idx=3,thSAD=360)
fw1_2   = last.MVCompensate(fw_vec1,idx=3,thSAD=460)
bw1_2   = last.MVCompensate(bw_vec1,idx=3,thSAD=410)
bw2_2   = last.MVCompensate(bw_vec2,idx=3,thSAD=310)

Average2(last,fw2_2,fw1_2,bw1_2,bw2_2)

########## temporal min/max sharpening
ContraMC(last,source,bw1,fw1,2)

########## restore stars stage
prest = last
prest.MT_Binarize(threshold=20,upper=true).MT_Expand()
MT_Merge(prest,source,last,chroma="copy first")
prest.Trim(0,sw_frame_no-1)++last.Trim(sw_frame_no,0)

########## anti-aliasing
NNEDI(dh=true,field=1)

########## resize to 16x9 AR, remove sides, add borders
PAL==false ? Spline16Resize(720,384).Crop(8,8,-4,-12,align=true).AddBorders(6,58,6,58)
  \        : Spline16Resize(720,448).Crop(4,6,-4,-8, align=true).AddBorders(4,70,4,72)


#######################################################################################
Function ContraMC(clip denoised, clip orig, clip bw1, clip fw1, int "overshoot")
{#

overshoot = default(overshoot,0)

pmax  = orig.MT_Logic(bw1,"max").MT_Logic(fw1,"max")
pmin  = orig.MT_Logic(bw1,"min").MT_Logic(fw1,"min")

Interleave(denoised,denoised.RemoveGrain(12,-1),denoised.RemoveGrain(4,-1))
Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)

MT_MakeDiff(last,last.RemoveGrain(12,-1))
MT_LUTxy(denoised,last,"y 128 - 1.5 * x +",chroma="copy first")
MT_Clamp(last,pmax,pmin,overshoot,overshoot,chroma="copy first")

Return(last)
}

#######################################################################################
Function Average2(clip input_1, clip input_2, clip input_3, clip input_4, clip input_5, string "chroma")
{# average of 5 clips from Helpers.avs by G-force.

chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"

Interleave(input_1,input_2,input_3,input_4,input_5)
TemporalSoften(2,255,255,255,2)
SelectEvery(5,2)

chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last

Return(last)
}

#######################################################################################
Function Median1(clip input_1, clip input_2, clip input_3, string "chroma")
{# median of 3 clips from Helpers.avs by G-force

chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"

Interleave(input_1,input_2,input_3)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)

chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last

Return(last)
}

#######################################################################################
Function Median2(clip input_1, clip input_2, clip input_3, clip input_4, clip input_5, string "chroma")
{# median of 5 clips from Helpers.avs by G-force

chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"

#MEDIAN(i1,i3,i5)
Interleave(input_1,input_3,input_5)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
m1 = selectevery(3,1)

#MAX(MIN(i1,i3,i5),i2)
m2  = input_1.MT_Logic(input_3,"min",chroma=chroma).MT_Logic(input_5,"min",chroma=chroma).MT_Logic(input_2,"max",chroma=chroma)

#MIN(MAX(i1,i3,i5),i4)
m3  = input_1.MT_Logic(input_3,"max",chroma=chroma).MT_Logic(input_5,"max",chroma=chroma).MT_Logic(input_4,"min",chroma=chroma)

Interleave(m1,m2,m3)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)

#Interleave(input_1,input_2,input_3,input_4,input_5)
#MedianBlurT(0,0,0,2)
#selectevery(5,2)

chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last

Return(last)
}

 

Maybe the error is caused by changing it this way? Any ideas? To me it seems, that the error is only at scene-changes, but I'm not sure, if it has something to do with it...