Blocks on black?

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Blocks on black?

Post by Scintilla » Sat Jun 13, 2009 9:32 pm

noelle675 wrote:I feel really bad asking, but if you wouldn't mind could you explain what "radius" and "threshold" are? I tried changing the radius and the two threshold values with the code I have now just to see what happens and I'm not really seeing much of a difference. I read bits of Scintilla guides again to try and get my head to osmosis the knowledge in, but the farthest my brain got was that thrY and thrUV deal with chroma and luma. So now I don't know what either of those are. The best guess is chroma has to do with color and luma has to do with light, but that's vague and not helpful. I did notice some minor noise like smoothing on another part of the clip that is got rid of.
Radius refers to how big of a surrounding area around each pixel gets included in the smoothing calculations. When radius = 1, only the eight pixels immediately around the target pixel are considered (and, if you're using a 3d mode, one pixel in the previous frame and one in the next frame), and so on.

Threshold refers to how different a pixel's value can be to that of the target pixel and still be considered for the smoothing calculations. When threshold = 1, only pixels one bit darker or brighter than the target (plus pixels that are exactly the same value) will be used.
noelle675 wrote:
Scintilla wrote:
noelle675 wrote:I took another look at Scintilla's guide and she has the values labeled.
:lol: :lol: I swear, this never gets old!
You mean I'm not the first idiot you've enlightened by naming values? :wink: And while you're helping I got to thank you for your wonderful guides. They're extremely helpful.
Thank you! But what I actually meant was, well, look at where I added emphasis in your quote. :P
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: Blocks on black?

Post by Qyot27 » Sat Jun 13, 2009 11:17 pm

Yeah, generally speaking, the higher the radius, the more area is allowed around any particular spot that gets smoothed. With higher thresholds, that content size of the area shoots up even more (as in, even though the radius is a certain amount, some pixels can still be excluded based on how different they are; higher thresholds make deen progressively ignore more and more of the differences, thereby including more pixels in the smoothing operations), and the higher and higher the values are, the more watercolor-ey the output will look (or, perhaps more aptly, like you submersed something already painted in watercolors).

As a test, you could have the same source, and do side-by-side comparisons of the frames using different smoothing values. That'd probably be more illuminating than simply trying to explain it could be. You can even do it in one script, and just switch out the values between opening the files and saving a screenshot, or use a single script to take a small portion, hit it with the differing smoother settings, and splice them all together sequentially.

Example 1: Opening each example separately (the # sign comments out the line, so AviSynth doesn't use it - which saves you from retyping the command in if you want to revert back to it; to reactivate the line, just delete the #)

Code: Select all

ConvertToYV12()
Deen(mode="a2d", rad=4, thrY=5, thrUV=9, min=0.5)
#Deen(mode="w2d", rad=3, thrY=5, thrUV=9, min=0.5)
#Deen(mode="c3d", rad=2, thrY=5, thrUV=9, min=0.5)
VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0)
msharpen(threshold=15,strength=120)
GradFunkMirror(3)
Example 2: splicing different examples together (for ease of use, I'm going to use variable descriptors and periods to separate the filter operations rather than putting them on new lines)

Code: Select all

vid = AVISource("yourvideo.avi").Trim(100,1000)
ex1 = vid.ConvertToYV12().Deen(mode="a2d", rad=4, thrY=5, thrUV=9, min=0.5).VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0).msharpen(threshold=15,strength=120).GradFunkMirror(3)
ex2 = vid.ConvertToYV12().Deen(mode="w3d", rad=3, thrY=5, thrUV=9, min=0.5).VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0).msharpen(threshold=15,strength=120).GradFunkMirror(3)
ex3 = vid.ConvertToYV12().Deen(mode="c3d", rad=2, thrY=5, thrUV=9, min=0.5).VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0).msharpen(threshold=15,strength=120).GradFunkMirror(3)
ex1 ++ ex2 ++ ex3
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Blocks on black?

Post by Scintilla » Sun Jun 14, 2009 12:02 pm

Qyot27 wrote:Example 2: splicing different examples together (for ease of use, I'm going to use variable descriptors and periods to separate the filter operations rather than putting them on new lines)

Code: Select all

vid = AVISource("yourvideo.avi").Trim(100,1000)
ex1 = vid.ConvertToYV12().Deen(mode="a2d", rad=4, thrY=5, thrUV=9, min=0.5).VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0).msharpen(threshold=15,strength=120).GradFunkMirror(3)
ex2 = vid.ConvertToYV12().Deen(mode="w3d", rad=3, thrY=5, thrUV=9, min=0.5).VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0).msharpen(threshold=15,strength=120).GradFunkMirror(3)
ex3 = vid.ConvertToYV12().Deen(mode="c3d", rad=2, thrY=5, thrUV=9, min=0.5).VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0).msharpen(threshold=15,strength=120).GradFunkMirror(3)
ex1 ++ ex2 ++ ex3
For the last line, Interleave(ex1,ex2,ex3) might be even better. Then the differently filtered copies of each frame would be right next to each other, so you could just step through to see how each frame changes from one filter chain to the next.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
noelle675
Joined: Wed Feb 01, 2006 7:16 pm
Location: Colorado
Org Profile

Re: Blocks on black?

Post by noelle675 » Sun Jun 14, 2009 3:20 pm

Scintilla wrote: Radius refers to how big of a surrounding area around each pixel gets included in the smoothing calculations. When radius = 1, only the eight pixels immediately around the target pixel are considered (and, if you're using a 3d mode, one pixel in the previous frame and one in the next frame), and so on.

Threshold refers to how different a pixel's value can be to that of the target pixel and still be considered for the smoothing calculations. When threshold = 1, only pixels one bit darker or brighter than the target (plus pixels that are exactly the same value) will be used.
Alright that makes a lot more sense now. Thank you so much.
Scintilla wrote: Thank you! But what I actually meant was, well, look at where I added emphasis in your quote. :P
OH! Hahaha. Sorry. :sweat:
Qyot27 wrote:Yeah, generally speaking, the higher the radius, the more area is allowed around any particular spot that gets smoothed. With higher thresholds, that content size of the area shoots up even more (as in, even though the radius is a certain amount, some pixels can still be excluded based on how different they are; higher thresholds make deen progressively ignore more and more of the differences, thereby including more pixels in the smoothing operations), and the higher and higher the values are, the more watercolor-ey the output will look (or, perhaps more aptly, like you submersed something already painted in watercolors).
I'm am definitely going to keep that in mind when I'm filtering. Now I should be able to really fine tune the smoothing without randomly changing numbers.
Qyot27 wrote:As a test, you could have the same source, and do side-by-side comparisons of the frames using different smoothing values. That'd probably be more illuminating than simply trying to explain it could be. You can even do it in one script, and just switch out the values between opening the files and saving a screenshot, or use a single script to take a small portion, hit it with the differing smoother settings, and splice them all together sequentially.
Much better now I can see what's happening. I've tried it out on the clip I'm using now and I'm able to see subtle differences. I'll have to go and get a clip that needs more filtering to see the difference better. The source I have now is pretty good already so it's a little hard for my untrained eye.

Thank you so much for your help!
Scintilla wrote: For the last line, Interleave(ex1,ex2,ex3) might be even better. Then the differently filtered copies of each frame would be right next to each other, so you could just step through to see how each frame changes from one filter chain to the next.
You never cease to amaze me with your knowledge. :up:

Locked

Return to “AviSynth Help”