DeDot

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (author)
(Update to the latest version)
 
Line 2: Line 2:
 
{{Filter3
 
{{Filter3
 
|1={{Author/thejam79}}, {{Author/minamina}}, {{Author/dubhater}}, {{Author/Asd-g}}
 
|1={{Author/thejam79}}, {{Author/minamina}}, {{Author/dubhater}}, {{Author/Asd-g}}
|2= v1.1.0
+
|2= v1.2.1
|3=[https://github.com/Asd-g/AviSynth-DeDot/releases DeDot-1.1.0.7z]
+
|3=[https://github.com/Asd-g/AviSynth-DeDot/releases DeDot]
 
|4=Rainbow & Dot Crawl Removal
 
|4=Rainbow & Dot Crawl Removal
 
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
Line 18: Line 18:
 
* [x64] [[AviSynth+]]
 
* [x64] [[AviSynth+]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]]
 +
**AviSynth+: all [[planar]] Y, YUV, formats (8/10/12/14/16-bit) 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)]
Line 24: Line 25:
 
<br>
 
<br>
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|DeDot (''clip'', ''int'' "luma2d", ''int'' "lumaT", ''int'' "chromaT1", ''int'' "chromaT2")}}
+
:{{Template:FuncDef|DeDot (''clip'', ''int'' "luma2d", ''int'' "lumaT", ''int'' "chromaT1", ''int'' "chromaT2", ''int'' "opt")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
Line 31: Line 32:
 
::{{Par2|luma2d|int|20}}
 
::{{Par2|luma2d|int|20}}
 
:::Spatial luma threshold. Must be between 0 and 510.
 
:::Spatial luma threshold. Must be between 0 and 510.
:::Lower values consider more pixels as cross-luminance.  
+
:::Lower values consider more pixels as cross-luminance.
 
:::If <code>luma_2d=510</code>, the luma is returned without any processing.
 
:::If <code>luma_2d=510</code>, the luma is returned without any processing.
 
<br>
 
<br>
Line 41: Line 42:
 
::{{Par2|chromaT1|int|15}}
 
::{{Par2|chromaT1|int|15}}
 
:::Tolerance for temporal variation in the chroma channels (U,V). Must be between 0 and 255.
 
:::Tolerance for temporal variation in the chroma channels (U,V). Must be between 0 and 255.
:::Higher values consider more pixels as cross-color.  
+
:::Higher values consider more pixels as cross-color.
 
<br>
 
<br>
 
::{{Par2|chromaT2|int|5}}
 
::{{Par2|chromaT2|int|5}}
Line 47: Line 48:
 
:::Lower values consider more pixels as cross-color.
 
:::Lower values consider more pixels as cross-color.
 
:::If <code>chroma_t2=255</code>, the chroma is returned without any processing.
 
:::If <code>chroma_t2=255</code>, the chroma is returned without any processing.
 +
<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.
 
<br>
 
<br>
  
Line 52: Line 60:
 
'''DeDot with all default values:'''
 
'''DeDot with all default values:'''
 
  MPEG2Source("DotCrawl.d2v")
 
  MPEG2Source("DotCrawl.d2v")
  DeDot(luma2d=20, lumaT=20, chromaT1=15, chromaT2=5)  
+
  DeDot(luma2d=20, lumaT=20, chromaT1=15, chromaT2=5)
 
<br>
 
<br>
 
'''Reduce dot crawl only:'''
 
'''Reduce dot crawl only:'''
 
*Adjust luma2d and lumaT accordingly.
 
*Adjust luma2d and lumaT accordingly.
 
  MPEG2Source("DotCrawl.d2v")
 
  MPEG2Source("DotCrawl.d2v")
  DeDot(luma2d=20, lumaT=20, chromaT1=0, chromaT2=255)  
+
  DeDot(luma2d=20, lumaT=20, chromaT1=0, chromaT2=255)
 
<br>
 
<br>
 
'''Reduce rainbows only:'''<br>
 
'''Reduce rainbows only:'''<br>
 
*Adjust chromaT1 and chromaT2 accordingly.
 
*Adjust chromaT1 and chromaT2 accordingly.
 
  MPEG2Source("Rainbows.d2v")
 
  MPEG2Source("Rainbows.d2v")
  DeDot(luma2d=510, lumaT=0, chromaT1=15, chromaT2=5)  
+
  DeDot(luma2d=510, lumaT=0, chromaT1=15, chromaT2=5)
 
<br>
 
<br>
 
== How it works ==
 
== How it works ==
Line 73: Line 81:
 
<br>
 
<br>
 
<br>
 
<br>
For filtering luma (dot crawl) it uses luma2d and lumaT...  
+
For filtering luma (dot crawl) it uses luma2d and lumaT...
 
Consider 'e' to be the current pixel and a,b,c,d,f,g,h,i to be its spatial neighbors in the current frame:
 
Consider 'e' to be the current pixel and a,b,c,d,f,g,h,i to be its spatial neighbors in the current frame:
  
 
:{| class="wikitable" style="text-align: center; width: 75px; height: 75px;"
 
:{| class="wikitable" style="text-align: center; width: 75px; height: 75px;"
 
|-
 
|-
| a  
+
| a
| b  
+
| b
 
| c
 
| c
 
|-
 
|-
 
| d
 
| d
| <span style="color:red">e</span>  
+
| <span style="color:red">e</span>
 
| f
 
| f
 
|-
 
|-
| g  
+
| g
| h
+
| h
 
| i
 
| i
 
|}
 
|}
Line 100: Line 108:
  
 
:{| class="wikitable" style="text-align: center; width: 100px; height: 25px;"
 
:{| class="wikitable" style="text-align: center; width: 100px; height: 25px;"
| a  
+
| a
| b  
+
| b
| <span style="color:red">c</span>  
+
| <span style="color:red">c</span>
 
| d
 
| d
 
| e
 
| e
Line 118: Line 126:
  
 
:{| class="wikitable" style="text-align: center; width: 100px; height: 25px;"
 
:{| class="wikitable" style="text-align: center; width: 100px; height: 25px;"
| a  
+
| a
| b  
+
| b
| <span style="color:red">c</span>  
+
| <span style="color:red">c</span>
 
| d
 
| d
 
| e
 
| e
Line 138: Line 146:
  
 
== Changelog ==
 
== Changelog ==
 +
  2021/09/07 v1.2.1
 +
      - Improved luma spatial and temporal check (SIMD) resulting to a bit faster code.<br>
 +
  2021/09/05 v1.2.0
 +
      - Throw error for non-planar formats.
 +
      - Added support for 10..16-bit clips.
 +
      - Separated SSE2 code.
 +
      - Added AVX2 code.
 +
      - Added parameter <code>opt</code>.<br>
 
   2020/05/15 v1.1.0
 
   2020/05/15 v1.1.0
 
       - Move project to GitHub<br>
 
       - Move project to GitHub<br>
   2019/06/07  
+
   2019/06/07
 
       - Backport DeDot from VapourSynth port by Dubhater
 
       - Backport DeDot from VapourSynth port by Dubhater
 
       - Add Y8, YV16, YV24 and drop YUY2 support
 
       - Add Y8, YV16, YV24 and drop YUY2 support

Latest revision as of 22:31, 13 January 2022

Abstract
Author thejam79, minamina, dubhater , Asd-g
Version v1.2.1
Download DeDot
Category Rainbow & Dot Crawl Removal
License GPLv2
Discussion

Contents

[edit] Description

Spatial and temporal plugin to reduce cross-luminance (dot crawl) and cross-color (rainbows).

The luma and the chroma are filtered completely independently from each other. It doesn't filter moving objects.

[edit] Requirements


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


[edit] Syntax and Parameters

DeDot (clip, int "luma2d", int "lumaT", int "chromaT1", int "chromaT2", int "opt")


clip   =
Input clip. It must have constant format and dimensions and it must be 8 bit Gray or YUV.


int  luma2d = 20
Spatial luma threshold. Must be between 0 and 510.
Lower values consider more pixels as cross-luminance.
If luma_2d=510, the luma is returned without any processing.


int  lumaT = 20
Tolerance for temporal variation in the luma channel (Y). Must be between 0 and 255.
Higher values consider more pixels as cross-luminance.
If luma_t=0, the luma is returned without any processing.


int  chromaT1 = 15
Tolerance for temporal variation in the chroma channels (U,V). Must be between 0 and 255.
Higher values consider more pixels as cross-color.


int  chromaT2 = 5
Temporal chroma threshold. Must be between 0 and 255.
Lower values consider more pixels as cross-color.
If chroma_t2=255, the chroma is returned without any processing.


int  opt = -1
Sets which cpu optimizations to use.
-1 : Auto-detect.
0 : Use C++ code.
1 : Use SSE2 code.
2 : Use AVX2 code.


[edit] Examples

DeDot with all default values:

MPEG2Source("DotCrawl.d2v")
DeDot(luma2d=20, lumaT=20, chromaT1=15, chromaT2=5)


Reduce dot crawl only:

  • Adjust luma2d and lumaT accordingly.
MPEG2Source("DotCrawl.d2v")
DeDot(luma2d=20, lumaT=20, chromaT1=0, chromaT2=255)


Reduce rainbows only:

  • Adjust chromaT1 and chromaT2 accordingly.
MPEG2Source("Rainbows.d2v")
DeDot(luma2d=510, lumaT=0, chromaT1=15, chromaT2=5)


[edit] How it works

Written by tritical

I'll give a quick explanation of how the parameters are used in relation to pixel values (this is all taken simply from reading the source code).
Its operation is quite simple, which is why it is very fast and is able to be written completely in MMX.


For filtering luma (dot crawl) it uses luma2d and lumaT... Consider 'e' to be the current pixel and a,b,c,d,f,g,h,i to be its spatial neighbors in the current frame:

a b c
d e f
g h i

DeDot first uses the following two tests:

abs(b+h-2*e) > luma2d
abs(d+f-2*e) > luma2d

If either of those conditions is met it goes on and tests the following conditions else it drops out w/o doing any filtering on that luma pixel.
For the next tests consider pixel 'c' to be the pixel in the current frame and a,b,d,e to be its temporal neighbors in adjacent frames:

a b c d e
abs(c-a) <= lumaT
abs(c-e) <= lumaT
abs(b-d) <= lumaT

If all three of those conditions are met it decides that the pixel needs to be filtered and it either averages the current pixel 'c' with 'b' or 'd' based on whichever one is closer to the value of 'c'.


Chroma filtering (rainbow removal) works in the following way. First it tests the following conditions... Again assume 'c' is from the current frame and a,b,d,e are the temporal neighbors:

a b c d e
abs(c-a) <= chromaT1
abs(c-e) <= chromaT1
abs(b-d) <= chromaT1
abs(c-b) > chromaT2
abs(c-d) > chromaT2

If all five of those conditions are met then it does filtering on the pixel. For the filtering it either averages the current pixel 'c' with 'b' or 'd' based on whichever one is closer to the value of 'c'.

Hope that helps explain the parameters a little bit better.

[edit] Changelog

 2021/09/07 v1.2.1
     - Improved luma spatial and temporal check (SIMD) resulting to a bit faster code.
2021/09/05 v1.2.0 - Throw error for non-planar formats. - Added support for 10..16-bit clips. - Separated SSE2 code. - Added AVX2 code. - Added parameter opt.
2020/05/15 v1.1.0 - Move project to GitHub
2019/06/07 - Backport DeDot from VapourSynth port by Dubhater - Add Y8, YV16, YV24 and drop YUY2 support - x64 version - Compiled with Microsoft Visual Studio C++ 2017 - Author: Asd
2003/11/22 v0.0.02 - Fixed an issue where garbage was generated vertically when used after Crop
2003/05/18 v0.0.01: - Initial release by minamina - AviSynth 2.5 support and add YV12 colorpace - The official name of this plugin is DeDot_YV12 and is based on DeDot v0.3 by thejam79


[edit] Archived Downloads

Version Download Mirror
v0.0.02 DeDot_YV12_0002.zip DeDot_YV12_0002.zip
v0.0.01 DeDot_YV12_0001.zip DeDot_YV12_0001.zip


[edit] External Links

  • Doom9 Forum - DeDot discussion and English translation by niiyan.
  • Doom9 Forum - DeDot discussion and English translation by helix. In the last post, tritical explains how DeDot works.
  • Doom9 Forum - DeDot discussion about correct usage, English translation, and some history of DeDot by niiyan.
  • Scintilla's Guide - English documentation by Scintilla.
  • GitHub - Source code repository.
  • GitHub - Source code repository (VapourSynth version).




Back to External Filters

Personal tools