Log in

View Full Version : Can this aliasing be fixed?


Avisynth_challenged
30th October 2008, 08:17
Hello all,

I have a video which exhibits aliasing, especially on diagonal lines and slopes. The video is a cleaned up laserdisc capture of a live action movie.

I trimmed a sample clip, put it in a zip archive, *and uploaded it to Rapidshare* (http://rapidshare.com/files/158908337/aliasing_yv12.zip). Rapidshare will allow it to be downloaded up to 10 times.

Details on the sample clip:
720x480, 23.976fps progressive, YV12 colorspace (encoded with ffdshow's Huffyuv codec), 30 frames long, no audio.

I'm thinking of upscaling this video vertically so as to encode it to 16:9 anamorphic MPEG2... but I figure first I had better sort out the aliasing, before I change any of the vertical properties of this video.

If anyone cares to help out, I'd be most appreciative. And thanks for reading.

:thanks: :thanks: :thanks:

Dark Shikari
30th October 2008, 08:29
If you need a host that doesn't have any download limitations, try Mediafire.

octavarium
30th October 2008, 15:18
I can't seem to open this file. Huffyuv is crashing when loading this clip, but try this antialiasing script and see if it helps:
function antialiasing( clip orig, int "th_luma", int "th_croma", string "type", int "order", int "aath", bool "HQedge")
{

# "th_luma" and "th_croma" affect directly the edge detection: higher values = more edges filtered
# set "order = 0" for Top Field First; order = 1 --> Bottom Field First
# aath = anti-aliasing strenght (default should be fine)


th_luma = Default(th_luma, 20)
th_croma = Default(th_croma, 20)
type = Default(type, "sobel")
order = Default(order, 1)
aath = Default(aath, 48)
HQedge = Default(HQedge, false)
ox = orig.width
oy = orig.height
dx = orig.width * 2
dy = orig.height * 2

orig.convertToYV12()
a=last
b=lanczos4Resize(dx, dy).TurnLeft().SangNom(order,aath).TurnRight().SangNom(order,aath)

# native chroma edges:
#c=b.lanczosresize(ox,oy).EdgeMask(0, th_luma, 0, th_croma, type,Y=3,U=3,V=3)

# use luma edges for chroma:
c=b.lanczosresize(ox,oy).EdgeMask(0, th_luma, 0, th_croma, type,Y=3,U=1,V=1).FitY2UV()

d= logic( b.DEdgeMask(0,255,0,255,"5 10 5 0 0 0 -5 -10 -5", divisor=4,Y=3,U=1,V=1)
\ ,b.DEdgeMask(0,255,0,255,"5 0 -5 10 0 -10 5 0 -5", divisor=4,Y=3,U=1,V=1)
\ ,"max").greyscale.levels(0,0.8,128,0,255,false).FitY2UV().lanczosresize(ox,oy)
b=b.lanczosresize(ox,oy)

HQedge ? MaskedMerge(a,b,d,Y=3,U=3,V=3) : MaskedMerge(a,b,c,Y=3,U=3,V=3)
}
just save as "antialiasing.avsi" and drop it into your plugins folder.

Avisynth_challenged
30th October 2008, 16:44
Thanks for the responses thus far :)


If you need a host that doesn't have any download limitations, try Mediafire.


If the 10 download limit prevents anyone from accessing the clip, reply to this thread and I will upload it to Mediafire. I've used Rapidshare before, and they imposed no d/l limits back then. Glad to hear about alternatives... thanks Dark Shikari.

vampiredom
31st October 2008, 06:37
Another possibility, including the 16x9 anamorphic output:

avisource("aliasing_yv12.avi")

# crop black from edges
Crop(8,90,-8,-90)

# double the height and then back down to original size
eedi2(field=0, pp=0, maxd=12, mthresh=10, lthresh=20, vthresh=20, nt=50)
GaussResize(704, 300, p=50)

# double the height and then scale to 16:9 anamorphic
eedi2(field=0, pp=0, maxd=12, mthresh=10, lthresh=20, vthresh=20, nt=50)
GaussResize(704, 400, p=50)

# pad to 720x480
AddBorders(8,40,8,40)