CombMask

From Avisynth wiki
Revision as of 04:10, 17 May 2020 by Reel.Deal (Talk | contribs)

Jump to: navigation, search
Abstract
Author Chikuzen
Version v1.1.1
Download CombMask-1.1.1.7z
Category Masking
License
Discussion


Contents

Description

A filter to create and process comb masks. These filters were written from scratch, but most of logic comes from tritical's TIVTC plugin.

Requirements


*** vcredist_x86.exe is required for CombMask-x86
*** vcredist_x64.exe is required for CombMask-x64


Syntax and Parameters

CombMask

CombMask is a simple filter that creates a comb mask that can (could) be used by other filters like MaskTools2.
The mask consists of binaries of 0(not combed) and 255(combed).

CombMask (clip, int "cthresh", int "mthresh", bool "chroma", bool "expand", int "metric", int opt)


clip   =
Input clip.


int  cthresh =
Spatial combing threshold.
  • 0 to 255, default is 6 (metric=0)
  • 0 to 65025, default is 10 (metric=1


int  mthresh = 9
Motion adaptive threshold.
  • 0 to 255, default is 9.


bool  chroma = true
Whether processing is performed to UV planes or not.
  • Default is true.


bool  exapnd = true
When set this to true, left and right pixels of combed pixel also assumed to combed.
  • Default is true.


int  metric = 0
Sets which spatial combing metric is used to detect combed pixels.
Possible options:
             Assume 5 neighboring pixels (a,b,c,d,e) positioned vertically.

      a
      b
      c
      d
      e

0:  d1 = c - b;
    d2 = c - d;
    if ((d1 > cthresh && d2 > cthresh) || (d1 < -cthresh && d2 < -cthresh))
    {
       if (abs(a+4*c+e-3*(b+d)) > cthresh*6) it's combed;
    }

1:  val = (b - c) * (d - c);
    if (val > cthresh) it's combed;

default is 0.


int  opt =
Specify which CPU optimization are used.
  • 0 : Use C++ routine.
  • 1 : Use SSE2 routin if possible. When SSE2 can't be used, fallback to 0.
  • Others(default) : Use AVX2 routine if possible. When AVX2 can't be used, fallback to 1.



MaskedMerge

MaskedMerge is an exclusive masking filter for CombMask. This is often faster than MaskTools2's mt_merge().

MaskedMerge (clip base, clip alt, clip mask, int "MI", int "blockx", int "blocky", bool "chroma", int opt)


clip   =
Input clip.


   =


   =


   =


   =


   =


   =


   =


   =



IsCombed

IsCombed is a is a utility function that can be used within AviSynth's ConditionalFilter to test whether or not a frame is combed and returns true if it is and false if it isn't.

IsCombed (clip, int "cthresh", int "mthresh", int "MI", int "blockx", int "blocky", int "metric", int "opt")


clip   =
Input clip.


   =


   =


   =


   =


   =


   =


   =


   =


Examples

TODO:

AviSource("blah.avi")


Changelog

Version      Date            Changes
v1.1.1 2020/05/13 - Changes by asd-g - Update to AviSynth+'s v8 interface


External Links

  • GitHub - Source code repository.
  • GitHub - Source code repository (update).




Back to External Filters

Personal tools