Log in

View Full Version : Family Guy and blends


bollstedt
4th February 2006, 13:22
Hi,

I have got many problems with the Family Guy RC2 PAL DVDs. I'm using cdeblend and smartdecimate to avoid blends, but there are still too many. Any help would be appreciated!

Some sampels from the DVD:
http://rapidshare.de/files/11453010/Guy.m2v.html
http://rapidshare.de/files/12008890/guy2.m2v.html

That is my script:

# PLUGINS
LoadPlugin("C:\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\RemoveDirtS.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\RepairS.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\removegrains.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\tdeint.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\avisynth_c.dll")
loadCplugin("C:\AviSynth 2.5\plugins\SmartDecimate.dll")
LoadPlugin("C:\AviSynth 2.5\plugins\FFT3dgpu.dll") # against rainbow effects

MPEG2Source("D:\FAMILY_GUY_DISC1\1\1.d2v")

tdeint(mode=1, full=false)

repair(last, last.blur(1.2), 1,1)
removegrain(mode=4).removedirt()

Cdeblend(perc=7, dmode=2, omode=3, thresh=111)
SmartDecimate()
FFT3DFilter(Sigma=3,Sigma3=100,plane=3)
crop(10,0,700,572)
LanczosResize(696,568)


Function Cdeblend(clip input, int "dmode", int "perc", int "omode", float "thresh", float "dthresh", float "mthresh", float "mil", clip "clip2")
{
###### PREPARATION ######
global output = input
global blendclip = default(clip2, input)
global predup = input.duplicateframe(0).tweak(hue=-0.22)
global postdup = input.trim(1,0).tweak(hue=0.22)

global perc = default(perc,3)
global thresh = default(thresh,50.0)/100.0 + 1.0
global dmode = default(dmode,0)
global omode = default(omode,0)
global dthresh = default(dthresh,0)/100.0
global mthresh = default(mthresh,0)
global mil = default(mil, 255.0)

###### Mask-Preparation ######
fr_diff = mt_lutxy(blendclip,blendclip.trim(1,0), yexpr="128 y + x -", uexpr="x", vexpr="x")

global m2_mask = mt_lutxy(fr_diff, fr_diff.trim(1,0), yexpr="x 128 > y 128 < & x 128 < y 128 > & | x 128 - abs y 128 - abs < x 128 - 2 ^ 2 - y 128 - 2 ^ 2 - ? 0 ?", uexpr="x", vexpr="x")
global ssd = mt_lut(fr_diff.trim(1,0), yexpr="128 x - 2 ^ 2 -", uexpr="x", vexpr="x")

###### VAR.. ######
global diffn = 1.0
global difc1 = 1.0
global temp = 1.0
global btest1 = 1.0
global btest0 = 1.0

###### Conditional Function Chain, evaluated from bottom to top (!) ######
b99=scriptclip(input, " omode == 4 ? output.subtitle(string(btest0)).subtitle(string(diffc), y=25) :
\ (diffc > mthresh ? (omode==3 && btestb*dthresh > btest0 && btestb*dthresh > btest1 ? predup :
\ (omode==3 && btest1*dthresh > btest0 && btest1*dthresh > btestb ? postdup :
\ (thresh < 2.0 && (btest0/btestb + btest0/btest1) < thresh || thresh >= 2.0 && btest0 < btestb && btest0 < btest1 ?
\ (omode==1 || omode==2 && difcb<difc0 || omode==3 && btest1<btestb ? predup : postdup) : output))) : output)")

b3=FrameEvaluate(b99, " global btest1 = (dmode == 0 ? difc1+difc0-diffn : AverageLuma(m2_mask)) / (difc1<difc0 ? (difc1+difc0/perc > mil ? mil :
\ difc1+difc0/perc) : (difc0+difc1/perc > mil ? mil : difc0+difc1/perc))
global temp = difc0")

b2=FrameEvaluate(b3, " global difc1 = dmode != 2 ? YDifferenceToNext(blendclip.trim(1,0)) : AverageLuma(ssd)
global diffn = LumaDifference(blendclip,blendclip.trim(2,0))
global btest0 = btest1")

b1=FrameEvaluate(b2, " global difc0 = difc1
global difcb = temp
global diffc = diffn
global btestb = btest0")
return(b1)
}

Lil' Jer
4th February 2006, 13:34
Just to throw it out, but have you tried restore24?

bollstedt
4th February 2006, 14:01
Yes, I tried restore24 and there were still to many blends.

bollstedt
5th February 2006, 20:48
No idea?