hydra3333
20th January 2014, 04:44
Hello. Following on from these :-
"The power of Avisynth: restoring old 8mm films" http://forum.doom9.org/showthread.php?t=144271
"Capturing and restoring old 8mm films" http://forum.doom9.org/showthread.php?t=165975
"The power of Avisynth: salvaging "botched" transfers of old 8mm films to DVD." http://forum.doom9.org/showthread.php?t=161493
... a few questions about motion stabilization and equivalent scripts:
a) At http://forum.doom9.org/showthread.php?p=1618761#post1618761 there are some "March 2013" functions to perform motion stabilization.
They use MSuper, MAnalyse, MDepan, DepanStabilize rather than DePanEstimate and DePanStabilize.
Is this the way to go ? eg
blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate.
overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size
dct=0 # use dct=1 for clip with light flicker
super0 = MSuper(pel=2,chroma=true,sharp=2)
vect0 = MAnalyse(super0,isb=false, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
globalmotion = MDepan(vect0, pixaspect=1.094, thSCD1=400, zoom=true, rot=true, range=2) #1.094 for standard PAL
DepanStabilize(data=globalmotion, rotmax=5, cutoff=0.5, prev=3, next=3, pixaspect=1.094, dxmax=20, dymax=20, method=1) # lower vibration frequency cutoff
b) My sources are about 150 old and very grainy VHS-C PAL home-video tapes captured to mpeg2 DVD (blockily) by a combo VHS-DVD recorder.
This sample clip (18Mb) is one of the less blocky ones by far:
http://www.mediafire.com/watch/s4wcrg557mw9ddy/GOLF-testclip.mpg
I'm uncomfortable with the result from the script below, too much detail is lost but I am unsure how to trade off noise vs detail for these sources. Any suggestions ?
http://www.mediafire.com/view/9d5uup2do5q1c49/golf-snapshot-01.png
MPEG2Source("G:\test\GOLF-testclip.d2v",info=0,ipp=true,cpu=0)
#
AssumeFPS(25)
AssumeTFF()
cropbottom(20).addborders(0,10,0,10) # because the bottom 20 lines are very badly corrupted across the board.
changefps(last,last,true) # http://forum.doom9.org/showthread.php?p=1473445#post1473445
ii=LAST
SetMTmode(mode=2,threads=4)
# 1. DEBLOCK really blocky source the hard way. see http://doom10.org/index.php?topic=2309.msg12233#msg12233
SeparateFields() # no need for pointresize, field block appear to be square
deblock_QED() # treat the blockiness introduced by the last step of the vhs-to-mpeg2dvd capture
#deblock_QED(quant1=48) # treat the blockiness introduced by the last step of the vhs-to-mpeg2dvd capture
Weave()
AssumeTFF()
# 2. smdegrain handles interlaced. # tr=3 means mdegrain3.
SMDegrain(tr=2, Contrasharp=true, RefineMotion=false, plane=4, Interlaced=true, pel=2, prefilter=3, blksize=8, overlap=4, Chroma=false)
# 3. QTGMC deinterlace into double framerate, sharpen whilst we're doing it
# Preset = "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast", "Draft". Default "Slower"
# SLMode = (0,1,2,3,4) Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth
# Sharpness = (0.0...) How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)
# NoiseDeint (string) When noise is taken from interlaced source, how to 'deinterlace' it before restoring. "Bob" & "DoubleWeave" are fast but with minor issues: "Bob" is coarse and "Doubleweave" lags by one frame. "Generate" is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects "DoubleWeave"
# StabilizeNoise (bool) Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for "Generate" mode
QTGMC(Preset="Slow", EdiThreads=2, Sharpness=1.4, SLMode=1, NoiseDeint="Generate", StabilizeNoise=true) # result is double framerate progressive, so re-interlate it later
#
# 4. --- do the motion stablization here - Does QTGMC keep motion vectors that I can re-use in "MDepan" ? if so, I wonder how ?
#blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate.
#overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size
#dct=0 # use dct=1 for clip with light flicker
#super0 = MSuper(pel=2,chroma=true,sharp=2)
#vect0 = MAnalyse(super0,isb=false, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
#globalmotion = MDepan(vect0, pixaspect=1.094, thSCD1=400, zoom=true, rot=true, range=2) #1.094 for standard PAL
#DepanStabilize(data=globalmotion, rotmax=5, cutoff=0.5, prev=3, next=3, pixaspect=1.094, dxmax=20, dymax=20, method=1) # lower vibration frequency cutoff
# 5. HDRAGC to adjust colours. i wonder if this is this similar to AUTOLEVELS,AUTOWHITE in FRED/JOHN scripts ?
SetMTmode(mode=5,threads=4)
HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
SetMTmode(mode=2,threads=4)
#
# To do RE-INTERLACING http://forum.doom9.org/showthread.php?p=1110741#post1110741
# AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -
# * AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -
# AssumeTFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -
# AssumeBFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -
# DE-INTERLACING and RE-INTERLACING http://forum.doom9.org/showthread.php?p=1374335#post1374335
AssumeTFF()
Blur(0,0.25).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace - ASSUMED TFF HERE # BLUR(0,1) per http://forum.doom9.org/showthread.php?p=1488308#post1488308
AssumeTFF()
AssumeFPS(25)
jj=LAST
#
compareboxed4(ii,"original",jj,"deblocked+degrained+QTGMC")
#
Function compareboxed2(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/2,0*hClip/2,-1*wClip/2,-1*hClip/2).subtitle(aSub,size=6), \
b.crop(1*wClip/2,0*hClip/2,-0*wClip/2,-1*hClip/2).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/2,1*hClip/2,-1*wClip/2,-0*hClip/2).subtitle(bSub,size=6), \
a.crop(1*wClip/2,1*hClip/2,-0*wClip/2,-0*hClip/2).subtitle(aSub,size=6)))
}
Function compareboxed4(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/4,0*hClip/4,-3*wClip/4,-3*hClip/4).subtitle(aSub,size=6), \
b.crop(1*wClip/4,0*hClip/4,-2*wClip/4,-3*hClip/4).subtitle(bSub,size=6), \
a.crop(2*wClip/4,0*hClip/4,-1*wClip/4,-3*hClip/4).subtitle(aSub,size=6), \
b.crop(3*wClip/4,0*hClip/4,-0*wClip/4,-3*hClip/4).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/4,1*hClip/4,-3*wClip/4,-2*hClip/4).subtitle(bSub,size=6), \
a.crop(1*wClip/4,1*hClip/4,-2*wClip/4,-2*hClip/4).subtitle(aSub,size=6), \
b.crop(2*wClip/4,1*hClip/4,-1*wClip/4,-2*hClip/4).subtitle(bSub,size=6), \
a.crop(3*wClip/4,1*hClip/4,-0*wClip/4,-2*hClip/4).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/4,2*hClip/4,-3*wClip/4,-1*hClip/4).subtitle(aSub,size=6), \
b.crop(1*wClip/4,2*hClip/4,-2*wClip/4,-1*hClip/4).subtitle(bSub,size=6), \
a.crop(2*wClip/4,2*hClip/4,-1*wClip/4,-1*hClip/4).subtitle(aSub,size=6), \
b.crop(3*wClip/4,2*hClip/4,-0*wClip/4,-1*hClip/4).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/4,3*hClip/4,-3*wClip/4,-0*hClip/4).subtitle(bSub,size=6), \
a.crop(1*wClip/4,3*hClip/4,-2*wClip/4,-0*hClip/4).subtitle(aSub,size=6), \
b.crop(2*wClip/4,3*hClip/4,-1*wClip/4,-0*hClip/4).subtitle(bSub,size=6), \
a.crop(3*wClip/4,3*hClip/4,-0*wClip/4,-0*hClip/4).subtitle(aSub,size=6)))
}
Function compareboxed8(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/8,0*hClip/8,-7*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,0*hClip/8,-6*wClip/8,-7*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,0*hClip/8,-5*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,0*hClip/8,-4*wClip/8,-7*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,0*hClip/8,-3*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,0*hClip/8,-2*wClip/8,-7*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,0*hClip/8,-1*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,0*hClip/8,-0*wClip/8,-7*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,1*hClip/8,-7*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,1*hClip/8,-6*wClip/8,-6*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,1*hClip/8,-5*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,1*hClip/8,-4*wClip/8,-6*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,1*hClip/8,-3*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,1*hClip/8,-2*wClip/8,-6*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,1*hClip/8,-1*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,1*hClip/8,-0*wClip/8,-6*hClip/8).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/8,2*hClip/8,-7*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,2*hClip/8,-6*wClip/8,-5*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,2*hClip/8,-5*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,2*hClip/8,-4*wClip/8,-5*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,2*hClip/8,-3*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,2*hClip/8,-2*wClip/8,-5*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,2*hClip/8,-1*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,2*hClip/8,-0*wClip/8,-5*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,3*hClip/8,-7*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,3*hClip/8,-6*wClip/8,-4*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,3*hClip/8,-5*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,3*hClip/8,-4*wClip/8,-4*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,3*hClip/8,-3*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,3*hClip/8,-2*wClip/8,-4*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,3*hClip/8,-1*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,3*hClip/8,-0*wClip/8,-4*hClip/8).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/8,4*hClip/8,-7*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,4*hClip/8,-6*wClip/8,-3*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,4*hClip/8,-5*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,4*hClip/8,-4*wClip/8,-3*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,4*hClip/8,-3*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,4*hClip/8,-2*wClip/8,-3*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,4*hClip/8,-1*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,4*hClip/8,-0*wClip/8,-3*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,5*hClip/8,-7*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,5*hClip/8,-6*wClip/8,-2*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,5*hClip/8,-5*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,5*hClip/8,-4*wClip/8,-2*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,5*hClip/8,-3*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,5*hClip/8,-2*wClip/8,-2*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,5*hClip/8,-1*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,5*hClip/8,-0*wClip/8,-2*hClip/8).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/8,6*hClip/8,-7*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,6*hClip/8,-6*wClip/8,-1*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,6*hClip/8,-5*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,6*hClip/8,-4*wClip/8,-1*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,6*hClip/8,-3*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,6*hClip/8,-2*wClip/8,-1*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,6*hClip/8,-1*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,6*hClip/8,-0*wClip/8,-1*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,7*hClip/8,-7*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,7*hClip/8,-6*wClip/8,-0*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,7*hClip/8,-5*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,7*hClip/8,-4*wClip/8,-0*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,7*hClip/8,-3*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,7*hClip/8,-2*wClip/8,-0*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,7*hClip/8,-1*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,7*hClip/8,-0*wClip/8,-0*hClip/8).subtitle(aSub,size=6)))
}
"The power of Avisynth: restoring old 8mm films" http://forum.doom9.org/showthread.php?t=144271
"Capturing and restoring old 8mm films" http://forum.doom9.org/showthread.php?t=165975
"The power of Avisynth: salvaging "botched" transfers of old 8mm films to DVD." http://forum.doom9.org/showthread.php?t=161493
... a few questions about motion stabilization and equivalent scripts:
a) At http://forum.doom9.org/showthread.php?p=1618761#post1618761 there are some "March 2013" functions to perform motion stabilization.
They use MSuper, MAnalyse, MDepan, DepanStabilize rather than DePanEstimate and DePanStabilize.
Is this the way to go ? eg
blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate.
overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size
dct=0 # use dct=1 for clip with light flicker
super0 = MSuper(pel=2,chroma=true,sharp=2)
vect0 = MAnalyse(super0,isb=false, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
globalmotion = MDepan(vect0, pixaspect=1.094, thSCD1=400, zoom=true, rot=true, range=2) #1.094 for standard PAL
DepanStabilize(data=globalmotion, rotmax=5, cutoff=0.5, prev=3, next=3, pixaspect=1.094, dxmax=20, dymax=20, method=1) # lower vibration frequency cutoff
b) My sources are about 150 old and very grainy VHS-C PAL home-video tapes captured to mpeg2 DVD (blockily) by a combo VHS-DVD recorder.
This sample clip (18Mb) is one of the less blocky ones by far:
http://www.mediafire.com/watch/s4wcrg557mw9ddy/GOLF-testclip.mpg
I'm uncomfortable with the result from the script below, too much detail is lost but I am unsure how to trade off noise vs detail for these sources. Any suggestions ?
http://www.mediafire.com/view/9d5uup2do5q1c49/golf-snapshot-01.png
MPEG2Source("G:\test\GOLF-testclip.d2v",info=0,ipp=true,cpu=0)
#
AssumeFPS(25)
AssumeTFF()
cropbottom(20).addborders(0,10,0,10) # because the bottom 20 lines are very badly corrupted across the board.
changefps(last,last,true) # http://forum.doom9.org/showthread.php?p=1473445#post1473445
ii=LAST
SetMTmode(mode=2,threads=4)
# 1. DEBLOCK really blocky source the hard way. see http://doom10.org/index.php?topic=2309.msg12233#msg12233
SeparateFields() # no need for pointresize, field block appear to be square
deblock_QED() # treat the blockiness introduced by the last step of the vhs-to-mpeg2dvd capture
#deblock_QED(quant1=48) # treat the blockiness introduced by the last step of the vhs-to-mpeg2dvd capture
Weave()
AssumeTFF()
# 2. smdegrain handles interlaced. # tr=3 means mdegrain3.
SMDegrain(tr=2, Contrasharp=true, RefineMotion=false, plane=4, Interlaced=true, pel=2, prefilter=3, blksize=8, overlap=4, Chroma=false)
# 3. QTGMC deinterlace into double framerate, sharpen whilst we're doing it
# Preset = "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast", "Draft". Default "Slower"
# SLMode = (0,1,2,3,4) Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth
# Sharpness = (0.0...) How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)
# NoiseDeint (string) When noise is taken from interlaced source, how to 'deinterlace' it before restoring. "Bob" & "DoubleWeave" are fast but with minor issues: "Bob" is coarse and "Doubleweave" lags by one frame. "Generate" is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects "DoubleWeave"
# StabilizeNoise (bool) Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for "Generate" mode
QTGMC(Preset="Slow", EdiThreads=2, Sharpness=1.4, SLMode=1, NoiseDeint="Generate", StabilizeNoise=true) # result is double framerate progressive, so re-interlate it later
#
# 4. --- do the motion stablization here - Does QTGMC keep motion vectors that I can re-use in "MDepan" ? if so, I wonder how ?
#blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate.
#overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size
#dct=0 # use dct=1 for clip with light flicker
#super0 = MSuper(pel=2,chroma=true,sharp=2)
#vect0 = MAnalyse(super0,isb=false, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
#globalmotion = MDepan(vect0, pixaspect=1.094, thSCD1=400, zoom=true, rot=true, range=2) #1.094 for standard PAL
#DepanStabilize(data=globalmotion, rotmax=5, cutoff=0.5, prev=3, next=3, pixaspect=1.094, dxmax=20, dymax=20, method=1) # lower vibration frequency cutoff
# 5. HDRAGC to adjust colours. i wonder if this is this similar to AUTOLEVELS,AUTOWHITE in FRED/JOHN scripts ?
SetMTmode(mode=5,threads=4)
HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
SetMTmode(mode=2,threads=4)
#
# To do RE-INTERLACING http://forum.doom9.org/showthread.php?p=1110741#post1110741
# AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -
# * AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -
# AssumeTFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -
# AssumeBFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -
# DE-INTERLACING and RE-INTERLACING http://forum.doom9.org/showthread.php?p=1374335#post1374335
AssumeTFF()
Blur(0,0.25).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace - ASSUMED TFF HERE # BLUR(0,1) per http://forum.doom9.org/showthread.php?p=1488308#post1488308
AssumeTFF()
AssumeFPS(25)
jj=LAST
#
compareboxed4(ii,"original",jj,"deblocked+degrained+QTGMC")
#
Function compareboxed2(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/2,0*hClip/2,-1*wClip/2,-1*hClip/2).subtitle(aSub,size=6), \
b.crop(1*wClip/2,0*hClip/2,-0*wClip/2,-1*hClip/2).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/2,1*hClip/2,-1*wClip/2,-0*hClip/2).subtitle(bSub,size=6), \
a.crop(1*wClip/2,1*hClip/2,-0*wClip/2,-0*hClip/2).subtitle(aSub,size=6)))
}
Function compareboxed4(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/4,0*hClip/4,-3*wClip/4,-3*hClip/4).subtitle(aSub,size=6), \
b.crop(1*wClip/4,0*hClip/4,-2*wClip/4,-3*hClip/4).subtitle(bSub,size=6), \
a.crop(2*wClip/4,0*hClip/4,-1*wClip/4,-3*hClip/4).subtitle(aSub,size=6), \
b.crop(3*wClip/4,0*hClip/4,-0*wClip/4,-3*hClip/4).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/4,1*hClip/4,-3*wClip/4,-2*hClip/4).subtitle(bSub,size=6), \
a.crop(1*wClip/4,1*hClip/4,-2*wClip/4,-2*hClip/4).subtitle(aSub,size=6), \
b.crop(2*wClip/4,1*hClip/4,-1*wClip/4,-2*hClip/4).subtitle(bSub,size=6), \
a.crop(3*wClip/4,1*hClip/4,-0*wClip/4,-2*hClip/4).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/4,2*hClip/4,-3*wClip/4,-1*hClip/4).subtitle(aSub,size=6), \
b.crop(1*wClip/4,2*hClip/4,-2*wClip/4,-1*hClip/4).subtitle(bSub,size=6), \
a.crop(2*wClip/4,2*hClip/4,-1*wClip/4,-1*hClip/4).subtitle(aSub,size=6), \
b.crop(3*wClip/4,2*hClip/4,-0*wClip/4,-1*hClip/4).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/4,3*hClip/4,-3*wClip/4,-0*hClip/4).subtitle(bSub,size=6), \
a.crop(1*wClip/4,3*hClip/4,-2*wClip/4,-0*hClip/4).subtitle(aSub,size=6), \
b.crop(2*wClip/4,3*hClip/4,-1*wClip/4,-0*hClip/4).subtitle(bSub,size=6), \
a.crop(3*wClip/4,3*hClip/4,-0*wClip/4,-0*hClip/4).subtitle(aSub,size=6)))
}
Function compareboxed8(Clip a, string asub, Clip b, string bsub) {
hClip = a.height()
wClip = a.width()
stackvertical(stackhorizontal(a.crop(0*wClip/8,0*hClip/8,-7*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,0*hClip/8,-6*wClip/8,-7*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,0*hClip/8,-5*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,0*hClip/8,-4*wClip/8,-7*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,0*hClip/8,-3*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,0*hClip/8,-2*wClip/8,-7*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,0*hClip/8,-1*wClip/8,-7*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,0*hClip/8,-0*wClip/8,-7*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,1*hClip/8,-7*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,1*hClip/8,-6*wClip/8,-6*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,1*hClip/8,-5*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,1*hClip/8,-4*wClip/8,-6*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,1*hClip/8,-3*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,1*hClip/8,-2*wClip/8,-6*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,1*hClip/8,-1*wClip/8,-6*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,1*hClip/8,-0*wClip/8,-6*hClip/8).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/8,2*hClip/8,-7*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,2*hClip/8,-6*wClip/8,-5*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,2*hClip/8,-5*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,2*hClip/8,-4*wClip/8,-5*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,2*hClip/8,-3*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,2*hClip/8,-2*wClip/8,-5*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,2*hClip/8,-1*wClip/8,-5*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,2*hClip/8,-0*wClip/8,-5*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,3*hClip/8,-7*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,3*hClip/8,-6*wClip/8,-4*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,3*hClip/8,-5*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,3*hClip/8,-4*wClip/8,-4*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,3*hClip/8,-3*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,3*hClip/8,-2*wClip/8,-4*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,3*hClip/8,-1*wClip/8,-4*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,3*hClip/8,-0*wClip/8,-4*hClip/8).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/8,4*hClip/8,-7*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,4*hClip/8,-6*wClip/8,-3*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,4*hClip/8,-5*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,4*hClip/8,-4*wClip/8,-3*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,4*hClip/8,-3*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,4*hClip/8,-2*wClip/8,-3*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,4*hClip/8,-1*wClip/8,-3*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,4*hClip/8,-0*wClip/8,-3*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,5*hClip/8,-7*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,5*hClip/8,-6*wClip/8,-2*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,5*hClip/8,-5*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,5*hClip/8,-4*wClip/8,-2*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,5*hClip/8,-3*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,5*hClip/8,-2*wClip/8,-2*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,5*hClip/8,-1*wClip/8,-2*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,5*hClip/8,-0*wClip/8,-2*hClip/8).subtitle(aSub,size=6)), \
stackhorizontal(a.crop(0*wClip/8,6*hClip/8,-7*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(1*wClip/8,6*hClip/8,-6*wClip/8,-1*hClip/8).subtitle(bSub,size=6), \
a.crop(2*wClip/8,6*hClip/8,-5*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(3*wClip/8,6*hClip/8,-4*wClip/8,-1*hClip/8).subtitle(bSub,size=6), \
a.crop(4*wClip/8,6*hClip/8,-3*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(5*wClip/8,6*hClip/8,-2*wClip/8,-1*hClip/8).subtitle(bSub,size=6), \
a.crop(6*wClip/8,6*hClip/8,-1*wClip/8,-1*hClip/8).subtitle(aSub,size=6), \
b.crop(7*wClip/8,6*hClip/8,-0*wClip/8,-1*hClip/8).subtitle(bSub,size=6)), \
stackhorizontal(b.crop(0*wClip/8,7*hClip/8,-7*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(1*wClip/8,7*hClip/8,-6*wClip/8,-0*hClip/8).subtitle(aSub,size=6), \
b.crop(2*wClip/8,7*hClip/8,-5*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(3*wClip/8,7*hClip/8,-4*wClip/8,-0*hClip/8).subtitle(aSub,size=6), \
b.crop(4*wClip/8,7*hClip/8,-3*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(5*wClip/8,7*hClip/8,-2*wClip/8,-0*hClip/8).subtitle(aSub,size=6), \
b.crop(6*wClip/8,7*hClip/8,-1*wClip/8,-0*hClip/8).subtitle(bSub,size=6), \
a.crop(7*wClip/8,7*hClip/8,-0*wClip/8,-0*hClip/8).subtitle(aSub,size=6)))
}