Log in

View Full Version : AnimeIVTC() - All-in-one solution for interlacing and blending - v2.00 [2010-01-07]


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21] 22 23 24 25

Gavino
16th April 2010, 18:44
Second, I've change variable call ordering to remove "I don't know what "l01" means" error:

l10 = jmp ? l01 : l_v
l01 = jmp ? l12 : l_v
l12 = l_v
to

l12 = l_v
l01 = jmp ? l12 : l_v
l10 = jmp ? l01 : l_v
But that sets everything to l_v, regardless of the value of jmp, so will give incorrect results. When jmp is true, l01/l12 should be defined from the previous frame, and copied to l10/l01 respectively. Similarly for c10, etc. So you (or thetoof) need to find out why the "I don't know what "l01" means" error actually occurs.

thanhtu5013
18th April 2010, 19:42
Hi.
At first sorry for my poor english because I'm french.
I'm looking for antialiasing filters for Avisynth and I've found this thread.
Unfortunately, I don't know how to use AnimeIVTC. I'm interested only in anitialiasing function.
I made some captures videos of GTA IV and there has a lot of aliasing.
I know how to create a script but my mines are usually very simple and short. Long scripts are so hard for me.

Someone could help me ?

Thanks by advance.

Leinad4Mind
19th April 2010, 03:21
you have a function I have made that simplify that.

Check http://forum.doom9.org/showthread.php?t=153835

;)

thanhtu5013
19th April 2010, 09:58
you have a function I have made that simplify that.

Check http://forum.doom9.org/showthread.php?t=153835

;)
Thanks a lot Leinad4Mind. :)

I watched your script and I have some questions:

- Your script is very long. Does all sentences are wrote ONLY for anti-aliasing and improve it ?
- My script is the following :


AVISOURCE("C:\GTA IV_ENB Series 0.079 SORA - 02 - It'S Your Call_1080p.avi)
ConvertToYV12(matrix="PC.709")


I suppose I have just to add your script below my mine and deleting sentences with "#", right ?

- On your thread, you posted a pack with reguired plugins but there has one guy complaining about missing x64 plugins...
I have Windows 7 64 bits so does your pack will work with me ?

Thanks again for this amazing huge work. :)

thanhtu5013
19th April 2010, 10:36
@Leinad4Mind.

I made my script and it works on VirtualDub and MeGui but unfortunately there has no effects in my video... :confused:
There has still a lot of aliasing... :eek:

Watch my screens.

- Original AVI :
http://img697.imageshack.us/img697/1253/screenoriginal.png

- My script :
http://img21.imageshack.us/img21/636/screenretouched.png


My code:

AVISOURCE("C:\GTA IV_ENB Series 0.079 SORA - 02 - It'S Your Call_1080p.avi")

FUNCTION LSharpAAF(clip orig, int "StrDrk", int "ShPre", int "ShPost", int "SmPost", string "aatype"){
StrDrk = default(StrDrk,38) #FastLineDarkenMOD
ShPre = default(ShPre,80) #Presharpening
ShPost = default(ShPost,300) #Postsharpening
SmPost = default(SmPost,100) #Postsmoothing
aatype = default(aatype,"EEDI2") # Use EEDI2() or Sangnom() or maa() or daa() or ediaa() or aaa() or saa() or splinaa() or supaa() or naa() or shaarp() or nnedi() or nnedi2() or antialiasing() for anti-aliasing.
a=orig.AssumeTFF()
w=width(a)
h=height(a)
m=logic(a.DEdgeMask(0,255,0,255,"5 10 5 0 0 0 -5 -10 -5", divisor=4,Y=3,U=3,V=3)
\ ,a.DEdgeMask(0,255,0,255,"5 0 -5 10 0 -10 5 0 -5", divisor=4,Y=3,U=3,V=3)
\ ,"max").greyscale().levels(0,0.8,128,0,255,false)
b=a.fastlinedarkenmod(thinning=0, strength=StrDrk)
b=(aatype=="EEDI2") ? b.TurnLeft().EEDI2().TurnRight().EEDI2().spline64resize(w,h,0.5,-0.5,2*w+.001,2*h+.001) : (aatype=="Sangnom") ? b.spline36resize(w*2,h*2).TurnLeft().SangNom(aa=255).TurnRight().SangNom(aa=255).spline36resize(w,h) : (aatype=="maa") ? b.maa() : (aatype=="daa") ? b.daa() : (aatype=="ediaa") ? b.ediaa() : (aatype=="aaa") ? b.aaa() : (aatype=="saa") ? b.SAA() : (aatype=="splinaa") ? b.splinaa() : (aatype=="supaa") ? b.supaa() : (aatype=="naa") ? b.naa() : (aatype=="shaarp") ? b.shaarp() : (aatype=="nnedi") ? b.NNEDI(dh=true,field=1).TurnRight().NNEDI(dh=true,field=1).TurnLeft().Spline36Resize(w,h) : (aatype=="nnedi2") ? b.nnedi2(dh=true,field=1) : (aatype=="antialiasing") ? b.antialiasing() : blankclip(pixel_type="YV12").subtitle("Please use Sangnom, EEDI2, maa, daa, ediaa, aaa, ssa, splinaa, supaa, naa, shaarp, nnedi, nnedi2 or antialiasing for aatype")
b=b.LSFMod(edgemode=1,strength=ShPost,overshoot=1,soft=SmPost)
mt_merge(a,b,m,Y=3,U=3,V=3)
sD=mt_makediff(a,last)
bv1 = a.MVAnalyse(isb=true, delta=1,idx=13)
bv2 = a.MVAnalyse(isb=true, delta=2,idx=13)
fv2 = a.MVAnalyse(isb=false,delta=2,idx=13)
fv1 = a.MVAnalyse(isb=false,delta=1,idx=13)
sDD = sD.MVDegrain2(bv1,fv1,bv2,fv2,idx=14)
reduc = 0.4
sDD = mt_lutxy(sD,sDD,"x 128 - abs y 128 - abs < x y ?").mergeluma(sDD,1.0-reduc)
a.mt_makediff(sDD,U=2,V=2)
return last
}

FUNCTION ediaa(clip a) {
return a.EEDI2(field=1).TurnRight().EEDI2(field=1).TurnLeft().spline36resize(a.width,a.height,-0.5,-0.5) }

FUNCTION daa(clip c) {
nn = c.nnedi2(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) }

FUNCTION saa(Clip Clp,Int"SS",Bool"CP") {
OX = Clp.Width
OY = Clp.Height
SS = Default(SS,2)
CP = Default(CP,True)
Clp = Clp.IsYV12() ? Clp : Clp.ConvertToYV12()
Clp.PointResize(OX*SS,OY*SS).SangNom().TurnRight()
\ .SangNom().TurnLeft().BilinearResize(OX,OY)
CP ? Last : MergeChroma(Clp)
Return(Last) }

FUNCTION maa(clip input, int "mask") {
mask = input.mt_edge("sobel",7,7,5,5).mt_inflate()
aa_clip=input.spline36Resize(width(input)*2,height(input)*2).TurnLeft().SangNom().TurnRight().SangNom().spline36Resize(width(input),height(input)).MergeChroma(input)
return mt_merge(input,aa_clip,mask) }

FUNCTION AAA(clip clp, int "Xres", int "Yres", int "Xshrp", int "Yshrp",
\ int "US", int "DS", bool "chroma")
{
clp = clp.isYV12() ? clp : clp.ConvertToYV12()
ox = clp.width
oy = clp.height
Xres = default(Xres, ox)
Yres = default(Yres, oy)
us = default(us, 1)
ds = default(ds, 2)
Xshrp = default(Xshrp, 15)
Yshrp = default(Yshrp, 15)
chroma = default(chroma, false)

us==0 ? clp.PointResize(ox*2,oy*2) : clp.LanczosResize(ox*2,oy*2)

TurnLeft()
SangNom()

TurnRight()
SangNom()

ds==0 ? BilinearResize(Xres,Yres) :
\ ds==1 ? BicubicResize(Xres,Yres) :
\ LanczosResize(Xres,Yres)

Unfilter(Xshrp,Yshrp)

chroma ? MergeChroma(clp.Lanczosresize(Xres,Yres)) : last }

FUNCTION antialiasing(clip orig,int "th_luma",int "th_croma",string "type",int "aath") {

th_luma = Default(th_luma, 20)
th_croma = Default(th_croma, 20)
type = Default(type, "sobel")
aath = Default(aath, 48)
ox = orig.width
oy = orig.height
dx = orig.width * 2
dy = orig.height * 2
clp = orig.IsYV12() ? orig : orig.ConvertToYV12()

a=clp
b=clp.Lanczos4Resize(dx,dy).TurnLeft().SangNom(aa=aath).TurnRight().SangNom(aa=aath) \
.LanczosResize(ox,oy)
c=clp.EdgeMask(th_luma,th_luma,th_croma,th_croma,type)
MaskedMerge(a,b,c) }

FUNCTION splinaa(Clip Clp,Int"SS",Bool"CP") {
OX = Clp.Width
OY = Clp.Height
SS = Default(SS,2)
CP = Default(CP,True)
Clp = Clp.IsYV12() ? Clp : Clp.ConvertToYV12()
Clp.PointResize(OX*SS,OY*SS).SangNom().TurnRight()
\ .SangNom().TurnLeft().Spline36Resize(OX,OY)
CP ? Last : MergeChroma(Clp)

Return(Last) }

FUNCTION supaa(Clip Clp,Int"SS",Bool"CP") {
OX = Clp.Width
OY = Clp.Height
SS = Default(SS,2)
CP = Default(CP,True)
Clp = Clp.IsYV12() ? Clp : Clp.ConvertToYV12()
Clp.nnedi2_rpow2(rfactor=SS,cshift="spline36resize",qual=3).SangNom().TurnRight()
\ .SangNom().TurnLeft().Spline36Resize(OX,OY)
CP ? Last : MergeChroma(Clp)

Return(Last) }

FUNCTION naa(Clip Clp,Int"SS",Bool"CP") {
OX = Clp.Width
OY = Clp.Height
SS = Default(SS,2)
CP = Default(CP,True)
Clp = Clp.IsYV12() ? Clp : Clp.ConvertToYV12()
Clp.nnedi2_rpow2(rfactor=SS,cshift="spline36resize",qual=3).nnedi2(qual=3).TurnRight()
\ .nnedi2(qual=3).TurnLeft().Spline36Resize(OX,OY)
CP ? Last : MergeChroma(Clp)

Return(Last) }

FUNCTION shaarp(clip input, int "mask", int "type") {
mask = Default(mask,1)
type = Default(type,1)
Assert(mask == 1 || mask == 2, "Please use mask = 1 or 2")
Assert(type == 1 || type == 2, "Please use type = 1 or 2")
aa_clip = (type == 1) ? input.spline36Resize(width(input)*2,height(input)*2) : input.nnedi2_rpow2(rfactor=2,qual=3)
aa_clip = aa_clip.TurnLeft().nnedi2().TurnRight().nnedi2().spline36Resize(width(input),height(input)).MergeChroma(input)
mask = (mask==1) ? input.mt_edge("sobel",7,7,5,5).mt_inflate() : input.mt_edge("roberts",0,4,0,4).mt_inflate()

return mt_merge(input,aa_clip,mask) }


P.S: Maybe we should continue our conversation in your thread instead of here. :)

Ghostlamer
8th May 2010, 12:58
Hello.
Could you explain how to determine Hard Telecine, Double Hard telecine and others..
Thanks.

Somewhere was a manual for this, but i can not find.

Nightshiver
8th May 2010, 14:50
You have not tried to find it at all. Go to the first page.

boxXx
9th May 2010, 16:00
i keep getting this error message i don't know how to fix it, it's really bugging me, its working in AvsP but when i try to qeue it in Megui it gives me this : http://www.imagebam.com/image/7366a379845674

here's my script :
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\SRestore.avs")
LoadPlugin("C:\Program Files\MeGUI\tools\dgindex\DGDecode.dll")
DgDecode_mpeg2source("G:\ShinChan\D1\1\VideoFile.d2v", info=3)
AnimeIVTC(mode=2,aa=2)
crop( 0, 0, -8, -2)
Spline36Resize(656,480)
trim(20000,22000)

Vitaliy Gorbatenko
12th May 2010, 08:52
It is possible to automatically find and fix antialiased interlaced frames?
On lastest DVD it's a big problem =(

Leinad4Mind
12th May 2010, 16:33
It seems to me that u have fix this.

And I don't think that this task is possible. And impossible tasks... is for someone called didée LOOOOL

But after deinterlace if u got some interlace on some frames u can try to apply vinverse() after the telecine.

Like this: "tfm(order=-1,clip2=res,pp=7,slow=2,mode=2,chroma=false,display=false).tdecimate(hybrid=1,mode=0,vfrDec=0).vinverse() #Inverse Telecine + Vinverse post-processing"

Don't know if this is really your problem...

Vitaliy Gorbatenko
12th May 2010, 17:26
I'm don't fix this!!! It's a different (next) frame.
Problem of there and it is quite serious.

Leinad4Mind
12th May 2010, 18:42
Send me the d2v+m2v+script using, I will take a look.

Vitaliy Gorbatenko
13th May 2010, 18:15
Script is simple:

# SOURCE
path_to_d2v="S:\..\t_01.d2v"
# SOURCE
mpeg2source(path_to_d2v, cpu2="oooooo", info=3)
colormatrix(interlaced=true, hints=true)
#
animeivtc(mode=1,aa=0) #the upcoming aa=4 also leads to very good results

Samples here: http://www.mediafire.com/?jwjm4kym4wk

Vitaliy Gorbatenko
14th May 2010, 05:26
Sample 2 HAS problemm. 1 broken frame.
http://img63.imageshack.us/img63/8002/0100124575.png
Anime: To love ru TV
I don't have the source from which taken the first example.
Unfortunately such moments there are many recent R2 DVD. And we must somehow learn to find and bypass / repair this.

Ghostlamer
14th May 2010, 17:13
You have not tried to find it at all. Go to the first page.
Detailed manual about anime telecining(like in v1) is not there.

http://img143.imageshack.us/img143/8207/82465690.th.png (http://img143.imageshack.us/i/82465690.png/)

Nightshiver
14th May 2010, 22:09
The only difference is in the operations, not in how you determine the source. Use the v1 to learn how to tell the difference. Yes, so clever using a screenshot from the v2 faq. Heck, just use the search function for this forum and you'll get several different but accurate ways to learn sources, it's not that hard. If you need the v1 faq, say so and I'll upload it.

LaughingMan
17th May 2010, 19:40
When I'm using chrfix to filter defect which you can see in pictures

without chrtfix:
http://img100.imageshack.us/img100/1106/moo02b.png

with chrtfix:
http://img63.imageshack.us/img63/3723/moo02a.png

in this script:
AnimeIVTC(mode=1, chrfix=true, aa=1, omode=1, credconv="blend", e1=40368, i1=42723, e2=43469)
crop(8, 0, -8, 0)

#resize
#denoise

I get this message in final encode:
http://img202.imageshack.us/img202/3331/idontknow.jpg

So could anyone help me? Thanks.

Vitaliy Gorbatenko
19th May 2010, 05:55
LaughingMan: I'm have a same error/message.

Error on Credit's :
http://www.mediafire.com/?ztmjlznwjwn

script:
mpeg2source(path_to_d2v, cpu2="oooooo", info=3)
animeivtc(mode=1,aa=0)#, killcomb=0, ifade=true)

How to fix it ?

Great Dragon
19th May 2010, 14:31
When I'm using chrfix to filter defect which you can see in pictures
chrfix is broken. It has been discussed on previous page.
http://forum.doom9.org/showthread.php?p=1392244#post1392244

animeivtc(mode=1,aa=0)#, killcomb=0, ifade=true)
remove )#

Vitaliy Gorbatenko
19th May 2010, 17:21
Great Dragon: I'm test this options - no hope =(
PS: I'm don't think that the script is broken - becouse video is rendered. I'm think it is a some kind of warning..

Nightshiver
19th May 2010, 22:57
You are misunderstanding the point, Vitaliy. The script, AnimeIVTC itself is not broken. The function within the script, chrfix, is. By broken, I don't mean "not going to work and give you error screens", I mean, will give you a result, just not the right one. It currently can't be fixed because thetoof is on hiatus somewhere.

Vitaliy Gorbatenko
20th May 2010, 03:40
Nightshiver: Tnx =) But i'm more care about http://forum.doom9.org/showthread.php?p=1401056#post1401056 . For fix chroma exist a special plugins =)

Great Dragon
20th May 2010, 13:54
@Vitaliy Gorbatenko: What kind of error do you have exactly?
For fix chroma exist a special plugins
And what is those?

Nightshiver
20th May 2010, 23:16
I think the "special plugin" he might be referring to is SRestore, as I can only gather that from the link you gave to the previous pages: http://forum.doom9.org/showthread.php?p=1392244#post1392244

Vitaliy Gorbatenko
21st May 2010, 03:29
Chroma correction: http://avisynth.org/mediawiki/External_filters#Chroma_correction
For my issue no responce T_T

Great Dragon
21st May 2010, 06:24
Chroma correction: http://avisynth.org/mediawiki/Extern...oma_correction
None of those can deal with chroma blending or chroma swap between fields.

@Nightshiver: In my case (http://forum.doom9.org/showthread.php?p=1391241#post1391241) Srestore isn't work :( And even chroma_rep() (http://forum.doom9.org/showthread.php?p=1268074#post1268074) can't get rid of it. I've tried various combinations of filters (bobers and teleciners) with no results.

ghscreenki
25th May 2010, 11:49
Hello again!

I have trouble fixing this R2 source. This source has a lot of bad areas like interlaced frames that are immune to AnimeIVTC's deinterlacing. It can be fixed by deleting that bad frame and replace it with a previous good frame but only works on static scenes though. On scenes with movement, it's a different story.

Here's the source:

http://img229.imageshack.us/img229/2127/source.png

And this is the result of this scene using "mode=1":

http://img717.imageshack.us/img717/2535/sample1r.png

I really don't know how to fix this. I tried using mode=4 to see how it does and this is the result (i1=xxx or p1=xxx):

http://img339.imageshack.us/img339/7515/sample2o.png

mode=4 produced a better result but the problem is still there.

Help!

Nightshiver
25th May 2010, 16:43
As always, post a sample.

ghscreenki
26th May 2010, 00:35
As always, post a sample.
Whoops. Kept on forgetting. Here's the clip:

http://www.megaupload.com/?d=GXKKQ8ZT

manono
26th May 2010, 03:44
Since both fields of the frames involved show that stuff, nothing's ever going to fix it. Is that very short scene the only place where that kind of thing occurs?

ghscreenki
26th May 2010, 03:58
Since both fields of the frames involved show that stuff, nothing's ever going to fix it. Is that very short scene the only place where that kind of thing occurs?
It's a short scene around 2 seconds and so far, that's the only scene with that kind of problem.

manono
26th May 2010, 08:06
Well, you could use FreezeFrame to replace the bad frames with good frames from either side, which will make it look nice but play slightly jerky, or you could use the BadFrames filter to replace those really nasty ones with blends of the nearby good frames (the way I'd probably do it). That'll give you blends, but nicer looking blends. As far as I know, there's no way to entirely fix the problem.

ghscreenki
27th May 2010, 05:30
Don't want any jerkiness so I tried BadFrames() and surprisingly, it's better.

http://img690.imageshack.us/img690/7942/sample3q.png

Didn't fix everything but it's better than the other attempts. =) Thanks!

clone83
26th June 2010, 20:30
Hi guys, I'm hoping that you will be able to help me? when i try and load my script i get this error:

AviSynth script error:
Script error: Invalid arguments to function "ediaa"
(C:\AviSynth 2.5\plugins\AnimeIVTC\AnimeIVTC 2.00.avsi, line 427)

The script im trying to use is:

animeivtc(mode=5, omode=2, aa=1, precision=1)

please help...

clone83
27th June 2010, 22:22
if you need more info just say so and i will post it up... sort of need this fixed asap. thx guys

Gavino
27th June 2010, 23:33
animeivtc(mode=5, omode=2, aa=1, precision=1)
According to the documentation, mode must be between 1 and 4.
Pity that the code does not validate this, leading to such an obscure error.

clone83
28th June 2010, 11:59
from what i have found out so far its all to do with the aa settings... any number i put in, it doesnt work.

Gavino
28th June 2010, 13:42
from what i have found out so far its all to do with the aa settings... any number i put in, it doesnt work.
Do you mean you have tried with a mode other than 5?
What combinations have you tried? Do you always get the same error?

clone83
29th June 2010, 11:30
i have tried it without aa and mode 5 works but as soon as i add any number into aa (1-4) i get errors for each one as it tries to call the external plugin but it doesnt work.

Gavino
29th June 2010, 14:05
i have tried it without aa and mode 5 works
It only 'works' by accident (in the sense that no error message is produced) and even then I'm not sure if the results are meaningful.
As I said, there is no mode 5, only modes 1-4 are defined.

Unfortunately, the function code does not check for a valid mode and anything outside the expected range will produce undefined results (including spurious errors as various variables do not have their correct value).
This could have been prevented if the author had included a simple validity check.

ghscreenki
2nd July 2010, 09:39
I have a very bad frame right before the scene changes and I want to get rid of it but I can't because I'll be clipping off a part of the animation (movement). I don't want to use BadFrames() with "blend=true" because it will blend in the next frame (which is a scene change) and I can't use "blend=false" either because it's just like DeleteFrame and DuplicateFrame - copies the previous frame. Is there a way for me to duplicate a specific frame and put it somewhere in the source other than putting the copied frame next to the original frame?

Gavino
2nd July 2010, 10:08
Is there a way for me to duplicate a specific frame and put it somewhere in the source other than putting the copied frame next to the original frame?
FreezeFrame (http://avisynth.org/mediawiki/FreezeFrame)(bad, bad, good)
where 'bad' is the number of the frame you want to replace, and 'good' is that of its replacement.

ghscreenki
2nd July 2010, 11:10
FreezeFrame (http://avisynth.org/mediawiki/FreezeFrame)(bad, bad, good)
where 'bad' is the number of the frame you want to replace, and 'good' is that of its replacement.

Woah! It worked like a charm! :thanks:

Overdrive80
3rd July 2010, 14:19
One question, with this filter, would i do convert 30i to 30p?

manono
3rd July 2010, 16:13
One question, with this filter, would i do convert 30i to 30p?
You don't need AnimeIVTC for that, just a deinterlacer.

boxXx
12th July 2010, 13:34
Could someone help me out getting the right settings for this sample ?
i've tried multiple ways of de-interlacing this but it never seems to be correct ( Using AIVTC ofcourse :P ).

http://www.megaupload.com/?d=PNTXT2N2

Thanks alot for the help !

boxXx
15th July 2010, 00:38
anybody ? :P

manono
15th July 2010, 00:46
The file you are trying to access is temporarily unavailable.
It said the same yesterday.

And 90 MB is quite a lot. Usually a well chosen 10 seconds is plenty. Try MediaFire or Sendspace.

boxXx
15th July 2010, 10:41
Sorry for not cutting it down to 10 secs, i really have to leave now, here is the Mediafire link :

http://www.mediafire.com/download.php?5d2mtmdltmwytz4

boxXx
17th July 2010, 18:35
once again, please ? :P