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 7th June 2013, 17:59   #81  |  Link
luke83
Registered User
 
luke83's Avatar
 
Join Date: Oct 2010
Posts: 109
Quote:
Originally Posted by WooWoo View Post
Hi, I need some help. I am trying to encode to x264 using aaa() loading the latest versions of SangNom and UnFilter and importing AAA.avs (I got all the files today from the avisynth wiki). Everything looks right in the preview window for programs such as VirtualDub and MeGUI. However, when my x264 encode finishes, the height is double the size (width is the same), and the fps is halved. So instead of it being 640x480 @ 23.976 FPS, it is 640x960 @ 11.988 FPS. When I encode to XviD, everything comes out at the correct resolution and FPS using the same script. All I'm doing is loading the source file and plugins/scripts needed for AAA(), and then running AAA() in my avs script.

I then tried out each version of SangNom that Didée posted and bcn_246 tested out. They all resulted in the the same problem except for sangnom_old.dll (CRC32: 60BE3D92). This particular version worked perfectly without changing the resolution or FPS, however it reduced my FPS to a laughable ~2 FPS on my i5 quad core machine. Anybody else having this issue, or am I not loading the correct versions of everything, or what's going on exactly? Why is it changing my resolution and fps?
post your script please. I'm using AAA from a lot of time and i haven't any problem yet. The only problem is that AAA is quite slow. However is the only anti-aliasing script that works good for me.
luke83 is offline   Reply With Quote
Old 9th July 2013, 03:40   #82  |  Link
byme
Registered User
 
Join Date: Sep 2008
Location: Italy
Posts: 204
how do to put the nnedi3 instead of BilinearResize in the SAA?
is it possible?
I'm not able...

Clp.PointResize(OX*SS,OY*SS).SangNom().TurnRight()
\ .SangNom().TurnLeft().BilinearResize(OX,OY)

Now, for the use that I do, I'm putting spline36resize

Clp.PointResize(OX*SS,OY*SS).SangNom().TurnRight()
\ .SangNom().TurnLeft().spline36resize(OX,OY)
byme is offline   Reply With Quote
Old 9th July 2013, 07:45   #83  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,576
Not possible. nnedi3 doesn't do downscaling.
Keiyakusha is offline   Reply With Quote
Old 10th July 2013, 07:01   #84  |  Link
jofori89
Nani miten da yo? Baka!!
 
jofori89's Avatar
 
Join Date: Jan 2010
Location: Vietnam
Posts: 26
Quote:
Originally Posted by list View Post
can't see any artifact there
BTW...
Code:
#FASTER ANTI ALIASING FILTER
#REQUIERED:
#    SangNom
#    mt_masktools

function FAA(clip input,int "str") {
	str = Default(str, 50)
	vid = input.IsYV12() ? input : input.ConvertToYV12()
	w=width(input)
	h=height(input)

	aa=vid.pointResize(w*2,h) . TurnLeft() . SangNom(AA=str) . TurnRight(). lanczosResize(w,h)

	return mt_merge(vid , aa , vid.mt_edge().mt_inflate() )
}
Maybe it's not the best anti aliasing filter, but 3x faster, and the first i can use in real time with some sources.
this one is good enough.
jofori89 is offline   Reply With Quote
Old 25th July 2013, 20:18   #85  |  Link
spx
Registered User
 
Join Date: Aug 2009
Posts: 3
Hi, i'm using the aaa() from wiki, and i got a question: What adds suchs a heavy noise to picture?
I've got a pretty clean animation frame, then i add aaa(Xshrp=55,Yshrp=55,chroma=false), and i get a tremendous amout of temporal noise. it changes with every frame. I'm afraid to clean it up because of detail loss.
You guys have the same results?

here's an example: http://screenshotcomparison.com/comparison/33785

at first i thought it's because of unsharp values of 55, but it adds noise on default, too...

Last edited by spx; 25th July 2013 at 20:30.
spx is offline   Reply With Quote
Old 26th July 2013, 14:56   #86  |  Link
Seedmanc
Registered User
 
Join Date: Sep 2010
Location: Russia
Posts: 85
In regards to ediaa(), wouldn't replacing
Quote:
return a.EEDI2(field=1).TurnRight().EEDI2(field=1).TurnLeft().spline36resize(a.width,a.height,-0.5,-0.5,2*a.width+.001,2*a.height+.001)
with
Quote:
return a.EEDI2(field=1).spline36resize(a.width,a.height,0,-0.5,0,2*a.height+.001).TurnRight().EEDI2(field=1).TurnLeft().spline36resize(a.width,a.height,-0.5,0,2*a.width+.001,0)
be better speed- and memory-wise? So that second EEDI2 doesn't have to deal with unnecessarily 2x wider clip when it only works with the height, not width.
For me it gives a speed increase from 1 fps to 1.6 on 1080p.
Seedmanc is offline   Reply With Quote
Old 27th July 2013, 09:42   #87  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
AA scripts that use turnleft and/or sangnom may be significantly sped-up with sangnom2+fturn - for better results drop the chroma plane by using Y8 colorspace during processing and copy original chroma in the end (example). Realtime AA of 1080p @ 24fps on my pc...

Last edited by wOxxOm; 27th July 2013 at 09:46.
wOxxOm is offline   Reply With Quote
Old 29th July 2013, 19:08   #88  |  Link
may24
Registered User
 
Join Date: Jan 2008
Posts: 42
Hi all,
sorry for capturing this thread , but I've a similar issue.
I got a poorly deinterlaced clip here (simple bob().SelectEven() ) with quite a lot of jaggy edges I'd like to fight.
This is not Anime material but captured from a VHS tape.
Your anti-alias-script uses SangNom, but that's for interlaced material - not ?
But my vid is already progressive encoded and now I'd like to reencode plus a bit upsizing.
So what would be the best "way to do it ?"

The original is lost only reencoded vid is here.
TIA
may24 is offline   Reply With Quote
Old 8th August 2013, 03:45   #89  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
my first function, MC DAA3


Code:
#Motion-Compensated Anti-aliasing with contra-sharpening by A.SONY
#some ideas was taken from Didée scripts daa and this http://forum.doom9.org/showthread.php?t=153219
#created because when applied daa3 to fixed scenes, it could damage some details and other issues.
# v3.55

function mcdaa3(clip input) {
sup    = input.HQdn3d().FFT3DFilter().MSuper(pel=2,sharp=1)
fv1    = sup.MAnalyse(isb=false,delta=1,DCT=2,Truemotion=false)
fv2    = sup.MAnalyse(isb=true,delta=1,DCT=2,Truemotion=true)
csaa   = input.daa3mod()
momask1 = input.MMask(fv1, kind = 1, ml=2)
momask2 = input.MMask(fv2, kind = 1, ml=3)
momask = mt_average(momask1,momask2,u=3,v=3)
mt_merge(input,csaa,momask,u=3,v=3)
}


#############################

#Anti-aliasing with contra-sharpening by Didée with some modifications, v3.55

    FUNCTION daa3mod(clip c1, val "slow", int "threads") {
avs25 = VersionNumber() < 2.60
isslod = defined(slow)

slow    = default (slow      , true)
isslob = isbool(slow)
issloi = Isint(slow)
Assert(isslob || issloi, "'slow' only accepts bool or int")
slowb  = isslob ? slow : isslod
threads = default (threads   ,    0)

rescale = slowb && issloi ? slow > -1 : slowb
upsizer = rescale ? issloi ? slow!=0 ? "BilinearResize" : "Spline36Resize" : "Spline36Resize" : nop()
downsizer = slowb ? issloi ? slow!=0 ? "BicubicResize" : "Spline36Resize" : "Spline36Resize" : nop()

c = rescale ? threads!=1 ? Eval("""try { Eval("c1."+upsizer+"mt(c1.width, c1.height*3/2,threads=threads)") } catch(error_msg) { Eval("c1."+upsizer+"(c1.width, c1.height*3/2)") }""") : Eval("c1."+upsizer+"(c1.width, c1.height*3/2)") : c1

    nn      = issloi ? slow > 1 ? c.Padding(slow==2 ? 0 : 4,4,slow==2 ? 0 : 4,4).nnedi3(field=-2,threads=threads).crop(slow==2 ? 0 : 4,4,slow==2 ? 0 : -4,-4) : c.nnedi3(field=-2,threads=threads) : c.nnedi3(field=-2,threads=threads)
 c =isyuy2(c) && avs25 ? c.Interleaved2Planar() : isyuy2(c) ? c.converttoyv16() : c
 nn=isyuy2(nn) && avs25 ? nn.Interleaved2Planar() : isyuy2(nn) ? nn.converttoyv16() : nn
    isslow4 = slowb && issloi ? slow > 3 || slow < -1 : false
    istof   = isslow4 ? c1.getparity : nop()
    seto    = isslow4 ? istof ? selecteven(nn) : selectodd(nn) : selecteven(nn)
    seto    = isslow4 ? threads!=1 ? Eval("""try { Eval("seto."+downsizer+"mt(c.width, c.height,src_top=-0.5,threads=threads)") } catch(error_msg) { Eval("seto."+downsizer+"(c.width, c.height,src_top=-0.5)") }""") : Eval("seto."+downsizer+"(c.width, c.height,src_top=-0.5)") : seto
    sebo    = isslow4 ? istof ? selectodd(nn) : selecteven(nn) : selectodd(nn)
    sebo    = isslow4 ? threads!=1 ? Eval("""try { Eval("sebo."+downsizer+"mt(c.width, c.height,src_top=0.5,threads=threads)") } catch(error_msg) { Eval("sebo."+downsizer+"(c.width, c.height,src_top=0.5)") }""") : Eval("sebo."+downsizer+"(c.width, c.height,src_top=0.5)") : sebo

    dbl     = mt_average(seto,sebo,U=3,V=3)
    dblD    = mt_makediff(c,dbl,U=3,V=3)
    shrpD   = mt_makediff(dbl,dbl.removegrain((width(c)>1100) ? 20 : 11,Planar=true),U=3,V=3)
    DD      = shrpD.repair(dblD,13,Planar=true)
 fd1 = dbl.mt_adddiff(DD,U=3,V=3)

 fd2 = rescale ? threads!=1 ? Eval("""try { Eval("fd1."+downsizer+"mt(c1.width, c1.height,threads=threads"+((downsizer!="Spline36Resize") ? ",b=0.3, c=0.2" : "" )+")") } catch(error_msg) { Eval("fd1."+downsizer+"(c1.width, c1.height"+((downsizer!="Spline36Resize") ? ",b=0.3, c=0.2" : "" )+")") }""") : Eval("fd1."+downsizer+"(c1.width, c1.height"+((downsizer!="Spline36Resize") ? ",b=0.3, c=0.2" : "" )+")") : fd1
 fd3 = isyuy2(c1) && avs25 ? fd2.Planar2Interleaved() : isyuy2(c1) ? fd2.converttoyuy2() : fd2
return fd3
}
I created this script because daa3 when applied to fixed scenes, it could damage some details such as horizontal lines on the screen

like this example:- original - daa3 - mcdaa3

And here apply of daa3 and mcdaa3 on a moving scene:- original -daa3 -mcdaa3

download link (it's old now)

edit1: mcdaa3 and normal daa can deal with ifade too, In fact, the daa function is the remnants Interlaced cleaner after IVTC

edit2: now you can use it like this smam(filter=daa3mod()) , this support YUY2 and more up to date

edit3: since smam now will add daa3mod() is some cases, if you use it like this smam(filter="daa3mod()") it will be 2 daa3mod(), so you must change smam settings like this smam(filter="daa3mod()",usedaa3mod=0)
or use it as I write in "edit2" above, or smam(filter=last)

edit4: if the clip has black border on top or bottom it beter to crop it before using any daa/daa3 method since it will add some Artifacts unless you set slow to -2 or more than 0 (better but slower as you go on with the number)
__________________
See My Avisynth Stuff

Last edited by real.finder; 7th August 2019 at 00:18. Reason: new slow method
real.finder is offline   Reply With Quote
Old 8th August 2013, 14:55   #90  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Isn't it just motion adaptive, instead of motion-compensated? /Or am I reading it wrong, I'm no good at any sort of programming/.
mandarinka is offline   Reply With Quote
Old 8th August 2013, 19:50   #91  |  Link
Pier
Registered User
 
Join Date: Jul 2013
Posts: 29
Quote:
Originally Posted by real.finder View Post
my first function, MC DAA3


Code:
#Motion-Compensated Anti-aliasing with contra-sharpening by A.SONY
#some ideas was taken from Didée scripts daa and this http://forum.doom9.org/showthread.php?t=153219
#created because when applied daa3 to fixed scenes, it could damage some details and other issues.

function mcdaa3(clip input) {
sup    = input.HQdn3d.FFT3DFilter.MSuper(pel=2,sharp=1)
fv1    = sup.MAnalyse(isb=false,delta=1,DCT=2,Truemotion=false)
fv2    = sup.MAnalyse(isb=true,delta=1,DCT=2,Truemotion=true)
csaa   = input.daa3mod
momask1 = input.MMask(fv1, kind = 1, ml=2)
momask2 = input.MMask(fv2, kind = 1, ml=3)
momask = mt_average(momask1,momask2)
mt_merge(input,csaa,momask,u=3,v=3)
}


#############################

#Anti-aliasing with contra-sharpening by Didée with some modifications

    FUNCTION daa3mod(clip c1) {
c = c1.Spline36Resize(c1.width, c1.height*3/2)
    nn      = c.nnedi3(field=-2)
    dbl     = mt_average(selecteven(nn),selectodd(nn),U=3,V=3)
    dblD    = mt_makediff(c,dbl,U=3,V=3)
    shrpD   = mt_makediff(dbl,dbl.removegrain((width(c)>1100) ? 20 : 11),U=3,V=3)
    DD      = shrpD.repair(dblD,13)
return dbl.mt_adddiff(DD,U=3,V=3).Spline36Resize(c1.width, c1.height)
}
I created this script because daa3 when applied to fixed scenes, it could damage some details such as horizontal lines on the screen

like this example:- original - daa3 - mcdaa3

And here apply of daa3 and mcdaa3 on a moving scene:- original -daa3 -mcdaa3

download link
Not sure, but if i remember correctly "HQdn3d()" is faster than "HQdn3d", same for every other filter.
Pier is offline   Reply With Quote
Old 3rd March 2015, 13:31   #92  |  Link
Kein
Registered User
 
Kein's Avatar
 
Join Date: Mar 2010
Posts: 79
Quote:
Originally Posted by real.finder View Post
my first function, MC DAA3


Code:
#Motion-Compensated Anti-aliasing with contra-sharpening by A.SONY
#some ideas was taken from Didée scripts daa and this http://forum.doom9.org/showthread.php?t=153219
#created because when applied daa3 to fixed scenes, it could damage some details and other issues.

function mcdaa3(clip input) {
sup    = input.HQdn3d.FFT3DFilter.MSuper(pel=2,sharp=1)
fv1    = sup.MAnalyse(isb=false,delta=1,DCT=2,Truemotion=false)
fv2    = sup.MAnalyse(isb=true,delta=1,DCT=2,Truemotion=true)
csaa   = input.daa3mod
momask1 = input.MMask(fv1, kind = 1, ml=2)
momask2 = input.MMask(fv2, kind = 1, ml=3)
momask = mt_average(momask1,momask2,u=3,v=3)
mt_merge(input,csaa,momask,u=3,v=3)
}


#############################

#Anti-aliasing with contra-sharpening by Didée with some modifications

    FUNCTION daa3mod(clip c1) {
c = c1.Spline36Resize(c1.width, c1.height*3/2)
    nn      = c.nnedi3(field=-2)
    dbl     = mt_average(selecteven(nn),selectodd(nn),U=3,V=3)
    dblD    = mt_makediff(c,dbl,U=3,V=3)
    shrpD   = mt_makediff(dbl,dbl.removegrain((width(c)>1100) ? 20 : 11),U=3,V=3)
    DD      = shrpD.repair(dblD,13)
return dbl.mt_adddiff(DD,U=3,V=3).Spline36Resize(c1.width, c1.height)
}
I created this script because daa3 when applied to fixed scenes, it could damage some details such as horizontal lines on the screen

like this example:- original - daa3 - mcdaa3

And here apply of daa3 and mcdaa3 on a moving scene:- original -daa3 -mcdaa3

download link

edit: mcdaa3 and normal daa can deal with ifade too, In fact, the daa function is the remnants Interlaced cleaner after IVTC
Which plugins it requires?
Or, rather, do I need to just invoke the functions with empty parameters or I need to specify clip?

Last edited by Kein; 3rd March 2015 at 13:42.
Kein is offline   Reply With Quote
Old 3rd March 2015, 16:13   #93  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Which plugins it requires?
Or, rather, do I need to just invoke the functions with empty parameters or I need to specify clip?
HQDn3D, FFT3DFilter, MvTools v2, Masktools v2, nnedi3. Repair from RemoveGrain.

Code:
function mcdaa3(clip input)
Above tells you everything you need to know (call with named clip or it will use implicit Last clip).

http://avisynth.nl/index.php/External_filters
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 3rd March 2015 at 16:22.
StainlessS is offline   Reply With Quote
Old 3rd March 2015, 16:58   #94  |  Link
Kein
Registered User
 
Kein's Avatar
 
Join Date: Mar 2010
Posts: 79
Quote:
Originally Posted by StainlessS View Post
HQDn3D, FFT3DFilter, MvTools v2, Masktools v2, nnedi3. Repair from RemoveGrain.

Code:
function mcdaa3(clip input)
Above tells you everything you need to know (call with named clip or it will use implicit Last clip).

http://avisynth.nl/index.php/External_filters
Thanks!
Kein 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 05:38.


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