irlnic
1st March 2022, 14:30
There is the original script.https://forum.doom9.org/showthread.php?p=1582950#post1582950
Thank Sp00kyFox!It's based on his script.
luma = tfm(pp=0, slow=2)
chroma = vinverse().Srestore(omode="PP3", cache=4)
# manual sync: figure out which frame (previous,current aka p,c) of 'chroma' clip is most similar to current frame of 'luma' clip
# 46*log(|x-y|+1) uses the full [0,255]-range and scales little differences better than |x-y|*2
diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *")
diffc = mt_lutxy(luma,chroma, "x y - abs 1 + log 46 *")
# average difference between compared frames
mp = mt_lutf(diffp,diffp,"avg",expr="x")
mc = mt_lutf(diffc,diffc,"avg",expr="x")
# build conditional masks based on the caculated comparisons
maskp = mt_lutxy(mp,mc,"x y < 255 0 ?")
# finally merge the luma of the tfm with the chroma of the srestore clip accordingly to the binary mask
p = MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3)
#irlnic:the result is interlaced frames are replaced by previous frames
#the following are what I write
#replace interlaced frames with next frames in the clip
n = p.selectevery(1,1)
n = ConditionalFilter(src,n,p,"IscombedTIVTC","=","true")
#delete surplus frames by pattern of telecine I find
Interleave(p,n)
SelectEvery(5 ,0,1,2,3)
SelectEvery(2 ,0)
Sent my appreciation to Doom9's Forum!It works well for me!I will be glad if it can help some people!
Thank Sp00kyFox!It's based on his script.
luma = tfm(pp=0, slow=2)
chroma = vinverse().Srestore(omode="PP3", cache=4)
# manual sync: figure out which frame (previous,current aka p,c) of 'chroma' clip is most similar to current frame of 'luma' clip
# 46*log(|x-y|+1) uses the full [0,255]-range and scales little differences better than |x-y|*2
diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *")
diffc = mt_lutxy(luma,chroma, "x y - abs 1 + log 46 *")
# average difference between compared frames
mp = mt_lutf(diffp,diffp,"avg",expr="x")
mc = mt_lutf(diffc,diffc,"avg",expr="x")
# build conditional masks based on the caculated comparisons
maskp = mt_lutxy(mp,mc,"x y < 255 0 ?")
# finally merge the luma of the tfm with the chroma of the srestore clip accordingly to the binary mask
p = MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3)
#irlnic:the result is interlaced frames are replaced by previous frames
#the following are what I write
#replace interlaced frames with next frames in the clip
n = p.selectevery(1,1)
n = ConditionalFilter(src,n,p,"IscombedTIVTC","=","true")
#delete surplus frames by pattern of telecine I find
Interleave(p,n)
SelectEvery(5 ,0,1,2,3)
SelectEvery(2 ,0)
Sent my appreciation to Doom9's Forum!It works well for me!I will be glad if it can help some people!