Log in

View Full Version : Help with deinterlacing


~SimpleX~
4th July 2016, 14:54
I have an anime video with hybrid interlace/telecine. Interlaced frames are somehow damaged and I don't know how to properly repair this.

Sample (http://www.mediafire.com/download/bbwmqwqua5a6df8/interlace.demuxed.m2v).

Please help. Vapoursynth or avisynth. :thanks:

GMJCZP
4th July 2016, 20:03
Take a look with AnimeIVTC Mod and mode = 4.

colours
4th July 2016, 23:44
Would've been nice of you to at least mention that your source is some kind of cheap animated porn.

Field stepping indicates that the actual problem with your sample is that it's 30 fps, but has a screwed up field order. If the rest of the source is telecined as usual, then the ideal way of handling this is to use VFR: use some IVTC filters for the telecined parts and splice the below script for the rest.

ffvideosource("O:\interlace.demuxed.m2v")

doubleweave().selectodd()

There also seems to be cross conversion artifacts, but I'm too lazy to figure out how best to deal with that.

~SimpleX~
6th July 2016, 06:26
Yes, this is some "cheap animated porn" aka hentai. I'm learning on this kind of material (a LOT of visual defects, a lot of filters required). I'm sorry I didn't mention that. :(

Take a look with AnimeIVTC Mod and mode = 4.
Nope, won't help. Thanks for suggestion!

It seems simple

tfm().vinverse().daa()

is "good" enough for combing removal (or maybe not, I actually use vapoursynth now, so it's vfm instead of tfm). I've tried QTGMC, tdeint, yadifmod, but they're definitely not applicable here.
Edges are somehow unstable after deinterlacing, which I don't know how to deal with. Also some ghosting around scene changes (can be removed with SMDegrain, but too much lost details in other scenes). Any thoughts?

GMJCZP
6th July 2016, 22:10
Try this version of DAA that I modded:


# Anti-aliasing with contra-sharpening by Didée (thanks to Didée, modded for this case with nnedi3)
# Is required nnedi3, Masktools2, RGTools
# Modded by GMJCZP
function DAAMod(clip c)
{
nn = c.nnedi3(field=-2)
dbl = mt_average(selecteven(nn),selectodd(nn),U=3,V=3)
dblD = mt_makediff(c,dbl,U=3,V=3)
shrpD = mt_makediff(dbl,dbl.removegrain((width(c)>1100) ? 20 : 14),U=3,V=3).verticalcleaner(mode=2)
DD = shrpD.repair(dblD,9)
return dbl.mt_adddiff(DD,U=3,V=3)
}


Sometimes can help.

Or try in detail Tfm-Tdecimate and vfr options (for example, for Tdecimate try mode = 3 and hybrid = 2).

Another home remedy: Here (https://github.com/hatt/Yatta).

~SimpleX~
7th July 2016, 07:45
Thanks, took to my plugins. For this source daa3 (this version is ported to vapoursynth) is better. Yes, daa3 destroys small details, but DAAMod preserves line separation here (or how is it called?).

Btw, here is daamod for VS:
# Anti-aliasing with contra-sharpening by Didée (thanks to Didée, modded for this case with nnedi3)
# Is required VerticalCleaner
# Modded by GMJCZP
def daamod(c):
core = vs.get_core()

if not isinstance(c, vs.VideoNode):
raise TypeError('daa: This is not a clip')

nn = core.nnedi3.nnedi3(c, field=3)
dbl = core.std.Merge(core.std.SelectEvery(nn, 2, 0), core.std.SelectEvery(nn, 2, 1))
dblD = core.std.MakeDiff(c, dbl)
shrpD = core.std.MakeDiff(dbl, core.rgvs.RemoveGrain(dbl, 20 if c.width > 1100 else 14))
shrpD = core.rgvs.VerticalCleaner(shrpD, mode=2)
DD = core.rgvs.Repair(shrpD, dblD, 9)
return core.std.MergeDiff(dbl, DD)