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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
Anime upsizer and shadowing? [was: "...and ghosting?"]
Hi all, I am currently trying to produce a 720p version of Mononoke Hime out of my 576p DVD.
The script I'm currently using is producing quite an impressive output, but has a few side effects I'd like to discuss with you in order to get rid of them. Enough with the chat, let's have a look at the screenshots: as a reference, this is a straight 576->720 conversion using lanczos ![]() and this is a 576->720 conversion using my script ![]() the two main problems are 1) that black border on the left of the frame that i can't figure out why does it appear 2) the dark haloes around black lines. they can be found also in the original version so it's not really a "side effect", but in my version they are more annoying since the lines are thinner. any idea on how to get rid of these? I thought about the possibility to mask out the haloed zone, interpolating the chroma channels of the masked zone, then running awarpsharp on those zones and finally merge back the obtained chroma channels on the "edges" clip (see the code below) but it doesn't seem to work. this is the script i'm using. it's annoyingly slow, i know, but speed is not a concern to me: i'm doing this for quality. all code is written from scratch based partially on ideas found on the forum (e.g. warpsharpresize). Code:
function WarpSharpResize(src, width, height, passes) {
d_w = Float(width - src.width) / Float(passes)
d_h = Float(height - src.height) / Float(passes)
return WarpSharpResizer(src, d_w, d_h, passes, Float(src.width), Float(src.height))
}
# this is the recursive internal function - you should not call this (at least, there's no need to do so)
function WarpSharpResizer(src, d_w, d_h, passes, c_w, c_h) {
p_w = Round(c_w + d_w) - (Round(c_w + d_w) % 4) # width should always be mod 4 in YV12
p_h = Round(c_h + d_h) - (Round(c_h + d_h) % 2) # height should always be mod 2 in YV12
return passes > 0 ? WarpSharpResizer(LanczosResize(src, p_w, p_h).aWarpSharp(5, 2), d_w, d_h, passes-1, c_w + d_w, c_h + d_h) : src
}
function CAFtoon(clip src) {
base = spline36resize(src, src.width*4, src.height*4)
edges = WarpSharpResize(src, src.width*4, src.height*4, 8)
lines = generalconvolution(edges.converttorgb32(), 0, "1 2 1 2 -12 2 1 2 1").converttoyv12().greyscale().blur(0.5).tweak(bright=-60, cont=3).blur(0.5)
edgesmask = generalconvolution(src.converttorgb32(), 0, "1 2 1 2 -12 2 1 2 1").converttoyv12().greyscale().blur(1).spline36resize(src.width*4, src.height*4).levels(10, 1, 50, 0, 255)
out = overlay(overlay(base, edges, mask=edgesmask), lines, mode="subtract")
#return lines
#return edges
#return edgesmask
return out
}
setMemoryMax(256)
DirectShowSource("dvd\MH.m2v", fps=25)
AssumeFPS(24)
crop(10, 8, -8, -14)
CAFtoon()
tweak(bright=12)
LanczosResize(1280, 720)
Last edited by CAFxX; 10th July 2006 at 22:45. |
|
|
|
|
|
#2 | Link |
|
phjbdpcrjlj2sb3h
Join Date: Sep 2005
Location: Western Australia
Posts: 1,691
|
EDIT: original post was using unresized imageshack image. I've rewritten the post to actually be relevant and not embarrassing to me
![]() Well, that looks very sharp, in my opinion perhaps oversharp. No, i'm not trying to salvage my previous position, I feel that the lines are far too clinical and artificial for my liking - definately not what the director was wanting you to see. If you absolutely insist on such sharp lines, I'd throw in a slight luma blur to somewhat offset it. Other than that, I think you will also need some denoising, although the reasonably strong warpsharp removes much of the noise, the face still has lots of noise on it, you'll need to add a denoiser at the end of your script. The shadowing will be hard to clean up, a strong spatial denoiser is probably your best shot, but watch you don't blur the background. Temporal blurring will be helpful if there is any grain, I'd suggest you try hqdn3d and the rest of the usual suspects. Last edited by check; 10th July 2006 at 17:19. |
|
|
|
|
|
#3 | Link |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
And btw, as far as bitrate is concerned: my target is a DVD5. The film is about 140 minutes. This means about 4.5 mbit/s.
4 mbit/s for 720-24p animated content with H264 should be enough (my guess, i may be wrong) In the case it ain't enough, I would go for a DVD9. That should definitely be enough. check, btw "Western Australia" where? My sister will spend the next five months there. Last edited by CAFxX; 10th July 2006 at 16:59. |
|
|
|
|
|
#4 | Link | ||
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
Quote:
Another problem is that at the moment I'm using directshowsource to let ffdshow apply post-processing to the input video, since in high-motion scenes blocking is clearly visible. Can anybody suggest an alternative to this? Quote:
I'll try hqdn3d on the input and we'll see. |
||
|
|
|
|
|
#5 | Link |
|
phjbdpcrjlj2sb3h
Join Date: Sep 2005
Location: Western Australia
Posts: 1,691
|
fyi, hqdn3d is the same as the dn3d option in ffdshow with hq checked. I dislike denoising before warpsharping because warpsharp is a bit like a nuke, it changes everything. Personally, I dont like the effect it produces so I don't use it much, but you will definately need a denoiser at the end.
|
|
|
|
|
|
#6 | Link |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
|
|
|
|
|
|
#8 | Link |
|
A CORE Media Player User
Join Date: May 2002
Location: Africa
Posts: 789
|
CAF, what you're doing is a waste of time IMHO.
Upsizing won't create extra details, and when you recompress a DVD you'll be even LOOSING details so...
__________________
Stereo better than 128kbps MP3? Ogg Vorbis at -q2! (~96kbps) / Get the LANCER releases for max conversion speed (at least twice as fast as Lame 3.97!) |
|
|
|
|
|
#9 | Link | |
|
Actually in reserve
Join Date: Oct 2004
Posts: 1,605
|
Quote:
Have you tried Frfun7 ? Thread here: http://forum.doom9.org/showthread.ph...604#post825604 Some pics here: http://forum.doom9.org/showthread.ph...817#post821817 Did
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first Want to exchange on AutoGK? try doom10.org In reserve (inactive) for an undefined period of time. |
|
|
|
|
|
|
#10 | Link | ||
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
Quote:
Quote:
But you know, if I had to choose which one I like most between those two pictures in my first post, I'd say the second one. And since my screen is 1280x1024 (pretty small I know), my projector supports 720p, I got plenty of bitrate and there's no filter on earth capable of doing that during playback I think I might give it a try. Last edited by CAFxX; 10th July 2006 at 20:46. |
||
|
|
|
|
|
#11 | Link | |
|
Registered User
Join Date: Oct 2003
Posts: 217
|
Quote:
I've never understood why people want to "sharpen" some things. You can't create detail that isn't there, and any attempt to do so loses whatever fine detail that is there. |
|
|
|
|
|
|
#12 | Link | |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
Quote:
And, btw, what's the point in saying "try that on a PAL test and you'll see how much your filter sucks". It's not meant for that as much as jpg compression isn't meant to deal with audio. We're not talking about objective quality here (whatever this may or may not mean), but just personal taste. I like it best. Everything else is - I beg your pardon for the term - bullshit, since it's OT. Last edited by CAFxX; 10th July 2006 at 23:30. |
|
|
|
|
|
|
#13 | Link |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
Now for those who are still interested in helping: here's the screenshot of frame 80259 in all its 576p beauty. (Yes, the DVD has that black border).
The only difference from the original source is that, being a PNG, the colorspace has been converted to RGB. ![]() Tomorrow I'll post the video. Be patient. Right now I'm pretty busy watching the huge celebration we're having down in Rome. There are 700000 (and counting) people out there. Last edited by CAFxX; 10th July 2006 at 22:47. |
|
|
|
|
|
#14 | Link | |
|
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
Quote:
the one i've got at the moment is NTSC->PAL converted and multiangled, so action sequences can look a little off... in spite of about a hundred segment re-encodes that went into it.
__________________
sucking the life out of your videos since 2004 |
|
|
|
|
|
|
#16 | Link |
|
Registered User
Join Date: Feb 2004
Location: USA
Posts: 1,348
|
Script:
Code:
ImageSource("42jf.png").Converttoyv12(matrix="PC.709")
MultiSWAR(1280, 720, warper=false, StepRatio=8, Sharpen=8, Smoothing=true, Sthresh=8, Sstrength=.9, EDetail=false, NthPass=true)
Result (PNG) Script (sharper): Code:
ImageSource("42jf.png").Converttoyv12(matrix="PC.709")
MultiSWAR(1280, 720, warper=false, StepRatio=8, Sharpen=8, Smoothing=true, Sthresh=8, Sstrength=.9, EDetail=true, Esharp=0.5, FDetail=0, NthPass=true)
Result (PNG) Script (smoother): Code:
ImageSource("42jf.png").Converttoyv12(matrix="PC.709")
MultiSWAR(1280, 720, warper=false, StepRatio=8, sharper=true, Sharpen=8, Smoothing=true, Sthresh=8, Sstrength=1.2, EDetail=true, Esharp=0.5, FDetail=0, NthPass=true)
Result (PNG) Script (smoothest): Code:
ImageSource("42jf.png").Converttoyv12(matrix="PC.709")
MultiSWAR(1280, 720, warper=true, StepRatio=8, sharper=true, Sharpen=16, Smoothing=true, Sthresh=8, Sstrength=1, EDetail=false, Esharp=0.5, FDetail=0, NthPass=true)
Result (PNG) Last edited by *.mp4 guy; 11th July 2006 at 09:24. |
|
|
|
|
|
#17 | Link |
|
Angel of Night
![]() Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,569
|
You probably can't really get rid of those shadows, because they're present in the original (it looks like a lot of color bleed and a littel luma bleed is the main deal). You might be able to minimize it by first running dehalo_alpha on it, before attempting to sharpen, but that also softens some details.
I wonder how you can live with such aliased results, but to each their own.
|
|
|
|
|
|
#18 | Link |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
I left my PC doing a little test encode on a different sequence using hqdn3d(2, 1.5, 6, 4.5) and it's definitely not good. The BGs gets devastated. And i think that, if hqdn3d managed to keep at least a good amount of detail on the BG of the screenshot above and produces such a disaster in this other case, MultiSWAR will behave even worse (your first PNG screenshot shows less detail than mine in the BG, and the second shows too much artifacts on the face). Anyhow, I'll give it a try. Who knows, maybe I'm wrong.
Next test will be hqdn3d with spatial denoising disabled. |
|
|
|
|
|
#20 | Link |
|
Stray Developer
Join Date: Mar 2003
Location: Italy
Posts: 82
|
Tried deactivating spatial denoising and BGs are just little (almost unnoticeably) more blurry than without hqdn3d().
Still, it has problems with moving BGs. Will try to lower the temporal strenght as well (and maybe reactivating sliglthly spatial denoising). Other anime denoisers? No-one ever attempted to write a filter/function able to identify flat color areas? BTW, I tried to output at 720x404 and that already looks really great. EDIT: I'm currently uploading about 2 minutes of the raw mpeg2 stream to my site. It is around 130mb, and will likely be ready to be downlaoded in an hour. http://www.n-side.it/public/CAFxX/MH.mpg. I won't leave it there forever, so fetch it ASAP. EDIT2: Done uploading. Last edited by CAFxX; 11th July 2006 at 15:20. |
|
|
|
![]() |
|
|