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. |
21st May 2004, 10:19 | #1 | Link |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
New filter: TCombMask
This isn't completely new, I had posted this towards the end of another thread that I pretty much hijacked with it ... though if anyone actually tried to use the original version I would feel sorry for them . Basically, this filter creates a comb mask (i.e. it will output a binary mask with combed pixels marked with a different value then non-combed pixels). It supports a wide selection of area combing metrics and motion detection options.
TCombMaskv094 The original version had some unwanted features (bugs in the motion detection), but those are now fixed. This version also includes the ability to do double thresholds (like fielddeinterlace with full=false), meaning you can create a mask with one set of settings... then have TCombMask check whether or not it is combed. If it is, TCombMask will output another mask based off the other settings or output a blank mask. So it would now be useful for ivtc post processing. Also, the pixel values that combed and non-combed pixels get set to are now user definable and no longer fixed at 255 and 0. Two other area combing metrics have been added, as well as a few other parameters and features. I also added in two very basic MMX/SSE2 optimized masking functions that make it easier to use TCombMask's output for something useful. These functions could be accomplished with other masking functions (ones from MaskTools or AviSynth's overlay) though this makes it more straight forward and sometimes helps to avoid calls to levels(). The first is TMaskedMerge which takes two clips, a mask clip, and a value, for every pixel it checks if the value of the mask pixel is equal to the value parameter. If it is, then the pixel from the first clip is used... if not the pixel from the second clip is used. The second is TMaskedMerge3 which is exactly like TMaskedMerge but chooses between 3 clips based on 2 values instead of 2 clips based on 1 value. This all means you can do things like the following. To make a simple same frame rate cubic deinterlacer: mpeg2source("c:\source.d2v") d = last.bob().selecteven() m = last.tcombmask(high=0,low=255) tmaskedmerge(last,d,m,255) Or TMaskedMerge3 allows slightly more interesting things to be done relatively easily, but usually will require the very nice and unbelievably useful MaskTools filter as well (note that parts of this must be adjusted depending on the field order of the clip): mpeg2source("c:\source.d2v") n = last.separatefields().trim(1,0).weave() d = last.bob().selectodd() mc = last.tcombmask(high=0,low=255) mn = n.tcombmask(high=0,low=128) mt = logic(mc,mn,"or") tmaskedmerge3(last,n,d,mt,255,128) Anyways... in general this isn't really too useful of a filter, though someone might find a use for it. |
Thread Tools | Search this Thread |
Display Modes | |
|
|