Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th March 2013, 19:41 | #3 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
This is a function I used inside of various scripts. It should give you a starting point for doing what you want to do. The one line you want to "steal" for your work is this one:
Code:
MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift) Here's the entire function, but you probably don't need all the noise reduction stuff. As you can see, the overall function is designed for interlaced material (which is why you see the separatefields()/weave() combination). Code:
function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct") { Vshift=0 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc Hshift=0 # determine experimentally overlap=default(overlap,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 #This line gets rid of chroma halo fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift)) #This line will shift chroma down and to the right instead of up and to the left -- use instead of line above #fields=MergeChroma(fields,Crop(AddBorders(fields,Hshift,Vshift,0,0),0,0,-Hshift,-Vshift)) super = fields.MSuper(pel=2, sharp=1) backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct) forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct) backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct) forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct) MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400) Weave() } |
|
|