SmoothUV2
From Avisynth wiki
(Difference between revisions)
(v2.1.1) |
(SmoothUV2 4.4.1) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{FilterCat6|External_filters|Plugins|Plugins_x64|Denoisers|Spatial_denoisers|Deep_color_tools}} |
{{Filter3 | {{Filter3 | ||
− | | | + | |1={{Author/dubhater}}, {{Author/Asd-g}} |
− | | | + | |2=v4.4.1 |
− | | [https://github.com/Asd-g/AviSynth-SmoothUV2/releases SmoothUV2 | + | |3=[https://github.com/Asd-g/AviSynth-SmoothUV2/releases SmoothUV2] |
− | | Spatial Denoisers | + | |4=Spatial Denoisers |
− | | [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | + | |5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] |
− | |}} | + | |6=}} |
== Description == | == Description == | ||
− | SmoothUV2 is a | + | [[SmoothUV2]] is a modern replacement for the old [[SmoothUV]] plugin. It includes two filters: |
− | + | *[[#SSHiQ2|SSHiQ2]] - a general purpose spatial denoising filter. | |
− | + | *[[#SmoothUV2|SmoothUV2]] - a spatial derainbow filter. | |
− | + | <br> | |
− | * | + | Key differences to the original [[SmoothUV]]: |
− | * <code>"fields"</code> parameter renamed to <code>"interlaced"</code> | + | * Filters renamed to SSHiQ2 and SmoothUV2. |
− | * Additional colorspace support | + | * <code>"fields"</code> parameter renamed to <code>"interlaced"</code> and changed from a boolean to an integer. |
− | * x64 bit version | + | * Additional colorspace support, including [[HBD]]. |
+ | * x64 bit version. | ||
+ | * Version 4.2.0; dropped support for AviSynth 2.6. | ||
<br> | <br> | ||
== Requirements == | == Requirements == | ||
− | * [x86]: [[AviSynth+] | + | * [x86]: [[AviSynth+]] |
* [x64]: [[AviSynth+]] | * [x64]: [[AviSynth+]] | ||
* Supported color formats: [[YV12]], [[YV16]], [[YV24]] | * Supported color formats: [[YV12]], [[YV16]], [[YV24]] | ||
+ | **AviSynth+: all [[planar]] YUV formats (8/10/12/14/16-bit, with or without alpha channel) are supported. | ||
<br> | <br> | ||
* [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2019 Redistributable Package (x86 / x64)] | * [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2019 Redistributable Package (x86 / x64)] | ||
− | :<span style="color:red">***</span> <tt>vc_redist.x86.exe</tt> is required for <tt> | + | :<span style="color:red">***</span> <tt>vc_redist.x86.exe</tt> is required for <tt>SmoothUV2-x86</tt> |
− | :<span style="color:red">***</span> <tt>vc_redist.x64.exe</tt> is required for <tt> | + | :<span style="color:red">***</span> <tt>vc_redist.x64.exe</tt> is required for <tt>SmoothUV2-x64</tt> |
<br> | <br> | ||
== [[Script variables|Syntax and Parameters]] == | == [[Script variables|Syntax and Parameters]] == | ||
− | :{{Template:FuncDef| | + | |
+ | ===SSHiQ2=== | ||
+ | A general purpose spatial denoiser. SSHiQ has independent parameters for both luma and chroma, meaning that you can process the luma only and leave the chroma intact or vice versa. | ||
+ | <br> | ||
+ | <br> | ||
+ | :{{Template:FuncDef|SSHiQ2 (clip, int "rY", int "rC", int "tY", int "tC", int "strY", int "strC", bool "HQY", bool "HQC", int "interlaced", int "opt", int "dither")}} | ||
+ | <br> | ||
+ | ::{{Par2| |clip| }} | ||
+ | ::: A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes. | ||
+ | <br> | ||
+ | ::{{Par2|rY|int|5}} | ||
+ | ::{{Par2|rC|int|3}} | ||
+ | :::Radius respectively for luma and chroma planes. | ||
+ | :::Controls how far from the current pixel neighbors are used. | ||
+ | :::rY Must be between 1 and 7. | ||
+ | :::rC Must be between 1 and 7 for 4:2:0 subsampling and between 1 and 3 for 4:2:2/4:4:4 subsampling. | ||
+ | :::Larger values smooth more. | ||
+ | <br> | ||
+ | ::{{Par2|tY|int|20}} | ||
+ | ::{{Par2|tC|int|30}} | ||
+ | :::Threshold respectively for luma and chroma planes. | ||
+ | :::Must be between 0 and 450. | ||
+ | :::Set to 0 for copying the plane. | ||
+ | :::Larger values smooth more. | ||
+ | <br> | ||
+ | ::{{Par2|strY|int|240}} | ||
+ | ::{{Par2|strC|int|strY}} | ||
+ | :::Strength respectively for luma and chroma planes. | ||
+ | :::It is only used for HiQ mode and it controls how much of the smoothed version should be used at best for calculating the new pixel. | ||
+ | :::Must be between 0 and 255. | ||
+ | <br> | ||
+ | ::{{Par2|HQY|bool|true}} | ||
+ | ::{{Par2|HQC|bool|true}} | ||
+ | :::Enables HiQ mode. | ||
+ | :::Edge processing strength gets automatically reduced. | ||
+ | <br> | ||
+ | ::{{Par2|interlaced|int|-1}} | ||
+ | :::Whether the frame is interlaced. | ||
+ | :::-1 : If frame properties are supported and frame property "_FieldBased" exists - "_FieldBased" value is used. | ||
+ | :::If frame properties aren't supported or there is no property "_FieldBased" - 0. | ||
+ | :::0 : Progressive frame. | ||
+ | :::1 : Interlaced frame. | ||
+ | <br> | ||
+ | ::{{Par2|opt|int|-1}} | ||
+ | :::Sets which cpu optimizations to use. | ||
+ | :::*-1 : Auto-detect. | ||
+ | :::*0 : Use C++ code. | ||
+ | :::*1 : Use SSE2 code. | ||
+ | :::*2 : Use SSSE3 code. | ||
+ | :::*3 : Use SSE4.1 code. | ||
+ | :::*4 : Use AVX2 code. | ||
+ | :::*5 : Use AVX-512 code. | ||
+ | <br> | ||
+ | ::{{Par2|dither|int|-1}} | ||
+ | :::How to convert the internal 16-bit calculation to the clip depth (when clip depth < 16-bit). | ||
+ | :::*-1 : Rounding. | ||
+ | :::*0 : Ordered dither. | ||
+ | :::*1 : Error diffusion (Floyd-Steinberg). | ||
+ | <br> | ||
+ | |||
+ | ===SmoothUV2=== | ||
+ | This filter performs structure-preserving smoothing (blurring) on the U/V (chrominance or colour) information of the image, leaving Y (luminance) intact. It was created in an attempt to reduce the appearance of "rainbows" (cross-colour artifacts) near lines in some cel animation. | ||
+ | <br> | ||
+ | <br> | ||
+ | :{{Template:FuncDef|SmoothUV2 (clip, int "radius", int "threshold", int "interlaced", int "opt", int "dither")}} | ||
<br> | <br> | ||
::{{Par2| |clip| }} | ::{{Par2| |clip| }} | ||
− | ::: A clip to process. It | + | ::: A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes. |
<br> | <br> | ||
::{{Par2|radius|int|3}} | ::{{Par2|radius|int|3}} | ||
− | ::: | + | :::Must be between 1 and 7 for 4:2:0 subsampling and between 1 and 3 for 4:2:2/4:4:4 subsampling. |
:::Larger values smooth more. | :::Larger values smooth more. | ||
− | |||
<br> | <br> | ||
::{{Par2|threshold|int|270}} | ::{{Par2|threshold|int|270}} | ||
:::Threshold. Must be between 0 and 450. | :::Threshold. Must be between 0 and 450. | ||
:::Larger values smooth more. | :::Larger values smooth more. | ||
− | |||
<br> | <br> | ||
− | ::{{Par2|interlaced| | + | ::{{Par2|interlaced|int|-1}} |
− | ::: | + | :::Whether the frame is interlaced. |
− | ::: | + | :::-1 : If frame properties are supported and frame property "_FieldBased" exists - "_FieldBased" value is used. |
− | ::: | + | :::If frame properties aren't supported or there is no property "_FieldBased" - 0. |
+ | :::0 : Progressive frame. | ||
+ | :::1 : Interlaced frame. | ||
+ | <br> | ||
+ | ::{{Par2|opt|int|-1}} | ||
+ | :::Sets which cpu optimizations to use. | ||
+ | :::*-1 : Auto-detect. | ||
+ | :::*0 : Use C++ code. | ||
+ | :::*1 : Use SSE2 code. | ||
+ | :::*2 : Use SSSE3 code. | ||
+ | :::*3 : Use SSE4.1 code. | ||
+ | :::*4 : Use AVX2 code. | ||
+ | :::*5 : Use AVX-512 code. | ||
+ | <br> | ||
+ | ::{{Par2|dither|int|-1}} | ||
+ | :::How to convert the internal 16-bit calculation to the clip depth (when clip depth < 16-bit). | ||
+ | :::*-1 : Rounding. | ||
+ | :::*0 : Ordered dither. | ||
+ | :::*1 : Error diffusion (Floyd-Steinberg). | ||
<br> | <br> | ||
== Examples == | == Examples == | ||
− | + | SSHiQ2 with default settings: | |
+ | [[AviSource]]("Blah.avi") | ||
+ | SSSHiQ2(rY=5, rC=3, tY=20, tC=30, strY=240, strC=240, HQY=true, HQC=true, interlaced=-1, opt=-1, dither=-1) | ||
+ | |||
+ | SmoothUV2 with default settings: | ||
[[AviSource]]("Blah.avi") | [[AviSource]]("Blah.avi") | ||
− | + | SmoothUV2(radius=3, threshold=270, interlaced=-1, opt=-1, dither=-1) | |
<br> | <br> | ||
== Changelog == | == Changelog == | ||
Version Date Changes<br> | Version Date Changes<br> | ||
+ | v4.4.1 2022/06/12 - Fixed a left shift of pixel count. (dubhater)<br> | ||
+ | v4.4.0 2021/08/10 - Added AVX2 and AVX512 code.<br> | ||
+ | v4.3.0 2021/07/04 - Added SSE2 code. | ||
+ | - Parameter str replaced by strY and strC.<br> | ||
+ | v4.2.1 2021/06/29 - Improved speed for opt=0.<br> | ||
+ | v4.2.0 2021/06/24 - Added C++ code. | ||
+ | - Added parameters opt and dither. | ||
+ | - Changed internal calculation to 16-bit. | ||
+ | - Dropped support for AviSynth 2.x.<br> | ||
+ | v4.1.0 2021/06/08 - SmoothUV2 threshold changed back to 0..450 range. | ||
+ | - A bit improved calculation for 8-bit. | ||
+ | - Added SSHiQ2 function: updated version of SSHiQ from SmoothUV v1.4.0: | ||
+ | * replaced MMX asm code with SSE4.1 intrinsics; | ||
+ | * fixed planes shift; | ||
+ | * added support for 10..16-bit; | ||
+ | * added support for 422/444 chroma subsampling; | ||
+ | * more precise 8-bit calculation.<br> | ||
+ | v4.0.0 2021/04/29 - Function name changed to SmoothUV2. | ||
+ | - Fixed horizontal planes shift. | ||
+ | - Fixed vertical planes shift for interlaced frames. | ||
+ | - Fixed output for 422/444 subsampling. | ||
+ | - Additional limit radius for 422/444.<br> | ||
+ | v3.0.1 2021/04/27 - Another attempt to fix last columns processing. | ||
+ | - Removed redundant interlaced value 2.<br> | ||
+ | v3.0.0 2021/04/25 - Fixed not processed edges. | ||
+ | - Added support for 10..16-bit. | ||
+ | - Set MT mode: [[MT_NICE_FILTER]]. | ||
+ | - Changed the range of parameter threshold from 0..450 to 0..255. | ||
+ | - Changed the type of parameter interlaced from bool to int. | ||
+ | - Changed the minimum CPU instructions support from SSE2 to SSE4.1. | ||
+ | - Added Linux building option.<br> | ||
v2.1.1 2020/06/03 - Fixed memory misalignment for AviSynth 2.6. | v2.1.1 2020/06/03 - Fixed memory misalignment for AviSynth 2.6. | ||
− | - Fixed processing when interlaced and h % 2.< | + | - Fixed processing when interlaced and h % 2.<br> |
v2.1.0 2020/05/17 - Move project to GitHub | v2.1.0 2020/05/17 - Move project to GitHub | ||
- Update to AviSynth+'s v8 interface | - Update to AviSynth+'s v8 interface |
Latest revision as of 18:45, 17 May 2023
Abstract | |
---|---|
Author | dubhater , Asd-g |
Version | v4.4.1 |
Download | SmoothUV2 |
Category | Spatial Denoisers |
License | GPLv2 |
Discussion |
Contents |
[edit] Description
SmoothUV2 is a modern replacement for the old SmoothUV plugin. It includes two filters:
Key differences to the original SmoothUV:
- Filters renamed to SSHiQ2 and SmoothUV2.
-
"fields"
parameter renamed to"interlaced"
and changed from a boolean to an integer. - Additional colorspace support, including HBD.
- x64 bit version.
- Version 4.2.0; dropped support for AviSynth 2.6.
[edit] Requirements
- [x86]: AviSynth+
- [x64]: AviSynth+
- Supported color formats: YV12, YV16, YV24
- AviSynth+: all planar YUV formats (8/10/12/14/16-bit, with or without alpha channel) are supported.
- *** vc_redist.x86.exe is required for SmoothUV2-x86
- *** vc_redist.x64.exe is required for SmoothUV2-x64
[edit] Syntax and Parameters
[edit] SSHiQ2
A general purpose spatial denoiser. SSHiQ has independent parameters for both luma and chroma, meaning that you can process the luma only and leave the chroma intact or vice versa.
- SSHiQ2 (clip, int "rY", int "rC", int "tY", int "tC", int "strY", int "strC", bool "HQY", bool "HQC", int "interlaced", int "opt", int "dither")
- clip =
- A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes.
- clip =
- int rY = 5
- int rC = 3
- Radius respectively for luma and chroma planes.
- Controls how far from the current pixel neighbors are used.
- rY Must be between 1 and 7.
- rC Must be between 1 and 7 for 4:2:0 subsampling and between 1 and 3 for 4:2:2/4:4:4 subsampling.
- Larger values smooth more.
- int rY = 5
- int tY = 20
- int tC = 30
- Threshold respectively for luma and chroma planes.
- Must be between 0 and 450.
- Set to 0 for copying the plane.
- Larger values smooth more.
- int tY = 20
- int strY = 240
- int strC = strY
- Strength respectively for luma and chroma planes.
- It is only used for HiQ mode and it controls how much of the smoothed version should be used at best for calculating the new pixel.
- Must be between 0 and 255.
- int strY = 240
- bool HQY = true
- bool HQC = true
- Enables HiQ mode.
- Edge processing strength gets automatically reduced.
- bool HQY = true
- int interlaced = -1
- Whether the frame is interlaced.
- -1 : If frame properties are supported and frame property "_FieldBased" exists - "_FieldBased" value is used.
- If frame properties aren't supported or there is no property "_FieldBased" - 0.
- 0 : Progressive frame.
- 1 : Interlaced frame.
- int interlaced = -1
- int opt = -1
- Sets which cpu optimizations to use.
- -1 : Auto-detect.
- 0 : Use C++ code.
- 1 : Use SSE2 code.
- 2 : Use SSSE3 code.
- 3 : Use SSE4.1 code.
- 4 : Use AVX2 code.
- 5 : Use AVX-512 code.
- Sets which cpu optimizations to use.
- int opt = -1
- int dither = -1
- How to convert the internal 16-bit calculation to the clip depth (when clip depth < 16-bit).
- -1 : Rounding.
- 0 : Ordered dither.
- 1 : Error diffusion (Floyd-Steinberg).
- How to convert the internal 16-bit calculation to the clip depth (when clip depth < 16-bit).
- int dither = -1
[edit] SmoothUV2
This filter performs structure-preserving smoothing (blurring) on the U/V (chrominance or colour) information of the image, leaving Y (luminance) intact. It was created in an attempt to reduce the appearance of "rainbows" (cross-colour artifacts) near lines in some cel animation.
- SmoothUV2 (clip, int "radius", int "threshold", int "interlaced", int "opt", int "dither")
- clip =
- A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes.
- clip =
- int radius = 3
- Must be between 1 and 7 for 4:2:0 subsampling and between 1 and 3 for 4:2:2/4:4:4 subsampling.
- Larger values smooth more.
- int radius = 3
- int threshold = 270
- Threshold. Must be between 0 and 450.
- Larger values smooth more.
- int threshold = 270
- int interlaced = -1
- Whether the frame is interlaced.
- -1 : If frame properties are supported and frame property "_FieldBased" exists - "_FieldBased" value is used.
- If frame properties aren't supported or there is no property "_FieldBased" - 0.
- 0 : Progressive frame.
- 1 : Interlaced frame.
- int interlaced = -1
- int opt = -1
- Sets which cpu optimizations to use.
- -1 : Auto-detect.
- 0 : Use C++ code.
- 1 : Use SSE2 code.
- 2 : Use SSSE3 code.
- 3 : Use SSE4.1 code.
- 4 : Use AVX2 code.
- 5 : Use AVX-512 code.
- Sets which cpu optimizations to use.
- int opt = -1
- int dither = -1
- How to convert the internal 16-bit calculation to the clip depth (when clip depth < 16-bit).
- -1 : Rounding.
- 0 : Ordered dither.
- 1 : Error diffusion (Floyd-Steinberg).
- How to convert the internal 16-bit calculation to the clip depth (when clip depth < 16-bit).
- int dither = -1
[edit] Examples
SSHiQ2 with default settings:
AviSource("Blah.avi") SSSHiQ2(rY=5, rC=3, tY=20, tC=30, strY=240, strC=240, HQY=true, HQC=true, interlaced=-1, opt=-1, dither=-1)
SmoothUV2 with default settings:
AviSource("Blah.avi") SmoothUV2(radius=3, threshold=270, interlaced=-1, opt=-1, dither=-1)
[edit] Changelog
Version Date Changes
v4.4.1 2022/06/12 - Fixed a left shift of pixel count. (dubhater)
v4.4.0 2021/08/10 - Added AVX2 and AVX512 code.
v4.3.0 2021/07/04 - Added SSE2 code. - Parameter str replaced by strY and strC.
v4.2.1 2021/06/29 - Improved speed for opt=0.
v4.2.0 2021/06/24 - Added C++ code. - Added parameters opt and dither. - Changed internal calculation to 16-bit. - Dropped support for AviSynth 2.x.
v4.1.0 2021/06/08 - SmoothUV2 threshold changed back to 0..450 range. - A bit improved calculation for 8-bit. - Added SSHiQ2 function: updated version of SSHiQ from SmoothUV v1.4.0: * replaced MMX asm code with SSE4.1 intrinsics; * fixed planes shift; * added support for 10..16-bit; * added support for 422/444 chroma subsampling; * more precise 8-bit calculation.
v4.0.0 2021/04/29 - Function name changed to SmoothUV2. - Fixed horizontal planes shift. - Fixed vertical planes shift for interlaced frames. - Fixed output for 422/444 subsampling. - Additional limit radius for 422/444.
v3.0.1 2021/04/27 - Another attempt to fix last columns processing. - Removed redundant interlaced value 2.
v3.0.0 2021/04/25 - Fixed not processed edges. - Added support for 10..16-bit. - Set MT mode: MT_NICE_FILTER. - Changed the range of parameter threshold from 0..450 to 0..255. - Changed the type of parameter interlaced from bool to int. - Changed the minimum CPU instructions support from SSE2 to SSE4.1. - Added Linux building option.
v2.1.1 2020/06/03 - Fixed memory misalignment for AviSynth 2.6. - Fixed processing when interlaced and h % 2.
v2.1.0 2020/05/17 - Move project to GitHub - Update to AviSynth+'s v8 interface - Rename files to SmoothUV2
2019/04/02 - Backport SmoothUV from VapourSynth port by Dubhater - Add YV16 and YV24 support - x64 version - Compiled with Microsoft Visual Studio C++ 2019 - Author: Asd
[edit] External Links
- GitHub - Source code repository.
Back to External Filters ←