TColorMask
(tcolormask: add documentation) |
m (→Performance: typo) |
||
Line 56: | Line 56: | ||
This plugin uses direct SIMD computations to do its dirty work. SIMD appears to be faster than LUT for the most common cases, but unfortunately its speed depends on the number of specified colors and at some point it does get slower than LUT. That's why the alternative is also provided. If specified more than lutthr (9 by default) colors, the plugin will use the LUT routine to avoid performance degradation. | This plugin uses direct SIMD computations to do its dirty work. SIMD appears to be faster than LUT for the most common cases, but unfortunately its speed depends on the number of specified colors and at some point it does get slower than LUT. That's why the alternative is also provided. If specified more than lutthr (9 by default) colors, the plugin will use the LUT routine to avoid performance degradation. | ||
− | See performance table on [https://github.com/tp7/tcolormask | + | See performance table on [https://github.com/tp7/tcolormask#performance GitHub]. |
<br> | <br> | ||
<br> | <br> | ||
+ | |||
== Examples == | == Examples == | ||
tcolormask with default values, except colors: | tcolormask with default values, except colors: |
Revision as of 17:44, 27 March 2020
Abstract | |
---|---|
Author | tp7 |
Version | v1.2 |
Download | tcolormask-x86.zip // tcolormask-x64.zip |
Category | Masking |
License | GPLv2 |
Discussion |
Contents |
Description
TColorMask This is a port of the great tophf's script t_colormask. It masks colors but unlike the old ColorKeyMask it works on YV12. The main reason for this plugin is performance. The API and output are not identical, please refer to the Difference section for details.
Requirements
Syntax and Parameters
- tcolormask (clip, string "colors, int "tolerance", bool "bt601", bool "gray", int "lutthr", bool "mt")
- clip =
- Input clip.
- clip =
- string colors = ""
- String of colors. Line and block comments are allowed.
- string colors = ""
- int tolerance = 10
- Pixel value will pass if its absolute difference with color is less than tolerance (luma) or half the tolerance (chroma).
- int tolerance = 10
- bool bt601 = false
- Use bt601 matrix for conversion of colors.
- bool bt601 = false
- bool gray = false
- Set chroma of output clip to 128.
- bool gray = false
- int lutthr = 9
- If specified more than
lutthr
colors, LUT will be used instead of direct SIMD computations.
- If specified more than
- int lutthr = 9
- bool mt = true
- Enable multithreading. It actually uses only two threads as any more threading doesn't seem to be useful.
- bool mt = true
Difference
Unlike the old script, this plugin uses a single string to specify all colors and doesn't do any blurring. Wrapper functions are provided for convenience in the bin/tcolormask_wrappers.avs script.
Also since we process chroma and luma together to avoid having to merge planes later, output is not identical. Basically it appears a bit less blurred and doesn't contain any non-binary values produced by chroma resizing. This will not be fixed and there's no workaround. You'll most likely be blurring the output clip anyway.
Performance
This plugin uses direct SIMD computations to do its dirty work. SIMD appears to be faster than LUT for the most common cases, but unfortunately its speed depends on the number of specified colors and at some point it does get slower than LUT. That's why the alternative is also provided. If specified more than lutthr (9 by default) colors, the plugin will use the LUT routine to avoid performance degradation.
See performance table on GitHub.
Examples
tcolormask with default values, except colors:
AviSource("bah.avi") tcolormask("$E0C0AB", tolerance=10, bt601=false, gray=false, lutthr=9, mt=true)
Changelog
Version Date Changes
v1.2 2013/11/30 - x64 build added. - Function from tcolormask_wrappers will not work with x64 build of AviSynth+. v1.1 2013/07/26 - This plugin now only works with AviSynth 2.6 alpha 4. If you need support for older versions, download v1.0.1. - Also, YV16 colorspace is now supported. v1.0 2013/07/08 - Actually working now.
External Links
- GitHub - Source code repository.
Back to External Filters ←