PDA

View Full Version : one crazy anime sharpening script


aiataga
23rd September 2004, 22:15
after fighting with deinterlace (sort of NTSC->PAL) and temp/spatial cleaning got blurry and deint artefaced result.

The only way to antialaze and sharpen it is:

a=avisource("E:\LAPITCH\aa.003.avi")
w = a.width
h = a.height

BilinearResize(a,w*2,h*2).Lanczos4Resize(w,h)
BilinearResize(w*2,h*2).Lanczos4Resize(w,h)
BilinearResize(w*2,h*2).Lanczos4Resize(w,h)
Lanczos4Resize(w*2,h*2).Lanczos4Resize(w,h)
Lanczos4Resize(w*2,h*2).Lanczos4Resize(w,h)
LimitedSharpen(ss_x=2.0,ss_y=2.0,Smode=3,strength=127,wide=true
\,radius=2,overshoot=1,soft=false,edgemode=1,Lmode=1)
LimitedSharpen(ss_x=2.0,ss_y=2.0,Smode=3,strength=127,wide=true
\,radius=2,overshoot=1,soft=false,edgemode=1,Lmode=1)
Lanczos4Resize(w*2,h*2).Lanczos4Resize(w,h)

# LimitedSharpen() form
# http://forum.doom9.org/showthread.php?s=&threadid=74900


yep it 0.5 FPS on 2.5 P4 buy it works fine(?) for me.
Now it's better then the DVD source.

i think for the next pass it need some temporal soften (again!) and
FastLineDarken (from http://forum.doom9.org/showthread.php?s=&threadid=82125)

i'v got 20000 frmes throw this filter chain already. (9h of hard work!)

any better methods?

[Edit]
adding pics
before:
http://hometown.aol.com/suurruum/images/6000s.jpg
after filter
http://hometown.aol.com/suurruum/images/6000d.jpg

lamer_de
23rd September 2004, 23:33
Why don't you throw away all that supersampling and try to tweak limitedsharpen so that it delivers the same or a very similar result. Cause I doubt all those supersampling steps without applying any filters on the supersampled image improve sharpness much. Usually you only supersample to be able to use a filter at otherwise unhealthy strengths.

CU,
lamer_de

Ark
24th September 2004, 09:47
Wow, a script at "mf-speed"! :)

Didée
24th September 2004, 11:11
I suspect that your deinterlacing procedure is not optimal. You should at least post your deinterlacing script, and also some before-/after-deinterlacing screenshots. I'm quite sure the animee & deinterlacing experts here have something to tell.

But just for fun, I've made a little function for you:
function AiatagaBilinearUpLanczos4DownMultiResizerCrazyness( clip clp, int countnn )
{
ox=clp.width
oy=clp.height
countnn = countnn>0 ? countnn-1 : 0

clp = countnn>0 ? AiatagaBilinearUpLanczos4DownMultiResizerCrazyness( clp, countnn ) : clp
out=clp.BilinearResize(ox*2,oy*2).Lanczos4Resize(ox,oy)

return out
}


This one will let you do as much of these up/downsizing steps in a row, as the stack can only handle ;)

For example, "AiatagaBilinearUpLanczos4DownMultiResizerCrazyness(50)" will do 50 times up- and downsizing ...

:D

Soulhunter
24th September 2004, 14:38
:confused:

Mug Funky
24th September 2004, 16:03
didee, you could do 2 passes of that script before you've finished typing in that function :eek:

aiataga
24th September 2004, 16:12
@Didée :D

yep. the reason to do so are deinterlacing artifacs.

the source is horrible. i think its interlaced NTSC -> bad deinterlace -> interlaced PAL (?)
:mad:

had to choose different deint filters by hand on separal parts and some by choosing fields from diff frames (thanx anime is mostly 12fps).
the smartdeint script dont manage to do good job. sometimes on one frame consist of messed 3 frames.

with the "BilinearResize(a,w*2,h*2).Lanczos4Resize(w,h)"
cascade got rid of steppings (and some 2d smoothening too without edge smearing)

Mug Funky
26th September 2004, 06:47
could you post a sample cut out of the vob file? i collect "problem samples".

what disc and region code is it?

aiataga
26th September 2004, 17:48
lets try some quick links

source:
http://publish.hometown.aol.com/suurruum/images/3496s.jpg
after deint and "this filter"
http://publish.hometown.aol.com/suurruum/images/3496d.jpg

and
http://publish.hometown.aol.com/suurruum/images/923s.jpg
and
http://publish.hometown.aol.com/suurruum/images/923d.jpg

@ Mug Funky
for sample vob working on webspace

Didée
27th September 2004, 00:02
Seems as if it should be possible to do some cleaning of the artefacts, by temporal edgemasking. We'll see.

aiataga
27th September 2004, 08:45
it's newer too late ...
addeded filtering example

aiataga
27th September 2004, 18:14
Originally posted by Mug Funky
could you post a sample cut out of the vob file? i collect "problem samples".

there's the sample
http://web.starman.ee/aldoaiaste/pics/sample.vob 1.36MB

Lapitch, the Little Shoemaker
Region: R2(?) (coz local release, only 2 languages)