b. Blu-ray Sources

While Blu-ray sources tend to be easier to work with compared to DVD, the quality of the video is still dependent on the source that it was mastered from. They are often mastered from one of the following source types; upscales, film, and high definition digital media. While most Blu-rays tend to already have clean or remastered video, each source type may require a different set of filters to help touch up the visual quality. Many sources will also need to crop to remove any blank space from the edges. The order for the crop function variables is left, top, right, bottom; the right and bottom variables require negative values.

(IMPORTANT: Make sure to refer to an aspect ratio calculator when cropping to avoid distortion. The default color space for DVDs will require cropping by multiples of 2.)

A. Upscaled Source
B. Film Source
C. HD Digital Source

A. Upscaled Source

This actually one of the most common source types for anime due to the fact that even today many series are animated at resolutions lower than 1920×1080 and are upscaled in post production. This often leaves pixelated artifacts along the edges, especially when there are contrasting colors, and Santiag is recommended for handling this. Below is an example of this visual flaw and an AviSynth script for correcting it.

Before Filtering

Upscale Aliasing

AviSynth Script Example

#Input video
LWLibavVideoSource("FMAB_t04.mkv")
#Remove Aliasing
santiag(strv=1,strh=1,type="sangnom")

VapourSynth Script Example

#Import VapourSynth Core
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
#Input video
video = core.lsmas.LWLibavSource(r'FMAB_t04.mkv', format="YUV420P8")
#Remove Aliasing
video = haf.santiag(video,strv=1,strh=1,type="sangnom")
#Sets Video Output
video.set_output()

After Filtering

Upscale Aliasing Removed

B. Film Source

These sources are digitally captured from the film and many are also remastered to remove visual defects. Usually they have very few defects, aside from film grain and possibly color banding on gradients, so minimal filtering is needed to improve the visual quality. MDegrain, which is part of MVTools, is recommended for handling sources with heavy amounts of film grain. Below is an example of this visual flaw and an AviSynth script for handling it.

Before Filtering

Film Grain

AviSynth Script Example

#Input video
LWLibavVideoSource("Ghost_in_the_Shell_t00.mkv")
#Removes heavy film grain by reading two frames back and ahead
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

VapourSynth Script Example

#Import VapourSynth Core
import vapoursynth as vs
core = vs.get_core()
#Input video
video = core.lsmas.LWLibavSource(r'Ghost_in_the_Shell_t00.mkv', format="YUV420P8")
#Removes light noise and minor blocking by reading two frames back and ahead
super = core.mv.Super(video, pel=2, sharp=1)
backward_vec2 = core.mv.Analyse(super, isb = True, delta = 2, overlap=4)
backward_vec1 = core.mv.Analyse(super, isb = True, delta = 1, overlap=4)
forward_vec1 = core.mv.Analyse(super, isb = False, delta = 1, overlap=4)
forward_vec2 = core.mv.Analyse(super, isb = False, delta = 2, overlap=4)
video = core.mv.Degrain2(video, super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thsad=400)
#Sets Video Output
video.set_output()

After Filtering

Film Grain Removed

Other film sources may only contain light film grain, however gradients and subtle color changes may contain color banding. Using a Spatio-Temporal filter such as FFT3DFilter or FFT3DGPU is recommended to reduce noise and Flash3kyuu Deband for handling any color banding. Below is an example of these visual flaws and an AviSynth script for correcting them.

Before Filtering

Color Banding

AviSynth Script Example

#Input video
LWLibavVideoSource("LAIN_t01.mkv")
#Removes film grain and smooths the image
strength = 2
FFT3DFilter(bw=6, bh=6, ow=3, oh=3, plane=0, bt=1, sigma=strength)
FFT3DFilter(bw=216, bh=216, ow=108, oh=108, plane=0, bt=1, sigma=strength/8, sigma2=strength/4, sigma3=strength/2, sigma4=strength)
#Removes banding by dithering
Flash3kyuu_deband()

VapourSynth Script Example

#Import VapourSynth Core
import vapoursynth as vs
core = vs.get_core()
#Input video
video = core.lsmas.LWLibavSource(r'LAIN_t01.mkv')
#Removes film grain and smooths the image
strength = 2
video = core.fft3dfilter.FFT3DFilter(video, bw=6, bh=6, ow=3, oh=3, plane=0, bt=1, sigma=strength)
video = core.fft3dfilter.FFT3DFilter(video, bw=216, bh=216, ow=108, oh=108, plane=0, bt=1, sigma=strength/8, sigma2=strength/4, sigma3=strength/2, sigma4=strength)
#Removes banding by dithering
video = core.f3kdb.Deband(video)
#Sets Video Output
video.set_output()

After Filtering

Color Banding Removed

C. HD Digital Source

High definition digital sources typically have very few defects and require minimal filtering to touch up the visual quality. The most common artifact you will encounter will be color banding from insufficient dithering of gradients and Flash3kyuu Deband is recommended for correcting this visual flaw. Below is an example of this visual defect and an AviSynth script that addresses it.

Before Filtering

Color Banding

AviSynth Script Example

#Input video
LWLibavVideoSource("Haruhi_t00.mkv")
#Removes banding by dithering
Flash3kyuu_deband()

VapourSynth Script Example

#Import VapourSynth Core
import vapoursynth as vs
core = vs.get_core()
#Input video
video = core.lsmas.LWLibavSource(r'Haruhi_t00.mkv')
#Removes banding by dithering
video = core.f3kdb.Deband(video)
#Sets Video Output
video.set_output()

After Filtering

Color Banding Removed
Some sources animated digitally in high definition may contain added film grain for style. That type of video can be handled the same way in which film sources are handled. Refer to that section for filter ideas and example scripts.

Advertisements