bilditup1
11th January 2015, 01:13
Update: Untouched DVD samples can be found here. (http://forum.doom9.org/showthread.php?p=1706279#post1706279)
Hey all!
Background:
So I've decided to try my hand at enhancing my Avatar: The Last Airbender DVDs so they become watchable. Unfortunately, the DVD master suffers from awful edge enhancement, which as resulted in rings/halos everywhere. Worse, these rings and halos jump around during playback. Just bad all around. I have a very old 'TV Rip' of the show as well, which shows no trace of this (but is, ya know, otherwise awful).
I initially planned on simply upscaling the content. But that didn't account for deringing at all, which is not something I've ever had to deal with before (I'm not that adventurous). Thus began much trial and error to find out how to do my best to minimize these rings if not annihilate them entirely.
This is the script I ended up with, after more than fifty iterations:
#SetMT()
SetMemoryMax(4096)
## ...
## ...
## ...
##
## Load video
##
SetMTMode(5,2)
DGDecode_mpeg2source("D:\Ripping\TV\Avatar\Book1-Water\D1\E1\e1.d2v", info=3)
ColorMatrix(d2v="D:\Ripping\TV\Avatar\Book1-Water\D1\E1\e1.d2v",dest=0,interlaced=true,threads=0)
##
## IVTC
##
SetMTMode(2,8)
tfm(order=1).tdecimate(mode=1,hybrid=1)
##
## Deringing/dehaloing
##
DeHalo_alpha(rx=2.0, ry=2.0, darkstr=0.8, brightstr=2.0, lowsens=50, highsens=50, ss=2.0)
DeHalo_alpha(rx=1.0, ry=1.0, darkstr=0.2, brightstr=0.8, lowsens=50, highsens=50, ss=2.0)
warpdering()
warpdering()
HQDeringmod()
##
## Denoising
##
VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0)
##
## Resizing
##
nnedi3_rpow2(rfactor=2,cshift="spline64resize",fwidth=1024,fheight=768,nsize=4,nns=4,qual=1)
##
## Sharpening
##
LSFmod(strength=255,ss_x=2,ss_y=2,Smode=3,Smethod=3)
#LSFmod(strength=255,ss_x=2,ss_y=2,Smode=3,Smethod=3)
##
## Anti-aliasing
##
maa2(mask=-15,chroma=true,aa=64,aac=56,threads=4,show=0)
I guess that looks like a bit of overkill. And I admit I wish I were more familiar with what the scripts I am calling are actually doing and how they work. But I tried to keep it clean, specify dependencies, and not load anything that isn't necessary. I also sorted my plugins folder by author, just to keep in mind that all of this is made possible by a team effort, and that we 'stand on the shoulders of giants'. (Pompous yes, but still true.)
Here's a comparison shot:
Original
http://files.nyu.edu/eb1167/html/screens/rips/avatar/01_katara_orig.jpg
Dehaloed and upscaled
http://files.nyu.edu/eb1167/html/screens/rips/avatar/04_katara_b7-709.jpg
Obviously I'm here because I want to refine this script as best I can. For clarity, I'm going to bullet-point for a bit. First, the basics:
I am not familiar with the comparative advantages of different enlargers (*eedis). But, this is what madVR uses for image doubling, so I thought it was a pretty safe choice, and mostly didn't change the settings.
For resizing, I have also been using Spline64 for years, but don't really know if it's appropriate here and haven't experimented with this recently or in this round.
Using a Spline64Resize alone, instead of in conjunction with image doubling - I did this because I was curious to see what the 640x480 image would look like - results in x264 crashing with code 3. I'm assuming that means I configured something wrong with respect to Avisynth MT. Any ideas? I simply replaced the nnedi3_rpow2() call with a Spline64Resize(640,480). My suspicion is that I left the colorspace conversion command in, and that might not play well at this low resolution; I'm going to double-check now...
Note that I chose 1024x768 because it is very likely these will be played back on iPads, and the simple scaling of 4x that resolution I thought could be marginally beneficial to quality. I'm not sure how true this is...? Otherwise I would maybe try for 960x720 for the space savings (approx 12% fewer pixels).
I am unsure whether or not to convert colorspaces and have read conflicting information about it. According to the Avisynth wiki on colorimetry (http://avisynth.nl/index.php/Colorimetry), playback devices will often assume bt.709 for content with a vertical resolution of 720p or higher, never mind whether or not the file is tagged as bt.601. As a result, I did both, on in 601 and one in 709. I've come across others who have been adamant never to do this. I have not yet calibrated my monitor and am having some trouble with levels, so I'm not really sure if the process is destructive or not. Any effect is pretty subtle - I think a sort of yellow-y shift like the pictures on the colorimetry wiki might be happening, but am not sure.
There is some minor aliasing, from what, I don't quite know. So I stuck an AA filter at the end there. But I have not done extensive trial and error of it yet. I suspect that I could dispense with it though. Thoughts?
Now, the real reason I'm here, the haloing...
Currently the images being produced are definitely sharp enough, but the haloing is not completely dealt with. I'm not sure if that's even possible, but I plan on trying my darndest. I added a denoise (Vague) in there to try to clean up what wasn't picked up, but I don't think that did anything but destroy detail. On that note, there is some pretty bad destruction of detail on the iceberg and the water. I don't really care so much about that, given that the iceberg is just a white background object that you're not really looking too closely at, and the water detail is easy to miss even when it's there. But obviously, that's not always going to be true. (For testing, I have stuck to the first three minutes of the pilot episode of the show, 'The Boy in the Iceberg'). So I'm looking for more effective dehaloing with less destruction. I think this may be asking for the moon, but if some marginal improvement can be made, I'd like to know. If screenshots of the source would help, I will happily provide them.
Note that most of my testing, after figuring out how to avoid making AviSynth MT crash, consisted of using different values for DeHalo_alpha in combination with other deringers. I think I have a pretty good feel of what's a 'good setting' for it, having used extreme numbers and tried out Masked_DHA (which turned out to be much less effective).
It is worth noting that this show is currently airing on the NickToons channel, and, as I said before, the non-DVD master does not appear to suffer from the haloing at all, but is much less sharp. Of course, it will also suffer from whatever logos Nickelodeon decides to plaster on it, unfortunately. But still. I've set up my Windows Media Center DVR to record it, and am thinking...maybe that source and the DVD ripped can be averaged to create the One Avatar Master To Rule Them All? In a manner similar to the cleanups and upscales of the Star Wars 'GOUT' DVDs? Some of those have had pretty phenomenal results given the awful, non-anamorphic, smeared 1993 LD master they came from. I don't really know much about this process, or how aggravating it could be to line them both up and such, and am not sure if the possible gains are worth it, if the logos can be 'masked' away, that sort of thing. I couldn't find decent info on this and would appreciate anything on it. (Though I haven't checked originaltrilogy.com yet, which is the logical place to start...)
Thanks a lot, if you've made it this far. I'm looking forward to learning!
Hey all!
Background:
So I've decided to try my hand at enhancing my Avatar: The Last Airbender DVDs so they become watchable. Unfortunately, the DVD master suffers from awful edge enhancement, which as resulted in rings/halos everywhere. Worse, these rings and halos jump around during playback. Just bad all around. I have a very old 'TV Rip' of the show as well, which shows no trace of this (but is, ya know, otherwise awful).
I initially planned on simply upscaling the content. But that didn't account for deringing at all, which is not something I've ever had to deal with before (I'm not that adventurous). Thus began much trial and error to find out how to do my best to minimize these rings if not annihilate them entirely.
This is the script I ended up with, after more than fifty iterations:
#SetMT()
SetMemoryMax(4096)
## ...
## ...
## ...
##
## Load video
##
SetMTMode(5,2)
DGDecode_mpeg2source("D:\Ripping\TV\Avatar\Book1-Water\D1\E1\e1.d2v", info=3)
ColorMatrix(d2v="D:\Ripping\TV\Avatar\Book1-Water\D1\E1\e1.d2v",dest=0,interlaced=true,threads=0)
##
## IVTC
##
SetMTMode(2,8)
tfm(order=1).tdecimate(mode=1,hybrid=1)
##
## Deringing/dehaloing
##
DeHalo_alpha(rx=2.0, ry=2.0, darkstr=0.8, brightstr=2.0, lowsens=50, highsens=50, ss=2.0)
DeHalo_alpha(rx=1.0, ry=1.0, darkstr=0.2, brightstr=0.8, lowsens=50, highsens=50, ss=2.0)
warpdering()
warpdering()
HQDeringmod()
##
## Denoising
##
VagueDenoiser(threshold=2, method=3, nsteps=6, chromaT=2.0)
##
## Resizing
##
nnedi3_rpow2(rfactor=2,cshift="spline64resize",fwidth=1024,fheight=768,nsize=4,nns=4,qual=1)
##
## Sharpening
##
LSFmod(strength=255,ss_x=2,ss_y=2,Smode=3,Smethod=3)
#LSFmod(strength=255,ss_x=2,ss_y=2,Smode=3,Smethod=3)
##
## Anti-aliasing
##
maa2(mask=-15,chroma=true,aa=64,aac=56,threads=4,show=0)
I guess that looks like a bit of overkill. And I admit I wish I were more familiar with what the scripts I am calling are actually doing and how they work. But I tried to keep it clean, specify dependencies, and not load anything that isn't necessary. I also sorted my plugins folder by author, just to keep in mind that all of this is made possible by a team effort, and that we 'stand on the shoulders of giants'. (Pompous yes, but still true.)
Here's a comparison shot:
Original
http://files.nyu.edu/eb1167/html/screens/rips/avatar/01_katara_orig.jpg
Dehaloed and upscaled
http://files.nyu.edu/eb1167/html/screens/rips/avatar/04_katara_b7-709.jpg
Obviously I'm here because I want to refine this script as best I can. For clarity, I'm going to bullet-point for a bit. First, the basics:
I am not familiar with the comparative advantages of different enlargers (*eedis). But, this is what madVR uses for image doubling, so I thought it was a pretty safe choice, and mostly didn't change the settings.
For resizing, I have also been using Spline64 for years, but don't really know if it's appropriate here and haven't experimented with this recently or in this round.
Using a Spline64Resize alone, instead of in conjunction with image doubling - I did this because I was curious to see what the 640x480 image would look like - results in x264 crashing with code 3. I'm assuming that means I configured something wrong with respect to Avisynth MT. Any ideas? I simply replaced the nnedi3_rpow2() call with a Spline64Resize(640,480). My suspicion is that I left the colorspace conversion command in, and that might not play well at this low resolution; I'm going to double-check now...
Note that I chose 1024x768 because it is very likely these will be played back on iPads, and the simple scaling of 4x that resolution I thought could be marginally beneficial to quality. I'm not sure how true this is...? Otherwise I would maybe try for 960x720 for the space savings (approx 12% fewer pixels).
I am unsure whether or not to convert colorspaces and have read conflicting information about it. According to the Avisynth wiki on colorimetry (http://avisynth.nl/index.php/Colorimetry), playback devices will often assume bt.709 for content with a vertical resolution of 720p or higher, never mind whether or not the file is tagged as bt.601. As a result, I did both, on in 601 and one in 709. I've come across others who have been adamant never to do this. I have not yet calibrated my monitor and am having some trouble with levels, so I'm not really sure if the process is destructive or not. Any effect is pretty subtle - I think a sort of yellow-y shift like the pictures on the colorimetry wiki might be happening, but am not sure.
There is some minor aliasing, from what, I don't quite know. So I stuck an AA filter at the end there. But I have not done extensive trial and error of it yet. I suspect that I could dispense with it though. Thoughts?
Now, the real reason I'm here, the haloing...
Currently the images being produced are definitely sharp enough, but the haloing is not completely dealt with. I'm not sure if that's even possible, but I plan on trying my darndest. I added a denoise (Vague) in there to try to clean up what wasn't picked up, but I don't think that did anything but destroy detail. On that note, there is some pretty bad destruction of detail on the iceberg and the water. I don't really care so much about that, given that the iceberg is just a white background object that you're not really looking too closely at, and the water detail is easy to miss even when it's there. But obviously, that's not always going to be true. (For testing, I have stuck to the first three minutes of the pilot episode of the show, 'The Boy in the Iceberg'). So I'm looking for more effective dehaloing with less destruction. I think this may be asking for the moon, but if some marginal improvement can be made, I'd like to know. If screenshots of the source would help, I will happily provide them.
Note that most of my testing, after figuring out how to avoid making AviSynth MT crash, consisted of using different values for DeHalo_alpha in combination with other deringers. I think I have a pretty good feel of what's a 'good setting' for it, having used extreme numbers and tried out Masked_DHA (which turned out to be much less effective).
It is worth noting that this show is currently airing on the NickToons channel, and, as I said before, the non-DVD master does not appear to suffer from the haloing at all, but is much less sharp. Of course, it will also suffer from whatever logos Nickelodeon decides to plaster on it, unfortunately. But still. I've set up my Windows Media Center DVR to record it, and am thinking...maybe that source and the DVD ripped can be averaged to create the One Avatar Master To Rule Them All? In a manner similar to the cleanups and upscales of the Star Wars 'GOUT' DVDs? Some of those have had pretty phenomenal results given the awful, non-anamorphic, smeared 1993 LD master they came from. I don't really know much about this process, or how aggravating it could be to line them both up and such, and am not sure if the possible gains are worth it, if the logos can be 'masked' away, that sort of thing. I couldn't find decent info on this and would appreciate anything on it. (Though I haven't checked originaltrilogy.com yet, which is the logical place to start...)
Thanks a lot, if you've made it this far. I'm looking forward to learning!