Log in

View Full Version : Detect deinterlaced pixels?


flossy_cake
3rd March 2023, 18:08
Hello

There is something I'm seeing in other people's encodes of 480i/576i content which I can't figure out.

I think it is some sort of detection of deinterlaced (bobbed) pixels, and replacing them with a nnedi3 upscaled version of those pixels? Or something like that?

Is there such a filter in Avisynth? Something that compares the current pixel to the one above/below and if there are n such pixels within 16x16 pixel area, declare the frame as containing deinterlaced pixels so we can swap them out for nnedi3 ones?

I've seen there is this AI ONNX model called "Anime UDeint" (https://forum.doom9.org/showthread.php?t=184768) which is seemingly what I'm after, but I need a realtime version of it, and using it on live action content. Something like IsCombedTIVTC() except IsBobbedTIVTC().

https://i2.lensdump.com/i/TBVDWb.png

:thanks:

flossy_cake
27th March 2023, 21:54
QTGMC seems to offer a good solution:


QTGMC(preset="slow"/"slower", InputType=1/2/3, [optional: TR2=2/3], EdiThreads=cores/2, Sharpness=1.0)


Start with InputType=1 and TR2 default, then if more smoothing needed, InputType=2, if more still, add TR2=2 or 3.

cubicibo
29th March 2023, 10:52
If the original fields are preserved enough (no resizing performed) and the framerate is not halved, you could also
AssumeTFF/BFF
SeparateField
SelectEven
(Deinterlace with NNEDI3)

That you apply on the selected (Select()) frame pattern you observe. If the pattern period is random, this won't work of course and you have to resort to more automated filtering.