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.
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.