MTCombMask
From Avisynth wiki
(Difference between revisions)
m (add Deep_color_tools category) |
(v2.2.1) |
||
| (One intermediate revision by one user not shown) | |||
| Line 2: | Line 2: | ||
{{Filter3 | {{Filter3 | ||
| {{Author/Manao}}, {{Author/Asd-g}} | | {{Author/Manao}}, {{Author/Asd-g}} | ||
| − | | v2. | + | | v2.2.1 |
| − | |[https://github.com/Asd-g/MTCombMask/releases MTCombMask-2. | + | |[https://github.com/Asd-g/MTCombMask/releases MTCombMask-2.2.1.7z] |
| Masking | | Masking | ||
| [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | | [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | ||
| Line 16: | Line 16: | ||
* Chroma could be filtered; | * Chroma could be filtered; | ||
| − | * Y/YUV(A) 8.. | + | * Y/YUV(A) 8..32-bit clips are accepted; |
* All planar Y/YUV 8-bit clips are accepted; | * All planar Y/YUV 8-bit clips are accepted; | ||
* Support for AviSynth+'s v8 interface; | * Support for AviSynth+'s v8 interface; | ||
| Line 28: | Line 28: | ||
* [x64]: [[AviSynth+]] | * [x64]: [[AviSynth+]] | ||
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]] | * Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]] | ||
| − | ** AviSynth+: all Y/YUV/YUVA [[planar]] (8/10/12/14/16-bit) formats are supported | + | ** AviSynth+: all Y/YUV/YUVA [[planar]] (8/10/12/14/16/32-bit) formats are supported |
<br> | <br> | ||
| − | * [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ | + | * [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2022 Redistributable Package (x86 / x64)] |
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>MTCombMask-x86</tt> | :<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>MTCombMask-x86</tt> | ||
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>MTCombMask-x64</tt> | :<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>MTCombMask-x64</tt> | ||
| Line 37: | Line 37: | ||
== [[Script variables|Syntax and Parameters]] == | == [[Script variables|Syntax and Parameters]] == | ||
| − | :{{Template:FuncDef|CombMask (clip, int "thY1", int "thY2", int "Y", int "U", int "V", bool "usemmx") }} | + | :{{Template:FuncDef|CombMask (clip, int "thY1", int "thY2", int "Y", int "U", int "V", bool "usemmx", int "opt")}} |
<br> | <br> | ||
::{{Par2| |clip| }} | ::{{Par2| |clip| }} | ||
| − | ::: | + | :::A clip to process. It must be in YUV planar format. |
<br> | <br> | ||
::{{Par2|thY1|int|30}} | ::{{Par2|thY1|int|30}} | ||
| Line 62: | Line 62: | ||
::{{Par2|usemmx|bool|true}} | ::{{Par2|usemmx|bool|true}} | ||
:::Dummy parameter for backward compatibility. | :::Dummy parameter for backward compatibility. | ||
| + | <br> | ||
| + | ::{{Par2|opt|int|-1}} | ||
| + | :::Sets which cpu optimizations to use. | ||
| + | :::*-1 : Auto-detect. | ||
| + | :::*0 : Use C++ code. | ||
| + | :::*1 : Use SSE2 code. | ||
| + | :::*2 : Use AVX2 code. | ||
| + | :::*3 : Use AVX512 code. | ||
| + | :::Default: -1. | ||
<br> | <br> | ||
<br> | <br> | ||
| Line 67: | Line 76: | ||
== Examples == | == Examples == | ||
CombMask with default values: | CombMask with default values: | ||
| − | CombMask(thy1=30, thy2=30, y=3, u=1, v=1) | + | CombMask(thy1=30, thy2=30, y=3, u=1, v=1, opt=-1) |
To log combing value you may use this code: | To log combing value you may use this code: | ||
| Line 76: | Line 85: | ||
== Changelog == | == Changelog == | ||
Version Date Changes<br> | Version Date Changes<br> | ||
| + | v2.2.1 2022/08/06 - Added ~10% faster C code. | ||
| + | - Added SSE2, AVX2 and AVX512 code. | ||
| + | - Added parameter opt. | ||
| + | v2.2.0 2020/09/20 - Added support for float input. | ||
v2.1.0 2020/05/31 - Added support for 10..16-bit clips. | v2.1.0 2020/05/31 - Added support for 10..16-bit clips. | ||
v2.0.0 2020/05/20 - Initial release | v2.0.0 2020/05/20 - Initial release | ||
Latest revision as of 16:57, 7 August 2022
| Abstract | |
|---|---|
| Author | Manao, Asd-g |
| Version | v2.2.1 |
| Download | MTCombMask-2.2.1.7z |
| Category | Masking |
| License | GPLv2 |
| Discussion | |
Contents |
[edit] Description
This filter produces a mask showing areas that are combed. CombMask uses 3-point sampling to determine combing in a pixel.
The thresholds work as following: after calculating the combing value, if one is below thY1, the pixel is set to 0, if above thY2, it is set to 255, and if in between, it is set to the combing value divided by 256.
This is the same filter as the one from MaskTools-v1.5.8 with few changes:
- Chroma could be filtered;
- Y/YUV(A) 8..32-bit clips are accepted;
- All planar Y/YUV 8-bit clips are accepted;
- Support for AviSynth+'s v8 interface;
- Removed MMX asm code;
- Self registers as MT_NICE_FILTER in AviSynth+.
[edit] Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Supported color formats: Y8, YV12, YV16, YV24, YV411
- AviSynth+: all Y/YUV/YUVA planar (8/10/12/14/16/32-bit) formats are supported
- *** vcredist_x86.exe is required for MTCombMask-x86
- *** vcredist_x64.exe is required for MTCombMask-x64
[edit] Syntax and Parameters
- CombMask (clip, int "thY1", int "thY2", int "Y", int "U", int "V", bool "usemmx", int "opt")
- clip =
- A clip to process. It must be in YUV planar format.
- clip =
- int thY1 = 30
- Pixels below
thY1are set to 0. - Must be between 0 and 255 and must be <=
thY2. - Default: 30.
- Pixels below
- int thY1 = 30
- int thY2 = 30
- Pixels above
thY2are set to 255. - Must be between 0 and 255 and must be >=
thY1. - Default: 30.
- Pixels above
- int thY2 = 30
- int Y = 3
- int U = 1
- int V = 1
- Select which planes to process:
- 1 : do not process (garbage)
- 2 : copy
- 3 : process
- Select which planes to process:
- int Y = 3
- bool usemmx = true
- Dummy parameter for backward compatibility.
- bool usemmx = true
- int opt = -1
- Sets which cpu optimizations to use.
- -1 : Auto-detect.
- 0 : Use C++ code.
- 1 : Use SSE2 code.
- 2 : Use AVX2 code.
- 3 : Use AVX512 code.
- Default: -1.
- Sets which cpu optimizations to use.
- int opt = -1
[edit] Examples
CombMask with default values:
CombMask(thy1=30, thy2=30, y=3, u=1, v=1, opt=-1)
To log combing value you may use this code:
CombMask(thy1=30, thy2=30, y=3, u=1, v=1) WriteFile("c:\log.txt", """ ScriptClip(String(AverageLuma())) """)
[edit] Changelog
Version Date Changes
v2.2.1 2022/08/06 - Added ~10% faster C code. - Added SSE2, AVX2 and AVX512 code. - Added parameter opt. v2.2.0 2020/09/20 - Added support for float input. v2.1.0 2020/05/31 - Added support for 10..16-bit clips. v2.0.0 2020/05/20 - Initial release
[edit] External Links
- GitHub - Source code repository.
Back to External Filters ←