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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th February 2016, 19:49   #1  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Can I improve this source more?

Hi there. I'm trying to remaster an old Super Mario Bros. anime movie, and the best source avaiable looks like this:



(Watch it online HERE (without the Chinese subtitles). I'm not sure if I would break the forum rules by sharing the source file with you.)

I'm not very experienced with Avisynth, so I asked for help in Fòrum Animelliure and I was advised to use ASharp and AWarpSharp2, and this is the best we thought we were able to get:



Code:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\Plugins\awarpsharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\Plugins\asharp.dll")
FFVideoSource("C:\Users\magiblot\Desktop\mario.wmv", fpsnum=25, fpsden=1)
Tweak(hue=0.0,sat=2,bright=4,cont=1.7)
Levels(0,0.7,255,0,255)
ASharp(1.5)
AWarpSharp(37.0)
Yesterday (more than a year later) I got an idea: I could improve it by downscalng the source first and filtering it, then upscaling it and filtering it again. After a couple of tries, I got this:



Code:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\Plugins\awarpsharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\Plugins\asharp.dll")
FFVideoSource("C:\Users\magiblot\Desktop\mario.wmv", fpsnum=25, fpsden=1)
Tweak(hue=0.0,sat=2.1,bright=4,cont=1.7)
Levels(0,0.7,255,0,255)
Spline64Resize(384,288)
ASharp(1)
AWarpSharp()
Spline64Resize(960,720)
ASharp(1)
AWarpSharp()
Spline64Resize(768,576)
Which is much better than the first restored version and still more than the source.

As you can see, the main defect of the source is that it seems badly filtered and borders look quite unfocused, in addition to the deficient color, brightness, contrast and gamma levels.

By aplying the filters after downscaling I've been able to improve the borders a lot. Now I'm going to explain you how I chose the resolutions. 384x288 is half the original resolution, and it has given the best results to me. 960x720 is a 720p resolution to make it HD when uploading to YouTube and make it keep more bitrate. And 768x576 is the original resolution, in order to compare it to the previous scripts I used (thought it looks better at this resolution than at 720p).

If tried other combinations before (like resizing secondly to 576p and filtering, and then resize to 720p and filter again) but this is the best I've been able to get.

I'm planning to release this last restored version soon, so I would like to ask the experts (you) for advice before doing it.

Do you think it can be improved more? How would you do it?

Thanks for the help. And excuse me if my English is not correct.

Last edited by magiblot; 10th February 2016 at 19:59. Reason: Fixed images
magiblot is offline   Reply With Quote
Old 10th February 2016, 22:23   #2  |  Link
`Orum
Registered User
 
Join Date: Sep 2005
Posts: 178
There are a lot of recommendations I have, many of them that apply for restoration in general and not this particular clip.
  • In regard to your idea: "I could improve it by downscalng the source first and filtering it, then upscaling it and filtering it again." Don't resize! While there are legitimate uses for resizing algorithms, they are few and far between. For restoration purposes, the only time I can see wanting to ever use one is if you're doing some chroma upscaling (e.g. 4:2:0 to 4:4:4). Also, simply doing a downscale then upscale (without your suggested filtering) is effectively a low-pass filter (equivalent to luma subsampling), and there are many better ways to remove noise.
  • Personally I stay well away from using aWarpSharp, as it tends to slaughter fine details. While your source doesn't have much fine detail, it will also remove fine gradients at line edges which results in aliasing, especially at the strengths you're using it at (look at the line between Luigi's hat and his face, or the nose lines). Also, aWarpSharp tends to narrow dark lines, and this can be seen in your filtering. All in all, I see it more as an "effect" filter than a legitimate way to repair or improve a source.
  • While we're on the subject of sharpening, it should be one of last filters you apply, if you do it at all. About the only thing that should be done after sharpening is dithering. The reason for this is it will exaggerate noise that should have been cleaned up with earlier filters. In general, I recommend being very gentle with a sharpening filter as they will produce noticeable haloing at higher strengths (or aliasing and detail loss in warpsharp's case).
  • Speaking of noise, you have some serious chroma noise and bleeding. The bleeding is particularly noticeable on Luigi's overalls (blue) next to his yellow shirt, as these colors are effectively opposites in the YCbCr plane (much as they are to the human eye). Proper noise removal is entirely dependent on the source material, and without seeing a few seconds of the source material I can't make any recommendations of what to use with certainty. But, the chroma bleeding will probably not be easy to address, though the noise in the skin tones might not be too hard to clean up.
  • Also when cleaning up noise, make sure you understand the difference between temporal noise and spacial noise, and the relevant differences in temporal and spacial filters respectively. While spacial filters can clean up temporal noise, they're not the best way to do so, and vice-versa.

In general your filter chain should look something like this, but keep in mind, you won't necessarily include all steps, and there may be some additional steps for some footage: Source -> Dot Crawl Removal -> IVTC (for TC'ed sources) -> Levels Conversion (e.g. TV to PC, tweak, etc.) -> Cleaning (denoising) -> Dehaloing -> Sharpening (gently!) -> Dithering
__________________
My filters: DupStep | PointSize

Last edited by `Orum; 11th February 2016 at 00:17.
`Orum is offline   Reply With Quote
Old 12th February 2016, 16:32   #3  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Quote:
Originally Posted by `Orum View Post
[...]
Thanks for your advise, but I haven't been able to fix the video by using the plugins for the points you say, so I have carried on working with my method.

Due to the bad quality of the source, I think using AWarpSharp and resizing are both necessary to recover the borders, in spite of losing details. However, I agree with you in the fact I was using the filter very strongly. Now I have set the filter properly with the help of AvsPmod. I have also partially fixed the chroma bleeding:

Original:



Original + Color tweak:



Color tweak + Filtered + Chroma bleeding fixed:



Color tweak + Filtered:



Color tweak + Filtered + Chroma bleeding fixed:



I strongly believe it's way better now.

New script:

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\Plugins\awarpsharp2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\Plugins\asharp.dll")
FFVideoSource("C:\Users\magiblot\Desktop\mario.wmv", fpsnum=25, fpsden=1)
Tweak(hue=0.0,sat=2.1,bright=4,cont=1.7)
Levels(0,0.7,255,0,255)
Spline64Resize(384,288)
ASharp(0.0,11.0)
AWarpSharp(10.0,3,0.9,2)
Spline64Resize(960,720)
ASharp(32.0,0.1,-0.9,true)
AWarpSharp(39.9,1,0.3,2)
Spline64Resize(768,576)
MergeChroma(awarpsharp2(depth=25))
ChromaShift(C=0, U=6, V=2, L=0)
PS: I'm trying to obtain a new source I've just found which wasn't avaiable when I was working on this movie a year and a half ago (http://www.youtube.com/watch?v=QSbME1HyC1w / http://www.youtube.com/watch?v=djSURRfEzDk). If I get it, I'll work to improve that version instead.

Last edited by magiblot; 12th February 2016 at 16:41. Reason: Added end note
magiblot is offline   Reply With Quote
Old 13th February 2016, 16:31   #4  |  Link
`Orum
Registered User
 
Join Date: Sep 2005
Posts: 178
Well, if you can get a better source that's always the best place to start.

I don't understand the appeal of low-passing your source when a filter like dfttest will likely do a better job without killing detail (though I admit there's not much to kill).

I still recommend avoiding aWarpSharp. Look particularly at the bricks and the power/telephone lines in the second and third of the new screenshots you posted. In the second image (presumably before warp sharpening) everything still looks square, like the source. Then look at the bricks after your "chroma bleeding fix" and notice how they no longer look square, and have some "barrel" distortion. Also, the power/phone line has been deformed above the bat and where it passes through the numbers, and no longer appears straight, and the bat looks thinner as well.

Also, you still have a fair amount of chroma noise (look at Peach in your second series of new screenshots), which I suspect could be removed with a temporal filter, but I'd have to see the source to be sure. It does look like the chroma bleeding is mostly taken care of though, and once the noise is cleared up it should look very good.

Edit: Thinking about your lines some more, your source seems like a perfect example of where a standard deconvolution (sharpening) filter would be terribly useful, though the ideal algorithm and parameters to use will require some experimentation. I'd try that instead of warp sharpening.
__________________
My filters: DupStep | PointSize

Last edited by `Orum; 13th February 2016 at 16:44.
`Orum is offline   Reply With Quote
Old 23rd February 2016, 02:43   #5  |  Link
sephirotic
Registered User
 
Join Date: Apr 2008
Posts: 19
You are following a common trend with people still discovering all the potentials of Avisynth:
OVERFILTERING, specially overshapening!

If I could only give a single recommendation to you would be: "Stop overfiltering!"

I second what Orum sugested: Avoid the urge of aWarpsharpening everything (and other forms of sharpenings too). Awarpsharp completely destroys edge details. Just look at the bricks from the second example. On the original they lock like proper bricks, on the second, they are so unevenly thinned, that they started to look like roof tiles! Same goes for the bat of they boy, it doesn't look like a bat anymore, but like a stick.

The last couple of images, you removed the left yelowish chroma bleeding but added blueish right chroma bleeding instead. Not all chroma bleeding is due to chroma shift (like in poor VHS telecine), they can often be result of Poor lenses on the telecine machine and they are indead, chromatic aberration.
A simple chromashift or the old "fixchromableeding" filter won't help, easiest way to fix it is using awarpsharp2 ONLY ON THE CHROMA PLANE. (chroma=4).

Like Orum noticed, I also suggest trying to remove that awful yellowish chroma noise, you can start trying SMDegrain (tr=2, thsad=400, refinemotion=true, prefilter=3, plane=3) to see if it helps.

Well, those are my suggestions

Also, the pictures look yellowish overall and lacking blue channel on a quick RGB parade analysis. I'd suggest venturing with the curves plugin and bumping the blue channel a little bit more. For that, you'll need to download and import the Gradation plugin from VirtualDub, a little bit complicated to load, but still faster than loading the clip and grading it scene by scene on premiere.

Last edited by sephirotic; 23rd February 2016 at 02:47.
sephirotic is offline   Reply With Quote
Old 6th June 2016, 15:59   #6  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Hello there, thank you very much for the suggestions.
Finally I got an alternative video source, of less resolution but better quality, and I have started working with the project again.

This time I have decided not to upscale the source nor to overfilter it. So, this is what I have done up to now:

1.Source / 2.Filtered





The new script is this (I do not include 'levels' and 'tweak', as they have different settings for different scenes):

Code:
ASharp(0.0,10.0)
Spline64Resize(960,720)
ASharp(32.0,0.1,-0.9,true)
AWarpSharp(39.9,1,0.3,2)
Spline64Resize(480,360)
gradfun2db(thr=2.0)
DeBlock(quant=25, aOffset=0, bOffset=0)
FFT3DFilter(Sharpen=1.0, sigma=5.0, interlaced=false)
ChromaShift(C=0, U=6, V=2, L=0)
MergeChroma(awarpsharp2(depth=20))
As I see it, the use I make out of ASharp and AWarpSharp is effective against the artifacts caused by the low bitrate of the source. Regarding the chroma bleeding problem, I will make an additional correction for the scenes that need it.

What do you think of it?

Last edited by magiblot; 8th June 2016 at 17:24.
magiblot is offline   Reply With Quote
Reply

Tags
anime, awarpsharp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.