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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th August 2007, 22:11   #1  |  Link
DeathAngelBR
Registered User
 
Join Date: Nov 2006
Posts: 83
Seesaw and noise addition

I've been trying lots of sharpening filters and seesaw obviously does it best. But I'm worried about the noise it adds to the whole frame, so I wonder if there's a way I'm not aware of that seesaw sharpens the image but doesn't add noise to it?

Code:
ColorMatrix(hints=true,interlaced=true)
tfm(d2v="VTS_01_1.d2v",cthresh=2,blockx=4,blocky=4).tdecimate(hybrid=1)
crop( 4, 4, -2, 0)
Lanczos4Resize(848,480)
a=last
b=a.Undot()
SeeSaw(a,b, NRlimit=3, NRlimit2=4, Sstr=1.5, Slimit=5, Spower=5, Sdamplo=6, Szp=16)
Original image:


Sharpening with seesaw:


Undot() after seesaw:


Considering that there's an Undot() before, could it be that using it again would "blur" too much or decrease overall quality?

edit: I decreased Sstr to 1.0, but there's little noise left still. My concern is that denoising too much = bluring too much.

Last edited by DeathAngelBR; 16th August 2007 at 22:15.
DeathAngelBR is offline   Reply With Quote
Old 17th August 2007, 00:49   #2  |  Link
Nikos
Registered User
 
Join Date: Jun 2002
Location: Greece
Posts: 236
Undot() has negligible effect. Try using another filter like degrainmedian() for serious denoise.
__________________
Greece PAL User...
Nikos is offline   Reply With Quote
Old 17th August 2007, 04:17   #3  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
With IVTC, I recommend you use Colormatrix after tfm+tdecimate. But it really doesn't matter.

undot really doesn't do anything. And removegrain(mode=1) is the same thing only faster if your looking for that (especially the sse3 version).

degrainmedian(mode=1) would be better (pretty fast too).
Even better fft3dfilter() (but a lot slower)

SeeSaw really shouldn't create noise. Maybe you need to tweak the settings more?

Also for anime, I'd suggest trying LSF (LimitedSharpenFaster) as well. I like the result it gives. Also try smode=3 and smode=4 with it and compare.
(were the denoiser is before LSF, also LSF is by far much easier to configure):
Code:
fft3dfilter()
LimitedSharpenFaster(ss_x=1.5, ss_y=1.5, smode=3, stregnth=125, overshoot=1, undershoot=1) #play around with smode=3/4, see which you like better
FastLineDarkenMOD(thinning=0, strength=50) #change strength to suit your taste
And don't forget about line darkerners like FastLineDarken (see FastLineDarkenMOD, newest version is a May 2007 version by Didee), toon or vmtoon.

Play around and see what you like.

P.S. Resizing before you filters can blur noise (causing it to not be picked up by the denoiser) but it's your call were you want to put it. Sometimes it's better with it before, sometimes after.

Last edited by TheRyuu; 17th August 2007 at 04:30.
TheRyuu is offline   Reply With Quote
Old 17th August 2007, 04:43   #4  |  Link
R3Z
Silver Über Alles
 
R3Z's Avatar
 
Join Date: Aug 2006
Location: Australia
Posts: 269
Personally i would use a combination of RemoveGrain(2).Vaguedenoiser()

I normally alter vaguedenoisers settings, but they wont help here so you have to do that yourself.
R3Z is offline   Reply With Quote
Old 17th August 2007, 05:25   #5  |  Link
DeathAngelBR
Registered User
 
Join Date: Nov 2006
Posts: 83
Quote:
Originally Posted by wizboy11 View Post
With IVTC, I recommend you use Colormatrix after tfm+tdecimate. But it really doesn't matter.
It matters, because I get an error if I put it after tfm+tdecimate.

Quote:
Originally Posted by wizboy11 View Post
undot really doesn't do anything. And removegrain(mode=1) is the same thing only faster if your looking for that (especially the sse3 version).

degrainmedian(mode=1) would be better (pretty fast too).
Even better fft3dfilter() (but a lot slower)
degrainmedian blurs too many details and removegrain ignores or doesn't detect stuff that fluxsmoothst does. (don't ask)

Quote:
Originally Posted by wizboy11 View Post
SeeSaw really shouldn't create noise. Maybe you need to tweak the settings more?
Been doing it.

I'll give LSF a try.
DeathAngelBR is offline   Reply With Quote
Old 17th August 2007, 06:07   #6  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
Quote:
Originally Posted by DeathAngelBR View Post
It matters, because I get an error if I put it after tfm+tdecimate.
You shouldn't. Your using info=3 on the mpeg2source right?
Furthermore, I like using it like this:
Code:
movie = mpeg2source("C:\movie.d2v", info=3)
movie = tfm(movie,d2v="movie.d2v").tdecimate()
movie = ColorMatrix(movie,mode="Rec.709->Rec.601",hints=true,threads=0) #or appropriate color conversion
last = movie
Same way automkv does it, and I like it.

Quote:
degrainmedian blurs too many details and removegrain ignores or doesn't detect stuff that fluxsmoothst does. (don't ask)
Then try fft3dfilter. Best denoiser on the planet. IMO, vaguedenoiser can take away too many details and as long as the source isn't really noisy, fft3dfilter will do just fine (or fft3dgpu).

Quote:
Been doing it.
I'll give LSF a try.
Probably a good shot
I think that SeeSaw i just amplifying the blocking/noise that is already there.

Last edited by TheRyuu; 17th August 2007 at 06:09.
TheRyuu is offline   Reply With Quote
Old 17th August 2007, 06:34   #7  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,688
Well the best is probably MVTools-motion-compensated FFT3DFilter
Dark Shikari is offline   Reply With Quote
Old 17th August 2007, 06:41   #8  |  Link
R3Z
Silver Über Alles
 
R3Z's Avatar
 
Join Date: Aug 2006
Location: Australia
Posts: 269
Quote:
Originally Posted by wizboy11 View Post



Then try fft3dfilter. Best denoiser on the planet. IMO, vaguedenoiser can take away too many details and as long as the source isn't really noisy, fft3dfilter will do just fine (or fft3dgpu).
Vaguedenoiser takes away too many details?
Only if you fudge the settings. The same is also true for fft3d. That can make the picture like a gauss blur
R3Z is offline   Reply With Quote
Old 18th August 2007, 00:35   #9  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,350
There is hardly any noise (or detail) in that screenshot, dctfun4b(4,4) should be more then good enough, and relatively fast.
*.mp4 guy is offline   Reply With Quote
Old 18th August 2007, 23:21   #10  |  Link
DeathAngelBR
Registered User
 
Join Date: Nov 2006
Posts: 83
Quote:
Originally Posted by *.mp4 guy View Post
There is hardly any noise (or detail) in that screenshot, dctfun4b(4,4) should be more then good enough, and relatively fast.
There are more frames, you know


I'm getting an error when using LSF (removegrain invalid mode 19) or FastLineDarkenMOD (removegrain invalid mode 20). Am I missing something? I got removegrain 0.9, masktools v2.0a32 and mvtools.dll
DeathAngelBR is offline   Reply With Quote
Old 18th August 2007, 23:50   #11  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
Quote:
Originally Posted by DeathAngelBR View Post
There are more frames, you know


I'm getting an error when using LSF (removegrain invalid mode 19) or FastLineDarkenMOD (removegrain invalid mode 20). Am I missing something? I got removegrain 0.9, masktools v2.0a32 and mvtools.dll
Install removegrain 0.9 then copy over it removegrain 1.0 (remove grain 0.9 and 1.0 also have a few different files (like ssetools with 0.9 and denoisesharpen with 1.0))
TheRyuu is offline   Reply With Quote
Old 19th August 2007, 00:03   #12  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by Dark Shikari View Post
Well the best is probably MVTools-motion-compensated FFT3DFilter
FFT3D is great, but mvdegrain totally destroys it. mvdegrain + mvmask + qpel estimation + exhaustive search + overlap 8/2 = Very slow processing, but probably the greatest denoiser combo there is. This combo requires like a quad core and maybe 8 gigs of memory to use properly.
Terranigma is offline   Reply With Quote
Old 19th August 2007, 01:27   #13  |  Link
ChrisW77
Registered User
 
Join Date: Sep 2006
Posts: 72
Quote:
FFT3D is great, but mvdegrain totally destroys it. mvdegrain + mvmask + qpel estimation + exhaustive search + overlap 8/2 = Very slow processing, but probably the greatest denoiser combo there is. This combo requires like a quad core and maybe 8 gigs of memory to use properly.
Do you happen to have a general script to test with ?
I happen to have a newly purchased Core2Quad Q6600, and 4Gb RAM, and wouldn't mind giving this beast something to play with
ChrisW77 is offline   Reply With Quote
Old 19th August 2007, 01:49   #14  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by ChrisW77 View Post
Do you happen to have a general script to test with ?
I happen to have a newly purchased Core2Quad Q6600, and 4Gb RAM, and wouldn't mind giving this beast something to play with
Ok, You asked for it.
Start from your post here.
Since then, it's involved into something only a hebephrenic would use.


source = last.deblock_qed()
w=width()
h=height()
backward_vec2 = source.MVAnalyse(isb=true, delta=2,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0,idx=1)
backward_vec1 = source.MVAnalyse(isb=true, delta=1,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0,idx=1)
forward_vec1 = source.MVAnalyse(isb=false, delta=1,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0,idx=1)
forward_vec2 = source.MVAnalyse(isb=false, delta=2,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0,idx=1)
maskp1 = mvmask(kind=1, vectors=forward_vec1, ysc=255).UtoY()
maskp2 = mvmask(kind=1, vectors=forward_vec2).UtoY()
maskp3 = mvmask(kind=1, vectors=backward_vec1, ysc=255).UtoY()
maskp4 = mvmask(kind=1, vectors=backward_vec2).UtoY()
maskf = average(maskp1, 0.25, maskp2, 0.25, maskp3, 0.25, maskp4, 0.25).spline36resize(w,h)
smooth = source.degrainmedian(mode=3, limity=16, limituv=8).fft3dfilter(bw=16, bh=16, bt=3, sigma=4, plane=0)
source2 = maskedmerge(source,smooth,maskf)
source2.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=2)
RemoveGrain(0,11).gradfun2db(1.51).RemoveGrain(mode=1)

What I did was basically took *.mp4 guy's script and made it slower. This works very well on sources with rain, snow, sleet, fire, or whatever other misconception you may find.

For a slight speed (haha, not by much), use fft3dgpu instead, and maybe remove deblock_qed. =P

Last edited by Terranigma; 19th August 2007 at 16:00. Reason: edited accordingly with Didée's Suggestions
Terranigma is offline   Reply With Quote
Old 19th August 2007, 02:10   #15  |  Link
ChrisW77
Registered User
 
Join Date: Sep 2006
Posts: 72
Holy crap lol.

Thanks for the script, should make this PC break down and beg for mercy.

Overclockers, should forget about a 24-hour Prime session, and just run this script, lol.

Thanks again.
ChrisW77 is offline   Reply With Quote
Old 19th August 2007, 02:41   #16  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,688
Quote:
Originally Posted by Terranigma View Post
Ok, You asked for it.
Start from your post here.
Since then, it's involved into something only a hebephrenic would use.

w=720
h=480
fields = last
backward_vec2 = fields.MVAnalyse(isb=true, delta=2,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0)
backward_vec1 = fields.MVAnalyse(isb=true, delta=1,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0)
forward_vec1 = fields.MVAnalyse(isb=false, delta=1,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0)
forward_vec2 = fields.MVAnalyse(isb=false, delta=2,blksize=8,search=3,searchparam=2,pel=4,overlap=8/2,overlapV=8/2,dct=0)
maskp1 = mvmask(kind=1, vectors=forward_vec1, ysc=255).UtoY()
maskp2 = mvmask(kind=1, vectors=forward_vec2).UtoY()
maskp3 = mvmask(kind=1, vectors=backward_vec1, ysc=255).UtoY()
maskp4 = mvmask(kind=1, vectors=backward_vec2).UtoY()
maskf = average(maskp1, 0.25, maskp2, 0.25, maskp3, 0.25, maskp4, 0.25).spline36resize(w,h)
smooth = fields.degrainmedian(mode=3, limity=16, limituv=8).fft3dfilter(bw=16, bh=16, bt=3, sigma=4, plane=4)
fields2 = maskedmerge(fields,smooth,maskf)
fields2.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
RemoveGrain(0,11).gradfun2db(1.51).deblock_qed().RemoveGrain(mode=1)

What I did was basically took *.mp4 guy's script and made it slower. This works very well on sources with rain, snow, sleet, fire, or whatever other misconception you may find.

For a slight speed (haha, not by much), use fft3dgpu instead, idx values, and maybe remove deblock_qed. =P
Why dct=0?
Dark Shikari is offline   Reply With Quote
Old 19th August 2007, 02:50   #17  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
By all means, do assign idx identifiers in this script. idx=1 in all MVanalyse, idx=2 in MVDegrain2.

You can use FFT3D with plane=0. In your maskedmerge line, you're discarding FFT3D's chroma filter'ed planes anyway.

If you use deblock_qed there, you can kick it out as well. It's close to useless in that place. Rather apply it directly to the input clip. This even will potentially improve motion estimation. (Unless you find it's such a broadsword detail killer, hrmh.)

Instead of
w=720 h=480 fields=last,

be smart and write
fields=last w=width() h=height()

Oh, and it's a bit irritating to name a progressive clip "fields", isn't it.


For the OP's clip, this filtering is breaking a fly on the wheel.
__________________
- 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!)
Didée is offline   Reply With Quote
Old 19th August 2007, 11:27   #18  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,816
Good advice! I will have to try this out on the MacPro at work (assuming I can get her b0rken Windows install functioning properly again!!)

I had to do some industrial grain denoising a few months ago from a DV source, and I think this would be a lovely script to try.

Now all I need is another 6 gigs of RAM, and x64 to make use of it. Oh wait, no AviSynth x64 to run this properly

~MiSfit
Blue_MiSfit is offline   Reply With Quote
Old 19th August 2007, 12:32   #19  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,350
Quote:
Originally Posted by Didée View Post
If you use deblock_qed there, you can kick it out as well. It's close to useless in that place. Rather apply it directly to the input clip. This even will potentially improve motion estimation. (Unless you find it's such a broadsword detail killer, hrmh.)

For the OP's clip, this filtering is breaking a fly on the wheel.
Agreed, If your source is blocky Deblock qued should be run earlier;
and this filtering is extremely excessive for the example in this thread.

@Didée
Deblock qued isn't a big detail killer, I just find any loss of detail to be unacceptable, even the tiny little bits of detail lost by plain mvdegrain bother me from time to time, and I can't stand fft3d with sigma > 1.
*.mp4 guy is offline   Reply With Quote
Old 19th August 2007, 15:40   #20  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Haha, thanks Didée and *.mp4 guy. I'll edit it accordingly to what you guys suggested.

---
Updated

Last edited by Terranigma; 19th August 2007 at 16:12.
Terranigma is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.