johnmeyer
8th January 2015, 01:06
I have a good quality NTSC VHS source that has more noise in the odd fields than the even fields:
More Noise in Odd fields (https://www.mediafire.com/?6j8y68779zr1x7y) (6 MB DV AVI file, hosted at MediaFire)
Just Bob or Separatefields() on this short clip, and you'll immediately see what I mean.
I am using MDegrain2, adapted from the sample given in the doc:function MDegrain2i2(clip source, int "blocksize", int "over", int "denoising_strength", int "dct")
{
overlap=default(over,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker
fields=source.SeparateFields() # separate by fields
prefiltered = RemoveGrain(fields,2)
superfilt = MSuper(prefiltered, hpad=32, vpad=32,pel=2)
super= MSuper(fields, hpad=32, vpad=32,pel=2)
halfblksize= (blocksize>4) ? blocksize/2 : 4
halfoverlap= (over>2) ? over/2 : 2
bvec1 = MAnalyse(superfilt, isb = true, delta = 2, blksize=blocksize, overlap=over,dct=dct)
bvec1 = MRecalculate(super, bvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
fvec1 = MAnalyse(super, isb = false, delta = 2, blksize=blocksize, overlap=over,dct=dct)
fvec1 = MRecalculate(super, fvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
bvec2 = MAnalyse(super, isb = true, delta = 4, blksize=blocksize, overlap=over,dct=dct)
bvec2 = MRecalculate(super, bvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
fvec2 = MAnalyse(super, isb = false, delta = 4, blksize=blocksize, overlap=over,dct=dct)
fvec2 = MRecalculate(super, fvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
denoised = fields.MDegrain2(super, bvec1,fvec1,bvec2,fvec2,thSAD=denoising_strength)
Weave(denoised)
}This function separates the interlaced video into fields, and then uses delta of 2 and 4 to match even fields with even, and odd fields with odd. I was hoping for a little insight into how to retain this elegant programming, while allowing me to apply a larger amount of noise reduction to the noiser field. I can certainly construct a monster, by duplicating this entire code block, applying a different amount of denoising, do a couple of SelectEvery(), and then interleave it back together, but I was hoping someone might have some more elegant ideas.
Thanks!
More Noise in Odd fields (https://www.mediafire.com/?6j8y68779zr1x7y) (6 MB DV AVI file, hosted at MediaFire)
Just Bob or Separatefields() on this short clip, and you'll immediately see what I mean.
I am using MDegrain2, adapted from the sample given in the doc:function MDegrain2i2(clip source, int "blocksize", int "over", int "denoising_strength", int "dct")
{
overlap=default(over,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker
fields=source.SeparateFields() # separate by fields
prefiltered = RemoveGrain(fields,2)
superfilt = MSuper(prefiltered, hpad=32, vpad=32,pel=2)
super= MSuper(fields, hpad=32, vpad=32,pel=2)
halfblksize= (blocksize>4) ? blocksize/2 : 4
halfoverlap= (over>2) ? over/2 : 2
bvec1 = MAnalyse(superfilt, isb = true, delta = 2, blksize=blocksize, overlap=over,dct=dct)
bvec1 = MRecalculate(super, bvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
fvec1 = MAnalyse(super, isb = false, delta = 2, blksize=blocksize, overlap=over,dct=dct)
fvec1 = MRecalculate(super, fvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
bvec2 = MAnalyse(super, isb = true, delta = 4, blksize=blocksize, overlap=over,dct=dct)
bvec2 = MRecalculate(super, bvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
fvec2 = MAnalyse(super, isb = false, delta = 4, blksize=blocksize, overlap=over,dct=dct)
fvec2 = MRecalculate(super, fvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100)
denoised = fields.MDegrain2(super, bvec1,fvec1,bvec2,fvec2,thSAD=denoising_strength)
Weave(denoised)
}This function separates the interlaced video into fields, and then uses delta of 2 and 4 to match even fields with even, and odd fields with odd. I was hoping for a little insight into how to retain this elegant programming, while allowing me to apply a larger amount of noise reduction to the noiser field. I can certainly construct a monster, by duplicating this entire code block, applying a different amount of denoising, do a couple of SelectEvery(), and then interleave it back together, but I was hoping someone might have some more elegant ideas.
Thanks!