Log in

View Full Version : need help dealing with aliases


egrimisu
18th March 2010, 22:12
i have tryied everything to remove the aliases and i think that that the source was ivtc-ed with a strange method, this animation is quite new and the source is pretty clean, so i don't know how where the aliases came from, BUT THEY NEED TO GO AWAY
the animation is chasseurs de dragons 2004 the series (not the movie from 2008)
sample PAL: http://www.megaupload.com/?d=1W4SJTHU

Dogway
19th March 2010, 15:44
Source doesnt look to have real aliasing issues just the video is overscanned, equally you can improve it with AAA() or Resize it down. Although I still would like to know a dePixel filter if there is out there such the hq2x present in game emulators.

kenpachi
28th March 2010, 16:17
Well, I'm sure the aliasing comes as result of strong interlacing. What I would do is YadifDeint and double SharpAAMCmod() from AnimeIVTC plugin


LoadCplugin("C:\Program Files\VideoAudio\AviSynth 2.5\plugins\yadif.dll")

# SOURCE
mpeg2source(".\1.demuxed.d2v")

Trim(0,50) + Trim(425,476)

# DEINT
Yadif(mode = 0, order = 1)
# Srestore()
# order = -1: field order as Avisynth assumes (default),
# 0: Bottom field first,
# 1: Top field first.

# AA
SharpAAMCmod()
SharpAAMCmod()

#daa() #the fastest
#SangNom(order = 0) #0: top, 1: bottom
#antialiasing()
#AnimeIVTC(mode = 3)

crop(14,4,696,570)
LanczosResize(640,480)


Have You tried it? It gives the best results I managed to achieve.

Didée
28th March 2010, 22:03
You guys are missing half of the problem.


Issue#1: the source suffers from pixel-repeating aliasing, aligned on a horizontal grid, probably caused by usage of a bad resizer. (Similar as: 640x576 -> PointResize(720,576) )

Issue#2: "normal" vertical aliasing, probably due to a poor deinterlacer.

Issue#3: "normal" horizontal aliasing ... probably caused by the resizer of #1. (It smells like GaussResize(p=HUGE).... )



Okay, let's repair the patient.

(Note to the Anime folks: sorry I'm not used to Anime, hence I don't know the Diebs Eintopf ingredients of AnimeIVTC ... and hence, I'm just using simple routines that I know will solve the issue that I see in front of me.)



Source:
http://img338.imageshack.us/img338/8100/mistreatedsource.th.png (http://img338.imageshack.us/i/mistreatedsource.png/) http://img28.imageshack.us/img28/4104/mistreatedsourcezoom.png


"fix1" - Undo the (almost-) pixel repeating horizontal resizer:
http://img208.imageshack.us/img208/130/mistreatedfix1.th.png (http://img208.imageshack.us/i/mistreatedfix1.png/) http://img267.imageshack.us/img267/8206/mistreatedfix1zoom.png


"fix2" - Kill vertical & horizontal aliasing with even/odd-NNEDI2 plus contrasharp:
http://img339.imageshack.us/img339/5531/mistreatedfix1fix2.th.png (http://img339.imageshack.us/i/mistreatedfix1fix2.png/) http://img696.imageshack.us/img696/9725/mistreatedfix1fix2zoom.png


Spice it up with a little peak sharpening:
http://img193.imageshack.us/img193/2356/mistreatedfix1fix2spice.th.png (http://img193.imageshack.us/i/mistreatedfix1fix2spice.png/) http://img98.imageshack.us/img98/2356/mistreatedfix1fix2spice.png



Enough to call it a day.



o = mpeg2source("1.demuxed_(egrimisu).d2v")

fix1 = o.pointresize(672,576,-7,0,721,576).spline36resize(720,576, 7,0,671,576)

fix2 = fix1.NNEDI2AAS().turnleft().NNEDI2AAS().turnright()

fix2.sbr()
mt_makediff(fix2,fix2.removegrain(20)).repair(mt_makediff(last,last.removegrain(4)),1)
shrp = fix2.mt_adddiff(last,U=2,V=2)

interleave(o,fix1,fix2,shrp)

return( last )


#=====================

function NNEDI2AAS(clip o) {
o.NNEDI2(field=-2)
dbl = Merge(SelectEven(),SelectOdd())
dblD = mt_MakeDiff(o,dbl,U=3,V=3)
shrpD = mt_MakeDiff(dbl,dbl.RemoveGrain(20),U=3,V=3)
DD = shrpD.Repair(dblD,13)
dbl.mt_AddDiff(DD,U=3,V=3) }

function sbr(clip c) {
rg11D = mt_makediff(c,c.removegrain(11,-1))
rg11DD= mt_makediff(rg11D,rg11D.removegrain(11,-1)).mt_lutxy(rg11D,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?")
c.mt_makediff(rg11DD,U=2,V=2) }

egrimisu
25th April 2010, 12:34
Now Didee let me congratulate you it realy did a great job, i have another question for you it's written in "the sharp when only needed thread"

P.S. regarding animeivtc, everybody knows that is uses Diebs Eintopf ingredients (as you call it :) ) but for non experienced users it's a simpler solution do deal with comon problems encoutered in animes and all in one place.