Log in

View Full Version : another smart bob technique that might be useful


Mug Funky
4th March 2004, 07:14
i've recently been playing around with something approaching high-passing in avisynth for doing filters and edgemasks and soft-thresholding.

there's a LOT that can be done with this... it allows you to isolate certain "frequency ranges" (i use quotes because it's really quite arbitrary) and filter only the ones you need. for example you can denoise a clip by only denoising the high frequencies and leaving the low ones, and then mixing the 2 component clips back together with a mask...

well anyhoo, here's a Tomsmocomp based smart bob that is so simple (and reasonably effective) that i'm kicking myself i didn't think of it earlier.


function HFbob(clip c)
{
blend = c.blur(0,1).blur(0,-1)
masked = subtract(blend,c)

top = subtract(blend,masked.tomsmocomp(0,5,0)) # use whatever deinterlace you want here
bottom = subtract(blend,masked.tomsmocomp(1,5,0))

interleave(top,bottom)
}


damn simple, huh? it's pretty fast too, and works in any mode that tomsmocomp can handle (YV12 and YUY2).

my intention with this bob technique is to facilitate moster scripts that require a smart bob, and un-blending techniques (paging Scharfis_brain and Mf...)

one caveat: currently there's a bit of a bug in subtract that inverts the luma on some pixels if you have colours outside the CCIR range (8-235). hopefully this will be fixed (or a separate mode added, as from what i've read the clipping technique would make it slightly slower), but until then you can simply limit your luma ranges and all will be well.

i've tested this on natural video so far, but not anime.

mf
4th March 2004, 13:08
Looks interesting! But there is already a workaround for the inverting :).

Subtract
Overlay subtracted over itself in "exclusion" mode
Overlay inverted subtract over itself in "exclusion" mode and invert back
Overlay invert-exluded subtract over excluded subtract in "lighten" mode

If I explained any of the steps wrong (aka NO WFM), please tell me. At the moment I'm sleepy and I already greeted my login field with "morning" instead of my username.

scharfis_brain
4th March 2004, 18:12
hm, thested this one.
leaves more stairstepping on slow-moving borders than a simple bobber with tomsmocomp(x,5,0)
(btw. I really hate staiestepping)

so there is no big difference between the two in quality.

please tell my, what I have to look for, to see a quality improvement over other simple bobbing techniques or advanced bob-techniques...

Yuri
4th March 2004, 20:36
scharfis_brain's "New bobbing deinterlacer (especially for blended clips)" seems to be literally a flawless deinterlacer which not only eliminates stairs effect but also gives a 1.5 compression gain! Thank you, scharfis_brain.
Though, Mug Funky's one is fast :)

Mug Funky
5th March 2004, 14:55
yeah. i'm still trying to nut out the stairstep thing. i think it's due to the blending that takes place. false positives or something.

i'm hoping the stair-stepping will not appear on anime, but i haven't had time to test it (when i posted this yesterday i was literally out the door a minute after).

basically the script was fleshed out in a minute or two, so there's room for improvement. i'm of the opinion that there can never be enough ways to do the same thing :)

(by the way, your script is brilliant...)