View Full Version : Processing oversized and shrinking for quality ?
sys32768
2nd February 2019, 01:41
This is a newbie question, so bear with me. I was admiring https://www.youtube.com/watch?v=w4Et9f7k4Fs and noticed that to my eye in some ways it looks better in 1080p mode than the 4k mode because in 1080p a lot of grain and dust is gone, yet a lot of detail remains.
It had me thinking as I struggle with grain on my 8mm HD sources, has anyone done processing on doubled resolution as a technique?
For example, if I doubled my 1920x1080 sources and performed some smoothing and blending operations (somehow blending the grain blocks together), then resized back to 1920x1080, might that not generate a cleaner, smoother result?
I'm guessing there's probably a name and a plugin for this already. Can anyone point me to it or an experiment that may have been done already?
FranceBB
3rd February 2019, 01:56
has anyone done processing on doubled resolution as a technique?
Sure.
For example, if I doubled my 1920x1080 sources and performed some smoothing and blending operations (somehow blending the grain blocks together), then resized back to 1920x1080, might that not generate a cleaner, smoother result?
What you mean is Supersampling and it's a pretty legitimate question to ask as some filters may get better results at higher resolutions and that's what Supersampling means: upscaling, filtering, downscaling.
http://avisynth.nl/index.php/Supersampling
For instance, one of the filters that takes advantage of Supersampling is LSFMod, one of my favorite sharpening filter.
In your case, I understand that your issue is about grain.
Keep in mind that there are two kind of de-grain: spacial and temporal.
Spacial takes advantage of the neighbouring pixels (4x4 blocks etc) and uses differences between these blocks.
Temporal takes advantage of the same pixels (4x4 blocks etc) on different frames.
Generally, degrain filters consider grain what is in high frequencies using transforms like the Fourier transform by assigning values to frequencies and getting rid of them depending on the threshold you set.
What I'm gonna suggest you is actually MDegrain as temporal degrain with the following settings:
super = MSuper(pel=2, sharp=1)
bv1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
fv1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
bv2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
fv2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super,bv1,fv1,bv2,fv2,thSADC=800, thSAD=800)
MAnalyse is gonna "analyse" the blocks of the frames and MDegrain2 is gonna use the analysis to degrain the video.
Try to play around with settings and reduce thSADC and SAD 'till you find a pleasant result.
If you don't find a good result with MDegrain, you can try with dfttest which works both on 8bit and 16bit stacked. I suggest to filter at 16bit stacked in order to have more precision and avoid to introduce banding (banding is one of the most common artifacts that you can have with noise reduction) and then apply dithering to go back to your desired bit depth (8 bit, 10bit etc). If you don't know how to filter at 16bit stacked, check Dither Tools. Please, keep in mind that these are pretty strong settings and they will probably remove details as well:
dfttest(sigma=64, tbsize=1, lsb_in=true, lsb=true, Y=true, U=true, V=true, opt=3, dither=0)
Last - but not least - another good denoise filter is FFT3D. It's a little bit old and I've used it a lot in the past, like years ago, but I believe it still works fine for old sources:
FFT3DFilter(sigma=3.0, beta=1.0, plane=4, bw=16, bh=16, ow=8, oh=8, bt=3, kratio=3.0, sharpen=1.0, scutoff=0.3, svr=1.0, smin=4.0, smax=30.0, measure=true, interlaced=false, wintype=0, degrid=1.0, dehalo=1.0, hr=2.0, ht=50.0, ncpu=1)
#change ncpu= (threads)
Oh, almost forgot, you need FFTW as well, as it's a library to make Fourier Transform calculations; you can find updated binaries here on Doom9: https://forum.doom9.org/showthread.php?t=174470
p.s I don't think that Supersampling helps in this case, but if you want to, try nnedi3_rpow2 to double the resolution of the video and then downscale back to your desired output resolution.
http://avisynth.nl/index.php/Nnedi3/nnedi3_rpow2
sys32768
4th February 2019, 22:20
Thank you! This is great information to work with.
I remember the "supersample" filter on the Scummvm game emulator which made the old low-res games have smoother rendering.
My source files seem to be fairly blurry so I was favoring the unsharp filter which really brought out the grain.
When I've done some experimenting I will post results and further questions.
FranceBB
5th February 2019, 03:58
My source files seem to be fairly blurry so I was favoring the unsharp filter
If you need to sharp, use LSFMod. There are many tweakable parameters and it's my favorite sharpening filter.
I've been using it since 2008.
sys32768
5th February 2019, 06:31
In case anyone wants some "raw" Regular-8 16fps ProRes 1920x1080 .mov footage (scanned on FlashScanHD) to play with, this link (https://1drv.ms/f/s!AkeySxbVM_V_lJs69EQAB9p_3huXjQ) contains just under 2m from circa 1956. Beware the file is 2.1gb. These are the sources I am working with although some are crisper than others.
algia
8th February 2019, 15:48
Hi
I Played with your source and this is the scrip
you can try to change tuning setting
video=LWLibavVideoSource("C:\Users\alojal\Documents\InAvisynth\22014_8mm_9-01.mov", format="YUV420P8")
audiook=LWLibavAudioSource("C:\Users\alojal\Documents\InAvisynth\22014_8mm_9-01.mov", av_sync=true)
audio=MergeChannels(audiook, audiook, audiook, audiook)
AudioDub(video, audio)
Crop(184, 0, -184, -0)
super = MSuper(last)
vecb = MAnalyse(super,isb=true)
vecf = MAnalyse(super,isb=false)
MFlowFps(last,super,vecb,vecf,num=25000,den=1000,blend=false)
ConverttoRGB()
GamMac(dither=true, LockChan=-3, Scale=2, RedMul=1.0, GrnMul=1.0, BluMul=1.0, loTh=0.0, hiTh=0.0, LockVal=128, RngLim=12, GamMax=10.0, omin=16, omax=235, Show=false, Coords=false)
Converttoyv12()
Coloryuv(autoGain=True)
autoadjust(scd_threshold=12, temporal_radius=20, use_interp=true, use_dither=true, high_quality=true, high_bitdepth=false, threads_count=0, asm_opt=2, debug_view=false, auto_gain=true, dark_limit=1.50, bright_limit=1.50, gamma_limit=1.50, dark_exclude=0.0, bright_exclude=0.0, gain_mode=1, chroma_process=200, avg_safety=0.25, auto_balance=true, chroma_limit=2.0, balance_str=1.0)
DeSpot(p1=1, p2=2, mthres=10, p1percent=5, dilate=1, fitluma=true, blur=1, tsmooth=127, motpn=true, seg=0, color=true, mwidth=8, mheight=8, merode=33, interlaced=false, show=0, show_chroma=false)
DeScratch(mindif=1, asym=10, maxgap=3, maxwidth=3, minlen=90, maxlen=2048, maxangle=5, blurlen=15, keep=30, border=2, modeY=3, modeU=3, modeV=3, mindifUV=0, mark=false, minwidth=1)
ResampleAudio(48000)
ConvertAudioTo24bit()
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)
Spline64ResizeMT(1920, 1080)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.