Log in

View Full Version : (leak)KernelDeint request


Mug Funky
8th June 2005, 16:48
hi all. i'm trying to emulate a hardware standards-converter in avisynth, so i can do quick conversion jobs offline when the hardware converter is busy (which is pretty much all the time).

i've _almost_ got a perfect emulation going using regular resizing, convertfps and leakKernelBob (i use the optimised one because speed is a big deal). the quality out of the script is give-or-take the same as what comes out of the hardware, only costing several thousand dollars less :).

however, one thing that could be improved is the motion-mask. it works very well as it is, but i'd like to be able to avoid what Scharfi calls "kernel ghosts", namely bits just under the threshold on edges that get passed through and show up on the wrong frame.

a simple solution IMHO would be to apply something like Manao's "expand" on the motion-map to include pixels immediately around a pixel marked for interpolation.

now this is easily done in script, but there's the issue of speed. so i have 2 ideas:

- implement an expand-like function straight into kerneldeint
- allow an arbitrary mask to be used in kerneldeint (possibly one created by another kerneldeint with map set to true?)

i don't know which would offer better performance, but certainly the latter option would be more flexible.

now, i'm by no means insisting this be done... it's just an idea for adding at a future date if either neuron2 or leak have some time :) also, if it's possible to do things at a similar speed just using masktools, then i'll go with that. i don't know enough of the internals of these plugins to be able to make a call on what method would be most efficient.

Chainmax
8th June 2005, 23:18
Sorry for the hijack, but I can't believe that a freeware filter can give the same or better results than a hardware solution. There has to be a reason why it costs so many thousand dollars, right? And if it doesn't, why not use only these filters every time?

More on-topic, why LeakKernelBob and not TDeint?

Mug Funky
9th June 2005, 02:11
first, the on-topic:

because kerneldeint is faster by a long way. i've actually got a super-big custom "converttoPAL" script that i'm slowly building to make user-friendly enough for non-avs loonies to use. seeing as there's good quality control here, everything gets watched, and if there's a slight glitch somewhere, i have a backup that uses tDeint that i can re-encode small segments on. this saves a lot of time in the long run, and obviously both deinterlacers behave the same on static areas, so quality is pretty close to the same.

also, kerneldeint most closely mimics the process used in the hardware converter, and tdeint has its own quirks (though i prefer it for tricky stuff).

now off-topic:

the expensive hardware stuff pays for itself in no time - think that around 50 DVDs per month (all with a fairly large print run) go through a machine that cost around $15000. the tape decks cost a lot more (anything from $40000 to $80000 AUD). how much are we making off those DVDs? quite a lot. other reasons for the cost is that it runs continuously, 24/7 (i turned it off for the first time yesterday), works in 10-bit 4:2:2 and supports various basic kinds of denoising (that almost never gets used...). also it's _almost_ completely fail-safe, whereas avisynth is prone to crashes if your system isn't running perfectly (whose is?).

that and it's all realtime, as well.

mg262
9th June 2005, 09:46
@Mug Funky,
i've _almost_ got a perfect emulation going using regular resizing, convertfps and leakKernelBob FWIW convertFPS seems to be unoptimised (i.e. pure C) so it's worth checking how much time it takes. Also (maybe) worth knowing that in blend mode it has a threshold weight of 1/16 below which it doesn't blend, and that it works internally with 1/64 grain luma/chroma values. (All v2.55).