Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
*Space Reserved*
Join Date: May 2006
Posts: 953
|
MVDegrain as an independent function?
Hello, I was wonderin' if MVDegrain would function properly if it was a lone filter like ttempsmooth, instead of being dependent on the built-in clp,clp x function (degrain 1, 2, 3) and it's auto interleave feature. It's one of the top temporal denoisers, but under certain circumstances, it sometimes doesn't do anything (as shown by King Didée).
Quote:
![]() So I was thinking that if we could use mvdegrain like any other filter that can be improved by motion analysis, then maybe this bug in mvdegrain would be no more. I could be totally out of the loop here though, but I think it may be worth a try.
|
|
|
|
|
|
#2 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
Note: This is completely nothing like what you said, but at least we have a standalone MVDegrain to work with.
Alright, I've made a very simple MVDegraining script that lets you just stick it into your script without fiddling around. I didn't include MVDegrain3 because it's not public yet, and the scripted MVDegrain3 doesn't do much. If there's enough demand, I'll include it. Default settings work very well and use MVDegrain1. Code:
#######################################################
# Easy MVDegrain by Sagekilla (Jan 13, 2008) #
# #
# Description of functions #
# method = MVDegrain with 1 or 2 vectors #
# thSAD = MVDegrain thSAD #
# limit = MVAnalyse limit #
# blksize = MVAnalyse block size #
# pel = MVAnalyse Subpixel accuracy #
# overlap = MVAnalyse block overlap #
# quality = Not working yet! #
#######################################################
function MVDegrain ( clip input, int "method", int "thSAD", int "blksize", int "pel", int "overlap")
{
o = input
method = default( method, 1 )
thSAD = default( thSAD, 400 )
blksize = default (blksize, 8 )
pel = default( pel, 2 )
overlap = default( overlap, 2 )
# Motion vector search
b2vec = (method==2) ?
\ o.MVAnalyse(isb=true, delta=2,pel=pel,overlap=overlap,blksize=blksize,idx=1) : BlankClip
b1vec = o.MVAnalyse(isb=true, delta=1,pel=pel,overlap=overlap,blksize=blksize,idx=1)
f1vec = o.MVAnalyse(isb=false,delta=1,pel=pel,overlap=overlap,blksize=blksize,idx=1)
f2vec = (method==2) ?
\ o.MVAnalyse(isb=false,delta=2,pel=pel,overlap=overlap,blksize=blksize,idx=1) : Blankclip
# Now we perform the actual MVDegrain.
output = (method==2) ? o.MVDegrain2(b1vec,f1vec,b2vec,f2vec,thSAD=thSAD,idx=2) :
\ o.MVDegrain1(b1vec,f1vec,thSAD=thSAD,idx=2)
return(output)
}
Last edited by Sagekilla; 14th January 2008 at 04:55. |
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
MVDegrain is a complex function, involving the base clip, motion vectors obtained by a motion search, and a SAD mask calculated from compairing [compensate(base,vectors)] with [base].
Now, how should a "standalone" version of MVDegrain look like? I don't see it ... trying to pull MVDegrain into small pieces, you'll get more or less what TTempSmooth already *is*. BTW, the fact that MVDegrain sometimes "does nothing" in certain areas is not a bug in any way. It's by design. If all compensated blocks have a high SAD, then the weights for the compensated blocks are reduced to zero, the pixels of the original block get 100% weight, which results in "no change". That's how MVDegrain works. What I showed with Scripted_MVDegrain (in the out-commented lines) was an alternative way of operation: Pre-calculate an "alternatively filtered" clip, and instead of just reducing weights for increasing SAD, assign weight to the alternative clip instead. Then again, this has rather little to do with the idea of a "standalone" MVDegrain filter.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#4 | Link |
|
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,182
|
1. Where is original quoted post by Didée? (link)
2. MVDegrain coud be function like PixieDust, but Avisynth is scripting language, not "one button" program. Of course, anybody is free to take MVTools source code and create anything from it, even MVDegrain.exe (under GPL)
|
|
|
|
|
|
#6 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
... and the script is in this post. (The "alternative clip weighting" is commented out, though.)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#7 | Link | |
|
Registered User
Join Date: Jul 2002
Posts: 587
|
Quote:
his first script of course then his scripted version both using ttempsmooth way and the alt way. alt way just is not good at all. too soft and detail lost too much. The other 2 ways flip a coin. They both did some things better and other things worse. I think Didee should try to do a version that does not use MV at all which is what I am experimenting with right now. |
|
|
|
|
|
|
#8 | Link | |
|
Registered User
Join Date: Jul 2002
Posts: 587
|
Quote:
|
|
|
|
|
|
|
#9 | Link | |
|
*Space Reserved*
Join Date: May 2006
Posts: 953
|
Quote:
Last edited by Terranigma; 15th January 2008 at 00:10. |
|
|
|
|
![]() |
|
|