Neil Lee
1st January 2006, 05:16
VDub's Temporal smoother To Avisynth ?
I've started to ultilize MVTool's motion compensated frames,
and feed them to VirtualDub's Temporal Smoother, tiresome and
slow but the result is pretty amazing. Sorry to say, I haven't
been able to reproduce half the quality using many of avisynth's
temporal smoother.
IMHO, the reasons lie in two parts...
First, Vdub's Temporal smoother uses up to 7 frames for averaging.
it's algorithm is pretty sufficicated. Second it uses sum of RGB Dif rather
than YUV format, which i think is a much reasonable approach to
determine the threshold. Avisynth's smoothers can't seem to get enough
of a smoother result when dealing with very noisy videos, I can lower
the threshold, but noise's UV values can vary just a bit too much..
I'm very new to avisynth and just wonder if the Vdub's smoother algo
can be achieved in avisynth simply by scripting?
I dug up the algorithm posted by Vdub's author avery lee in his forum.
Maybe someone is interested..?
http://forums.virtualdub.org/index.php?act=ST&f=7&t=713&hl=&
Temporal smoother is a seven-frame centered, finite-response filter with
per-pixel adaptive weighting. For each pixel position and for each pixel in
that position in the seven-frame window, compute the 2-norm squared
absolute RGB difference from the center window pixel to
the current window pixel (d = |r|^2 + |g|^2 + |b|^2). Shift d right by
N bits (divide by 2^N) , where N is the filter power, then subtract it from
16 with clamping to zero. Compute a new vector (d, r*d, g*d, b*d).
Accumulate all such vectors for all seven frames in the window,
then divide the RGB terms by the alpha term to get noise reduced RGB for
that pixel position in the center window frame. The alpha sum will never be
zero since the center window pixel always matches itself perfectly. Finally,
cycle a new source pixel into the window -- this will be three frames behind
the currently output pixel. The output of the filter should never cycle back
into the window, or else you will have an incorrect, recursive filter.
The source is uncommented because I basically prototyped the algorithm
directly in MMX and never bothered to write a psuedocode or scalar version
.
I've started to ultilize MVTool's motion compensated frames,
and feed them to VirtualDub's Temporal Smoother, tiresome and
slow but the result is pretty amazing. Sorry to say, I haven't
been able to reproduce half the quality using many of avisynth's
temporal smoother.
IMHO, the reasons lie in two parts...
First, Vdub's Temporal smoother uses up to 7 frames for averaging.
it's algorithm is pretty sufficicated. Second it uses sum of RGB Dif rather
than YUV format, which i think is a much reasonable approach to
determine the threshold. Avisynth's smoothers can't seem to get enough
of a smoother result when dealing with very noisy videos, I can lower
the threshold, but noise's UV values can vary just a bit too much..
I'm very new to avisynth and just wonder if the Vdub's smoother algo
can be achieved in avisynth simply by scripting?
I dug up the algorithm posted by Vdub's author avery lee in his forum.
Maybe someone is interested..?
http://forums.virtualdub.org/index.php?act=ST&f=7&t=713&hl=&
Temporal smoother is a seven-frame centered, finite-response filter with
per-pixel adaptive weighting. For each pixel position and for each pixel in
that position in the seven-frame window, compute the 2-norm squared
absolute RGB difference from the center window pixel to
the current window pixel (d = |r|^2 + |g|^2 + |b|^2). Shift d right by
N bits (divide by 2^N) , where N is the filter power, then subtract it from
16 with clamping to zero. Compute a new vector (d, r*d, g*d, b*d).
Accumulate all such vectors for all seven frames in the window,
then divide the RGB terms by the alpha term to get noise reduced RGB for
that pixel position in the center window frame. The alpha sum will never be
zero since the center window pixel always matches itself perfectly. Finally,
cycle a new source pixel into the window -- this will be three frames behind
the currently output pixel. The output of the filter should never cycle back
into the window, or else you will have an incorrect, recursive filter.
The source is uncommented because I basically prototyped the algorithm
directly in MMX and never bothered to write a psuedocode or scalar version
.