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 23rd May 2008, 19:22   #41  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: Yorkshire, UK
Posts: 1,673
It has some "nice" softening and denoising characteristics. If you want those (which I do) it's seems a more stable choice than mcbob (and that only rarely gives me trouble).

My naïve hopes for it being quite fast have been dashed though!

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 23rd May 2008, 22:12   #42  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 677
tested on dogs (psi.avi).
imo:its much slower (didnot test properly), and visible better than mv/mcbob/mvbobmod
when psi.avi encoded h264 q28 its cca 30% smaller than mv/mcbob.
If compressed on smaller size with same quant. -it would be playable on less powerfull PC or more postprocessings are aplicable on powerfull PCs.
Terka is offline   Reply With Quote
Old 23rd May 2008, 23:33   #43  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Well, "much slower than MCBob" I can't reproduce ... with default settings it's about MCBob's speed, actually a tad faster.

But I agree that it's rather slow. A quick'n dirty test gave the following rough figures:
Code:
MCBob:            1.05 fps
TempGauss:        1.10 fps
YadifMod(NNEDI):  2.55 fps
MVBobFaster:      2.55 fps
NNEDI(field=-2):  2.60 fps
(Yes, my PC is a slow one.)

One reason for the low speed is that NNEDI is used as base for building the output, and NNEDI on it's own isn't exactly fast to begin with. Add to that all the additional MC stuff and error correction, and the result isn't a big surprise.

Now, for a little more fun, I've put up a new version.
It exposes MVAnalyse's blocksize & overlap as parameters, and allows to use either "NNEDI", "EEDI2" or "Yadif" as interpolators. Using this version with some fast settings, the table looks like this:
Code:
MCBob:            1.05 fps
TempGaussMC():    1.10 fps
YadifMod(NNEDI):  2.55 fps
MVBobFaster:      2.55 fps
NNEDI(field=-2):  2.60 fps
TempGaussMC (#1): 2.86 fps
TempGaussMC (#2): 3.60 fps
TempGaussMC (#3): 5.60 fps

---------------------------------
#1 : (2,1,1,true,false,EEDI,16/4)
#2 : (2,2,2,true,true,Yadif,16/4)
#3 : (2,1,1,true,false,Yadif,16/4)
If that's still not fast enough, you can specify "draft=1" (or 2) to get exactly that: a draft. (But hey, it's fast! )

Edit: and by now, EdiMode="EEDI2" is actually working *cough* ... (forgot to put SeparateFields from the 'devel' into the 'clean' of my local scripts, oh well)

..... and now also the case that "overlap" isn't explicitely specified, see below. Thanks.
__________________
- 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!)

Last edited by Didée; 24th May 2008 at 02:34.
Didée is offline   Reply With Quote
Old 24th May 2008, 02:11   #44  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Very nice

BTW - line 12, as is, throws an error. Should be:
ovlp = default( overlap, bs/2)

Edit: Interesting; to my eyes, using Yadif as interpolator gives an instrinsically sharper but marginally less stable result than NNEDI, all other parameters being equal. EEDI2 crashes on me.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 24th May 2008 at 03:36.
WorBry is offline   Reply With Quote
Old 24th May 2008, 11:15   #45  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 677
i have to reinstal my pc to test the speed. tried only on my "work" notebook about 0.04fps -you see my is slower :P. thats why it looks slow for me. ill compare it to mvbobmod too.
Terka is offline   Reply With Quote
Old 24th May 2008, 12:48   #46  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
With Yadif it might appear a bit sharper, but it's often more artificial than real. From VQEG's "Mobile" sequence:

TempGaussMC(Yadif): - TempGaussMC(EEDI2): - TempGaussMC(NNEDI):

If you switch between them, it's quite obvious that Yadif's speed comes at a price, and that NNEDI spends its time quite well.

Now that's an extreme example, it's possible that you won't see much of that on the "average content". It's just when using this script *always* with Yadif, and you're occasionally experiencing those artefacts, remember that it's not the script's fault, but your choice of having more speed.

BTW, I like EEDI2 pretty much in this script. Not quite as good as NNEDI, but pretty close. When dealing with interlaced content a lot, the small differences to NNEDI could be very well worth the speed gain.
__________________
- 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!)

Last edited by Didée; 24th May 2008 at 12:53.
Didée is offline   Reply With Quote
Old 24th May 2008, 15:14   #47  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Yes, its funny how the human eye can get used to perceiving artifact as detail. I remember when AVC/H264 encoding first became available to the masses how some people commented that it lacked definition and looked more 'artificial' than MPEG-4 & 2

Thanks for the fixes.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 24th May 2008 at 15:17.
WorBry is offline   Reply With Quote
Old 24th May 2008, 18:58   #48  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
Awesome script! It is even possible to bob a mix of progressive and interlaced without getting any jaggies, which was impossible to do with tdeint and mcbob. Thanks! *adding this to AnimeIVTC()*
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 25th May 2008, 05:13   #49  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
I have a query that’s sort of related.

The Panasonic GS400 DV camcorder that I shoot most of my home video stuff on also has a pseudo-progressive Frame Mode, which I use from time to time. The accepted understanding (Panasonic have never fully disclosed how it is done) is that the camera captures both fields at the same instant and combines them (possibly with some further electronic manipulation) to produce a frame that is technically interlaced but visually progressive (pseudo-25p). As one might expect, the frames are free from combing, but there tend to be quite conspicuous aliasing artifacts on high contrast edges, possibly arising from the pixel shift and line-pair summation.

I’ve tried various anti-aliasing filters, including the SangNom-based functions, but without satisfactory results; Soulhunter’s SAA script proved the most effective, but at the expense of too much blurring.

One thing I’ve noted about TempGauss MC, is its remarkable capacity to eliminate not only flickering (‘inter-line twitter’, I learn is the technical term in broadcast engineering) but other aliasing artifacts in the process. So, I thought why not test it with some Frame Mode clips also. Of course, I recognized that bobbing a 'progressive' source will (in theory) give dupes (although in practice not entirely identical due to imperfect complementary field interpolation) and so merged the output even and odd frames, like so:

TempGaussMC()
Merge(SelectEven(), SelectOdd(), 0.5)

Actually, the results are really quite good, with no aliasing (well maybe a tad) and far less blur than SAA.

So I’m wondering if Didee might consider looking at adapting the 'motion-compensated temp gauss' concept as a general purpose anti-aliasing function applicable to progressive sources as well.

Here’s the ‘frame mode’ test clip I used (anamorphic 16.9 DV)

http://rapidshare.com/files/11740924...ype_2.avi.html
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 25th May 2008 at 06:48.
WorBry is offline   Reply With Quote
Old 25th May 2008, 09:17   #50  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by WorBry View Post
I’ve tried various anti-aliasing filters, including the SangNom-based functions, but without satisfactory results; Soulhunter’s SAA script proved the most effective, but at the expense of too much blurring.
Code:
### LaTo Antialiasing Script v2
### Need: asharp.dll & sangnom.dll
function LAA(clip input, int "strength", int "threshold", bool "sharp", float "ss") {

strength = default(strength, 96)
threshold = default(threshold, 10)
sharp = default(sharp, true)
ss = default(ss, 2.0)
aastr = int(strength) /2
asthr = float(strength) /100
ox = input.width
oy = input.height
ox2 = round(ox*ss/8)*8
oy2 = round(oy*ss/8)*8

process = input.spline36resize(ox2,oy2).turnleft().sangnom(aastr).turnright().sangnom(aastr)
process = ( sharp == true ) ? process.asharp(asthr,0,0).spline36resize(ox,oy) : process.spline36resize(ox,oy)
mask = mt_average(input,process,u=1,v=1).mt_edge(thy1=threshold,thy2=threshold,u=1,v=1)
output = mt_merge(input,process,mask,u=2,v=2)

return ( output ) 
}
###
Like this: LAA(last, 96, 10, true, 2.0)

Last edited by LaTo; 25th May 2008 at 11:14.
LaTo is offline   Reply With Quote
Old 25th May 2008, 11:25   #51  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 677
mcbob 1.1fps
TempGaussMC(): 0.3 fps
some of my plugins is old
it was masktools, now got
TempGaussMC(): 1.6 fps

Last edited by Terka; 25th May 2008 at 11:34.
Terka is offline   Reply With Quote
Old 25th May 2008, 14:20   #52  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Quote:
Originally Posted by LaTo View Post
Like this: LAA(last, 96, 10, true, 2.0)
Thanks. Not bad, but pretty much the same result as 'Anti-aliasing' script:

http://avisynth.org/mediawiki/AntiAliasing

Note the residual 'hatching' on the white base-board and red pole in the last scene of the DV sample I put up.

Didnt really want to turn this into an 'anti-aliasing' thread per se. Was more interested in the potential application of TempGaussMC in this area.

Edit: PS - I note that this also works quite well on the aliasing:

SeparateFields()
merge(SelectEven().EEDI2(),SelectOdd().EEDI2(),0.5)

But then you start to see more disruption and shimmering of high contrast line patterns (e.g. the striped red shirt in the last scene), and even more so with NNEDI:

SeparateFields()
merge(SelectEven().nnEDI(dh=true,field=1),SelectOdd().nnEDI(dh=true,field=0),0.5)

Hence the notion that this might be resolved by applying similar temporal treatments to those employed by TempGaussMC.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 25th May 2008 at 19:00.
WorBry is offline   Reply With Quote
Old 27th May 2008, 11:33   #53  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 677
did some tests on TempGaussMC and its really good!
Have some questions:
1.

is the (tr0==0) correct? (default is 2, so default will end with t1.merge(t2,0.357).merge(dbob,0.125))
Code:
t  = (tr0==0) ? dbob
 \ : (tr0==0) ? t1.merge(dbob,0.25)
 \            : t1.merge(t2,0.357).merge(dbob,0.125)
2. if i understand the behaviour correctly, TempGaussMC is mostly denoiser which is suited for deinterlace. Didee feed it with yadif or "nnedi deinterlacer"... . If feeded with mv/mcbob will be the fesults even better?

3. Scharfi sugested to put some stabilization into. If this to do, where in the chain to put into?
bob-stabilize-TempGaussMC
or
bob-TempGaussMC-stabilize?
thank you!

Last edited by Terka; 27th May 2008 at 13:58.
Terka is offline   Reply With Quote
Old 27th May 2008, 13:06   #54  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
It's amazing how much small bugs sneak into my posted scripts ...

1. No, of course that's not correct. The 2nd condition has to be "tr0==1".
Moreover there was a bug that causes an error for TGMC(tr2=3) ... a stupid syntax thingy.

Both bugs have been corrected, the function in post#13 is bugfree now. (Hopefully.)

I've another update pending. It'll cover an adapted sharpen mode (stronger in vertical direction, since that direction gets blurred more), and an option for rep1 acting a bit better.


2. Some improvements may be possible that way, but most probably it'll be minor improvements with major effort. TempGaussMC will average away much of the benefits that any motion-compensate bob will feed it with.
The other way round would be much better: Make a motion-compensated bob that uses TempGaussMC as basis for vector search, comparisons, etc. (Subsequently, this poses a pile of questions again, can't dive into that right now...)


3. Can't say much to that, for some reason DepanStabilize doesn't even work correctly for me. Besides, scharfis_brain didn't suggest stabilization. It was in the script posted by map1742, scharfis_brain just talked about the order of steps in that script.
__________________
- 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 27th May 2008, 13:59   #55  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 677
Didee,
thank you for explanation.
Terka is offline   Reply With Quote
Old 27th May 2008, 15:58   #56  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Any thoughts on my query about applying the temp gauss to progressive material?

Although applying Merge(SelectEven(), SelectOdd(), 0.5) to the output gives quite good results, I realize that the gauss itself has been applied over (near identical) dupe frames which will have disrupted the motion flow.

Tried tinkering myself, using merged dupes from the dbob and edi, or replacing dbob with the source clp itself, but I suspect this is screws up the temp gauss and mask tuning etc. I’m wondering if applying the gauss to the masked difference between the dupe frames and then adding this back to the merged dupes, might be a better approach, but am unsure how to set this up and what would be the better source for the dupes, a dbob or edi?

Do you think this would be a valid approach or am I completely off whack?

Cheers.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 27th May 2008 at 16:21.
WorBry is offline   Reply With Quote
Old 27th May 2008, 18:44   #57  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Well, I'm not sure what to say about that. Applying it to progressive material, the effect can be denominated as ...

a) (pragmatic version) ... a mix of spatial softening and temporal smoothing.

b) (PR department version) ... spatio-temporal super-resolution filter.


Mixing in the way of

AnyBobFilter()
Merge( SelectEven(), SelectOdd() )

is the (mostly) spatial part. The motion-compensated parts of the script will partly consolidate the spatial part (one temporal neighbor is in fact the other spatial field), the rest will manipulate the spatial resolution by temporal processing after motion compensation.

So what to say? It does something, not necessarily something bad, but neither tuned to do something particularily good.

The funny thing about your progressive sample is that there's aliasing in some places, but not everywhere. The aliasing seems to happen mostly in high-contrast areas, but then again, not in all high-contrast areas. For that reason it's hard to find something that acts on only the aliased parts ... the problem is how to identify them.

Somewhen, somewhere, there was a thread by Chainmax about removing aliasing, where I had extracted the averaged-EEDI2-with-contrasharpening-method out of MCBob into a standalone script. Might be worth a try, too.
__________________
- 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 27th May 2008, 22:09   #58  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
If this is the thread you're talking about, the AA script would be this, right?
Code:
c=last
dbl   = mt_average(c.nnedi(field=1),c.nnedi(field=0),U=3,V=3)
dblD = mt_makediff(c,dbl,U=3,V=3)
shrpD = mt_makediff(dbl,dbl.removegrain(11),U=3,V=3)
DD = shrpD.repair(dblD,13)
dbl.mt_adddiff(DD,U=3,V=3)
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 27th May 2008, 23:11   #59  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Yes, I assume thats the one also, or for EEDI2 and BFF clip:

Code:
o=last
AssumeBFF().SeparateFields()
dbl   = mt_Average( SelectEven().EEDI2(field=0, maxd=4),
 \                  SelectOdd() .EEDI2(field=1, maxd=4), U=3,V=3 )
dblD  = mt_MakeDiff(o,dbl,U=3,V=3)
shrpD = mt_MakeDiff(dbl,dbl.RemoveGrain(11),U=3,V=3)
DD    = shrpD.Repair(dblD,13)
dbl.mt_AddDiff(DD,U=3,V=3)
Problem there is that even with the EEDI2 maxd set down to 4, there is still some disruption of high contrast line patterns (like on the striped shirt in scene 3 of the clip). Dropping to maxd=2 helps to avoid this but then the anti-aliasing is less effective. Maxd=3 seems to offer a reasonable compromise.

The NNEDI version looks better in some areas (e.g. a bit less shimmering of figures on wall posters in scene 2, although more than in the original clip), but there appears to be more degradation of fine line patterns (e.g. striped shirt).
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 28th May 2008 at 05:46.
WorBry is offline   Reply With Quote
Old 31st May 2008, 06:25   #60  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
@Didee,

Tinkered a bit with the AA script above; found that applying the RemoveGrain (11) kernel blur diff to the unmerged EEDI2 bob and using a DumbBob (rather than the source clip itself) as the reference for the repair, before finally merging the even and odd output frames, helped to reduce the flickering/shimmering of objects (like the figures on the wall posters in scene 2) that were quite stable in the original clip. Seemed a valid approach since the treatment is primarily spatial i.e. no temporal component to be confused by dupes.

Code:
AVISource("E:\... \Test Mix Frame Mode 16.9 DV Type 2.avi")
o=last.AssumeBFF()
dbob=o.Bob()
edibob=o.SeparateFields().EEDI2(field=-2, maxd=3)
ediD  = mt_MakeDiff(dbob,edibob,U=3,V=3)
shrpD = mt_MakeDiff(edibob,edibob.RemoveGrain(11),U=3,V=3)
DD    = shrpD.Repair(ediD,13)
AddDD = edibob.mt_AddDiff(DD,U=3,V=3)
Mrgeo = merge(AddDD.SelectEven(),AddDD.SelectOdd(),0.5)
return( Mrgeo )
It also helped to smooth out the more stubborn aliasing (like the ‘quilting’ on the white base boards in scene 3). Predictably however, the mod resulted in slight increase in blurring.

Having seen what TempGaussMC can do, can’t get away from this (maybe misplaced) notion that a modified version (or the guts of it) that uses the merged (averaged) even and odd frames from the dumbbob (as source for the 'pre-mc' temp gauss) and likewise for the edi-bob (for the mo-comp/interp etc part), would provide anything other than an improved result (i.e. effective anti-aliasing whilst avoiding by-product flickering of 'stable' objects) for progressive DV sources such as this, even if inconsistencies in the appearance of aliasing and 'line-twitter' (love that phrase) make it more difficult to tune precisely.

Any chance you could put the usual (greyed-out) brief explanation of what each segment of the script does in the next TempGaussMC update; maybe I could get my head around it enough to have a stab (in the dark) at it?

Unless of course you do have a ‘spatio-temporal super-resolution filter’ up your magician's sleeve?

BTW - I'm continuing to get consistently excellent results with TempGaussMC as I test more interlaced material. Really is a superb processor.

Edit: In the routine for preparing the searchclp for the mo-comp, what added effect does RemoveGrain(11).RemoveGrain(11) as compared to single RemoveGrain(11)? I'm assuming more sharpening, which in the context of the mt_diff will mean more blurring and so smoothing of the mv's...correct?
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 1st June 2008 at 03:51.
WorBry is offline   Reply With Quote
Reply

Tags
deinterlace, flickering

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 16:47.


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