View Full Version : Stabilize grain - not remove it
Ranguvar
16th July 2008, 22:35
Hello,
I'm looking for a fairly simple way to stabilize grain, meaning, prevent "dancing grain", without removing too much. This is mostly for older DVDs, and Blu-ray movies (downscaled), that will be encoded with x264 (yes, Psy RDO and VAQ).
MC_Spuds with a strength of 1 has come the closest, but still removes a lot of grain. I don't want to remove that much, since grain is important to the film's feel to me. Dancing grain, though, is perceived by my eyes as annoying artifacting, and seems to severely hurt encode quality too.
I could always remove the grain with MC_Spuds and then AddGrain(), but I'm wondering if there's a more elegant solution.
Thanks!
foxyshadis
16th July 2008, 23:51
The GrainOptimizer filter might come in handy.
Ranguvar
17th July 2008, 01:51
I recall Dark Shikari saying that it was actually pretty crappy, so I haven't tried it :p
I'll do so...
martino
17th July 2008, 02:21
I myself never really had any good experience with GrainOptimizer. What I usually do is a
before=last
ConvertToYUY2()
FaeryDust(1)
ConvertToYV12()
Repair(last,before,16)
and Dup combo. Seems to work pretty well most times, for me anyway.
Ranguvar
17th July 2008, 04:38
Well, GrainOptimizer barely touches it (grain is too heavy, I believe), and I can't get old plugins like Dust to load (LoadPluginEx cannot be loaded). Grrr. For now, I think I'll just experiment with MC_Spuds....
neuron2
17th July 2008, 05:05
Write a filter to do it. It's a small, self-contained project. You'd learn a lot by doing it.
Ranguvar
17th July 2008, 05:18
Write a filter to do it. It's a small, self-contained project. You'd learn a lot by doing it.
He he... have to admit, I didn't think of that. Good idea!
We'll see...
neuron2
17th July 2008, 05:21
We'll see...
Well, your sig says you're studying C++ and all the video theory. It's time to put it into practice, don't you think? As I said, it's a great way to really master the material.
Ranguvar
17th July 2008, 05:40
Well, your sig says you're studying C++ and all the video theory. It's time to put it into practice, don't you think? As I said, it's a great way to really master the material.
My sig over-exaggerates... I wrote that at the beginning of the summer, when I was determined to master this stuff. In other words, before I realized what a wonderful thing spare time is :p I've been meaning to edit it for some time, but never got around to it (truthfully). I have but a basic grasp of the concepts listed there. You've rekindled my thirst for knowledge, though, and I'm going to try getting back into it all. :thanks:
If you do have any e-books or white papers that you believe would be helpful, especially on bridging the gap between programming and video theory, please do PM links...
:thanks: :thanks:
TheRyuu
17th July 2008, 06:22
To normalize the grain, you can try any number of the following:
FluxsmoothT(1) # or 2
Simple temporal slight noise removal, try 2 for slightly stronger.
fft3filter(sigma=0.6,sigma2=0.1,sigma3=0.1,sigma4=0.1
I've found that denoising the higher frequencies makes the grain seem more stable, although I guess it's opinion so you can try that too. You can try adjusting the other sigma values as well if you want, goes from highest (sigma) to lowest (sigma4).
Ranguvar
17th July 2008, 06:45
Thanks for the idea, Dragon :)
I tweaked MC_Spuds, and it's doing very well now. Swapped FFT3DFilter for FFT3DGPU, enabled chroma denoising, and tried denoising the high frequencies more. I think I've got it to a good point, where it removes all of the chroma noise and only a little luma noise, but stabilizes well.
:thanks:
NOTE: For those that would like to see this crazy grain, here's (http://www.mediafire.com/?tmbbx9svfbm) 13 frames in a row. It's from the 2004 movie Crash, directly from the Blu-ray disc.
martino
17th July 2008, 12:41
and I can't get old plugins like Dust to load (LoadPluginEx cannot be loaded).
LoadPluginEx2 from WarpSharp's package.
Didée
17th July 2008, 13:01
Seems a bit strange to me that you seem to get "stabilization" of grain by stronger filtering of the high frequencies. Typically it's exactly the other way round: don't touch high freq's (to not alter the grain), but temporally filter the low freq's to remove the "dancing" effect (or flicker, or however you prefer to name it.)
Dragon5152's suggestion with FluxSmooth heads in a good direction.
Compare with this comment and script (http://forum.doom9.org/showthread.php?p=1073349#post1073349).
Scintilla
18th July 2008, 01:26
Well, GrainOptimizer barely touches it (grain is too heavy, I believe), and I can't get old plugins like Dust to load (LoadPluginEx cannot be loaded).
Use LoadPluginEx2, available from here (http://www.aquilinestudios.org/scripts/).
Amrit
27th July 2008, 05:49
I have a question about this
If you remove grain and bring it add with like addgrain will it answer his question?
Ranguvar
27th July 2008, 06:14
I suppose it might work; but that would most likely be slower, because the grain needs to actually be removed mostly first, which takes more time to do accurately, and IMO it's better to keep the original grain for "feel" purposes.
Oh, and Didée, I found out why denoising higher frequences was working for me... I was actually denoising lower frequencies :P I had gotten the sigmas mixed up (whether sigma or sigma4 does high frequencies, etc.)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.