SmoothUV2

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Changelog)
(SmoothUV2 v4.1.0 update)
Line 1: Line 1:
{{FilterCat4|External_filters|Plugins|Plugins_x64|Denoisers|Spatial_denoisers}}
+
{{FilterCat6|External_filters|Plugins|Plugins_x64|Denoisers|Spatial_denoisers|Deep_color_tools}}
 
{{Filter3
 
{{Filter3
| [https://github.com/dubhater dubhater], [https://github.com/Asd-g asd-g]
+
|1=[https://github.com/dubhater dubhater], [https://github.com/Asd-g asd-g]
| v2.1.1
+
|2=v4.1.0
| [https://github.com/Asd-g/AviSynth-SmoothUV2/releases SmoothUV2-2.1.1.7z]
+
|3=[https://github.com/Asd-g/AviSynth-SmoothUV2/releases SmoothUV2-2.1.1.7z]
| 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 spatial derainbow filter. 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]] 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.
This version is a port of the VapourSynth version, changes to the original [[SmoothUV]]:
+
<br>
* Only <code>SmoothUV()</code> implemented
+
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.
 
<br>
 
<br>
  
Line 23: Line 24:
 
* [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>DeDot-x86</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>DeDot-x64</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|SmoothUV (''clip'', ''int'' "radius", ''int'' "threshold", ''bool'' "interlaced")}}
+
 
 +
===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, bool "HQY", bool "HQC", int "interlaced")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
::: A clip to process. It must have constant format and it must be 8 bit YUV.
+
::: 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.
 +
:::Default: rY = 5; rC = 3.
 +
<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.
 +
:::Default: tY = 20; tC =30.
 +
<br>
 +
::{{Par2|str|int|240}}
 +
:::Strength 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.
 +
:::Default: 240.
 +
<br>
 +
::{{Par2|HQY|bool|true}}
 +
::{{Par2|HQC|bool|true}}
 +
:::Enables HiQ mode.
 +
:::Edge processing strength gets automatically reduced.
 +
:::Default: HQY = HQC = true.
 +
<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.
 +
:::Default: -1.
 +
<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")}}
 +
<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>
 
<br>
 
::{{Par2|radius|int|3}}
 
::{{Par2|radius|int|3}}
Line 44: Line 97:
 
:::Default: 270
 
:::Default: 270
 
<br>
 
<br>
::{{Par2|interlaced|bool|}}
+
::{{Par2|interlaced|int|-1}}
:::Determine if the frame is interlaced.
+
:::Whether the frame is interlaced.
:::Default: auto detect based on [[Clip_properties#Video:_Interlacing|IsFiledBased()]].
+
:::-1: If frame properties are supported and frame property "_FieldBased" exists - "_FieldBased" value is used.
:::False is for [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|progressive]] input, true is for [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|interlaced]] input.
+
:::If frame properties aren't supported or there is no property "_FieldBased" - 0.
 +
:::0: Progressive frame.
 +
:::1: Interlaced frame.
 +
:::Default: -1.
 
<br>
 
<br>
 
== Examples ==
 
== Examples ==
SmoothUV with default settings:
+
SSHiQ2 with default settings:
 +
[[AviSource]]("Blah.avi")
 +
SSSHiQ2(rY=5, rC=3, tY=20, tC=30, str=240, HQY=true, HQC=true, interlaced=-1)
 +
 
 +
SmoothUV2 with default settings:
 
  [[AviSource]]("Blah.avi")
 
  [[AviSource]]("Blah.avi")
  SmoothUV(radius=3, threshold=270)
+
  SmoothUV2(radius=3, threshold=270, interlaced=-1)
 
<br>
 
<br>
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<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.<br>
 
                               - Fixed processing when interlaced and h % 2.<br>

Revision as of 01:34, 16 June 2021

Abstract
Author dubhater, asd-g
Version v4.1.0
Download SmoothUV2-2.1.1.7z
Category Spatial Denoisers
License GPLv2
Discussion

Contents

Description

SmoothUV2 is a modern replacement for the old SmoothUV plugin. It includes two filters:

  • SSHiQ2 - a general purpose spatial denoising filter.
  • SmoothUV2 - a spatial derainbow filter.


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.


Requirements


*** vc_redist.x86.exe is required for SmoothUV2-x86
*** vc_redist.x64.exe is required for SmoothUV2-x64


Syntax and Parameters

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, bool "HQY", bool "HQC", int "interlaced")


clip   =
A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes.


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.
Default: rY = 5; rC = 3.


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.
Default: tY = 20; tC =30.


int  str = 240
Strength 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.
Default: 240.


bool  HQY = true
bool  HQC = true
Enables HiQ mode.
Edge processing strength gets automatically reduced.
Default: HQY = HQC = 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.
Default: -1.


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")


clip   =
A clip to process. It must be in YUV 8..16-bit planar format and must have at least three planes.


int  radius = 3
Radius. Must be between 1 and 7.
Larger values smooth more.
Default: 3


int  threshold = 270
Threshold. Must be between 0 and 450.
Larger values smooth more.
Default: 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.
Default: -1.


Examples

SSHiQ2 with default settings:

AviSource("Blah.avi")
SSSHiQ2(rY=5, rC=3, tY=20, tC=30, str=240, HQY=true, HQC=true, interlaced=-1)

SmoothUV2 with default settings:

AviSource("Blah.avi")
SmoothUV2(radius=3, threshold=270, interlaced=-1)


Changelog

Version      Date            Changes
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


External Links

  • GitHub - Source code repository.




Back to External Filters

Personal tools