Scintilla's Guide to AVISynth Postprocessing Filters: Dealing with Dot Crawl
Checkmate -
DeDot -
LUTDeCrawl -
TComb
(
Home -
Spatial Smoothers - Temporal Smoothers -
Spatio-Temporal Smoothers -
Sharpeners - Dealing with Rainbows
)
Intro
Man, kids these days don't know how good they have it, what with their component cables and their all-digital
connections over HDMI... back in MY day, we had to watch our cassette tapes and DVDs over COMPOSITE cables --
which meant sending analog data for the entire video stream over one conductor! And we LIKED it
that way!
... Oh, who am I kidding? Compared to today's technologies, it sucked. Especially because it was prone to
crosstalk artifacts: that is, dot crawl (in the luma) and rainbows (in the chroma). Sadly, some animé
series (mostly older ones) have been transferred to DVD in such a way that these wonderful artifacts were
introduced along the way and hardcoded into the video stream, so that you can't get rid of them on playback
no matter how good your cables are. To make it even more annoying, even though we have AVISynth filters for
dealing with these problems, they usually have to be applied BEFORE any inverse telecine (IVTC) operations in
order to be effective. Those of you who edit directly with scripts will appreciate what a problem that is.
I'm sure you've all seen dot crawl at some point in your lives; for those unfamiliar with the term, it looks
like this. It only shows up in the luma (Y) plane and consists of a
checkerboard pattern that typically flickers back and forth every frame. Sometimes it may not be noticeable
when you're just playing a DVD, but then you'll see it when you stop on a still frame. Thankfully, most modern
animé releases do not have this problem; but if your source does, then this is the page for you.
I'm only going to bother with one comparison screenshot for this entire page, and I'm going to put it right
up front, because all of these filters should have the same effect when things go right. It's from the opening
sequence for X, which oddly enough was plagued with dot crawl despite the actual episodes themselves being
pretty clean (hover mouse over image to see filtered version):
Checkmate
mf's solution, coded by prunedtree.
Type: Plugin
Found in file: Checkmate.dll
Author: mf and prunedtree
Homepage:
http://mf.creations.nl/avs/filters/
Colorspaces: YV12 only
Interlacing: Usually interlaced only; see usage notes
Speed: Average to kind of slow, depending on the scene
Defaults: Checkmate(thr=???, max=???, tthr2=???)
Parameters:
- thr (any nonnegative int) controls the spatial filter; higher values will (AFAICT) blend more.
- max (any positive int): actually, mf doesn't remember what this does. It probably controls the
maximum amount by which a pixel's value may change, or something similar. In any case, increasing it will
strengthen the filtering.
- tthr2 (any nonnegative int) controls the temporal blending; higher values will blend more.
Setting this to 0 disables the temporal blending entirely.
Usage notes:
- Usually, dot crawl removal filters should be called BEFORE any inverse telecine (IVTC) operations.
Try it this way first, and if every other frame or so still contains the dots, then try it after IVTC.
- Checkmate will NOT give you any warnings if you feed it video in anything other than the YV12 colorspace,
and unexpected behaviour will result if you try. Thankfully, DVD video served by MPEG2Source() is virtually
always YV12 anyway (unless you specify upconv=true), so this should not be an issue.
According to mf, this filter "contains a robust spatial convolution" and "contains temporal blending that's
a bit more prone to artifacts. The filters are applied using fuzzy logic soft-thresholding."
In my experience, it seems to work well enough at the default settings. It works best when the
objects that have
dot crawl on them are not moving, but it still cleans up a fair deal on moving edges as well. I have not
noticed significant problems with artifacts, but the author warns that it WILL
generate artifacts at default settings. Setting tthr2=0 generally prevents artifacting; mf suggests
doing this only for the frames containing artifacts.
Back to top
DeDot
thejam79's solution. Been around since the days of AVISynth 2.0. Also capable of derainbowing.
Type: Plugin
Found in file: De.dll
Author: thejam79; AVISynth 2.5 port and YV12 support by Minamina
Homepage:
http://nullinfo.s21.xrea.com/#DeDot_YV12; English wiki page here:
http://niiyan.net/?DeDot
Colorspaces: YUY2 or YV12
Interlacing: Usually interlaced only; see usage notes
Speed: Blazingly FAST!!
Defaults: DeDot(luma2d=20, lumaT=20, chromaT1=15, chromaT2=5)
Recommended (if using only for dot crawl):
DeDot(luma2d=20, lumaT=20, chromaT1=0, chromaT2=255)
Parameters:
- luma2d (0 to 255) is the spatial threshold for the luma; what I believe this means is that this is
the minimum difference between a pixel and its spatial neighbours for the pixel to be targeted. Lower values
will detect more pixels as dot crawl, but may cause artifacts.
- lumaT (0 to 255) is the tolerance for temporal changes in the luma; I believe this refers to how
close a pixel's two temporal neighbours can be to each other for the pixel to be targeted.
Higher values will detect more pixels as dot crawl (but may cause artifacts).
- chromaT1 and chromaT2 (0 to 255) have to do with rainbowing, not dot crawl, and therefore
will not be discussed on this page. If you intend to use DeDot to remove only dot crawl, then keep these at
their recommended values (chromaT1=0, chromaT2=255).
Usage notes:
- Usually, dot crawl removal filters should be called BEFORE any inverse telecine (IVTC) operations.
Try it this way first, and if every other frame or so still contains the dots, then try it after IVTC.
DeDot has been around a long time and still remains quite a capable dot crawl removal filter; I haven't seen
an alternative yet that can match its blazing speed. Even better, it can be used to remove both dot crawl
AND rainbows simultaneously if desired (see the derainbowing page for more info). However, I cannot get it
to touch dot crawl on moving targets, and there's no explanation of its design principle anywhere.
Back to top
LUTDeCrawl
My solution. No spatial component.
Type: Script function
Requires: MT_MaskTools (aka MaskTools v2.0)
Author: Scintilla
Homepage:
http://www.aquilinestudios.org/scripts/
Colorspaces: YV12 only
Interlacing: Usually interlaced only; see usage notes
Speed: Average to fast, depending on the scene (because of scene change detection); even faster if
usemaxdiff=false
Defaults: LUTDeCrawl(ythresh=10, cthresh=10, maxdiff=50, scnchg=25,
usemaxdiff=true, mask=false)
Parameters:
- ythresh (0-255) determines how close the luma values of each pixel's two temporal neighbours have
to be to each other for the pixel to be targeted. Higher values will detect more pixels as dot crawl,
but may cause artifacts. I don't recommend higher than 20 or so.
- cthresh (0-255) determines how close the chroma values of each pixel's two temporal
neighbours have to be to each other for the pixel to be targeted. Just as with ythresh.
- maxdiff (0-255) is the maximum difference allowed between the luma values of a pixel and each of its
two temporal neighbours (so, the upper limit to what fluctuations are considered dot crawl). This is meant
as an artifact-reducing measure; lower values will reduce artifacts but may cause the filter to miss some
dot crawl. Obviously, this should never be lower than ythresh. If usemaxdiff=false, then this
parameter is ignored.
- scnchg (0-255) is the scene change detection threshold; if the total luma difference between a frame
and either of its temporal neighbours is greater than this value, then the frame will not be processed at all.
(This is why the filter works very fast in high-motion clips: it doesn't take much processing to pass a frame
through unchanged.)
- usemaxdiff (true/false) determines whether or not to cap luma fluctuations at maxdiff.
Turning this off is not recommended, as it may introduce artifacts; but on the other hand, it produces a
speed boost of about 30%. Test on your particular source; maybe you can get away with it.
- mask (true/false) -- When this is set true, the function will return the mask instead of the image:
white pixels are targeted for correction, black pixels are not. Use this to find optimal values for the other
parameters (but be aware that the scene change threshold, scnchg, is NOT reflected in the mask).
Usage notes:
- Usually, dot crawl removal filters should be called BEFORE any inverse telecine (IVTC) operations.
Try it this way first, and if every other frame or so still contains the dots, then try it after IVTC.
- This filter is more prone to artifacts at default settings than some others and may require tweaking.
In particular, the parameter scnchg is your friend -- use it!
LUTDeCrawl came about in 2008 when I suddenly figured out how to properly apply my theory of operation for
LUTDeRainbow to the similar problem of dot crawl (I had originally tried to
tackle the problem immediately after completing LUTDeRainbow, but somehow those original attempts failed
miserably). It is a purely temporal filter; the idea is that if a pixel's two temporal neighbours are
very close to each other in both luma and chroma, then the pixel is likely to be dot crawl and may be replaced
with the average of its own luma and the average luma of its temporal neighbours. (And if the pixel is not
dot crawl, but the SAME as its neighbours instead of fluctuating, then we can still do this averaging and it'll
still look the same, so no harm done there.)
But, since there are no spatial considerations in this algorithm, this filter is more prone to
artifacts than some others... so I added in the capping of fluctuations and the scene change detection
in order to cut down on artifacts. However, that still doesn't change the fact that this filter will usually
miss dot crawl on moving targets (like DeDot).
Back to top
TComb
Tritical's solution. Also capable of derainbowing. Seems to have no spatial component.
Type: Plugin
Found in file: TComb.dll
Author: Tritical
Homepage:
http://bengal.missouri.edu/~kes25c/
Colorspaces: YUY2 or YV12
Interlacing: Usually interlaced only; see usage notes
Speed: Below average (when mode=0)
Defaults:
TComb(mode=2,fthreshl=4,fthreshc=5,othreshl=5,othreshc=6,map=false,scthresh=12.0)
Recommended (if using only for dot crawl):
TComb(mode=0) (see usage notes for tweaking procedure)
Parameters:
- mode (0 to 2) determines whether TComb should be used to remove dot crawl, rainbows, or both.
0 filters for dot crawl only, 1 filters for rainbows only, and 2 filters for both.
- fthreshl and fthreshc (0 to 255) are the filtered pixel correlation thresholds for luma and
for chroma, respectively. What I believe this means is that if all pixels within the filtering window are
within these values of each other after they have been filtered, then they are considered correlated.
Only fthreshl matters for dot crawl. Higher values will detect more pixels as dot crawl,
but may cause artifacts.
- othreshl and othreshc (0 to 255) are the original pixel correlation thresholds for luma and
for chroma, respectively. If the original pixels in every other frame differ by less than these values,
then they are considered correlated. Only othreshl matters for dot crawl. Higher values will detect
more pixels as dot crawl, but may cause artifacts.
- map (true/false) -- When this is set true, the filter will return a map showing which pixels are
being replaced with filtered values. A value of 0 in the given plane (Y/U/V) means the pixel is not being
filtered in that plane; anything else means it is. (So, pixels that are not being filtered for dot crawl
or rainbows will show up as dark green.) For details, see the documentation.
- scthresh (float 0.0-100.0) is the scene change detection threshold, as a percentage of maximum change
on the luma plane. Higher values will allow filtering on more frames, but may cause artifacts.
Based on the documentation, I can only assume that (just as with LUTDeCrawl) the scene change detection is
not figured into the map that is displayed when map=true.
Usage notes:
- Usually, dot crawl removal filters should be called BEFORE any inverse telecine (IVTC) operations.
Try it this way first, and if every other frame or so still contains the dots, then try it after IVTC.
- Tritical includes in the documentation a handy guide to tweaking TComb for dot crawl removal, which I
quote in its entirety here:
"To find good values for fthreshL/othreshL, start with the following line:
tcomb(mode=0,fthreshL=255,othreshL=255)
Now, keep othreshL at 255 but set fthreshL down to 1. Keep increasing fthreshL
in steps of 1 to 2 until you find the point at which all dot crawl is removed.
Remember that value. Next, set fthreshL back to 255, and set othreshL to 1.
Now, increase othreshL in steps of 1 or 2 until you find the point at which all
dot crawl is removed. You've now got values for fthreshL/othreshL."
Like Checkmate, TComb is a relatively recent plugin that works at below-average speeds (however, TComb's
kinda-slowness is more consistent, whereas Checkmate's varies depending on the scene). Advantages of TComb
include the tweakability (of course, almost anything would be more tweakable than Checkmate) and
the fact that it can also be used for rainbows; disadvantages include the fact that it doesn't do much on
moving targets.
Back to top
Home -
Spatial Smoothers - Temporal Smoothers -
Spatio-Temporal Smoothers - Sharpeners -
Dealing with Rainbows
Last updated on 6/23/09
Questions? Comments? Concerns? Contact Scintilla
Fight Spam! Click Here!