View Full Version : Filters for upscaling to HD - 720p and 1080p re-encoding?
th3obr0
9th March 2009, 01:03
Hey guys,
I need some filters to do some 720p and 1080p encodings. The normal filters for DVD encoding don't make the video look really HD sharp.
I have this family video on a DVD-R which I want to resize to 720p and make it HD sharp and proper to watch it on my HDTV. What filters should I use. I just now RemoveGrainHD serves the purpose, but not fully helps.
Thanks!
PS: I know upscaling is not a good habit, but I want to view it on a better HDTV.
Adub
9th March 2009, 02:18
The thing is, your not going to get real "HD sharp" using an SD source. It's impossible, as it isn't HD. However, what you are searching for is called a sharpener filter. Use search and check out functions such as LimitedSharpenFaster and LSFmod.
Just remember, converting SD to real HD is pure voodoo. It's magic. Alchemy. It's impossible. However, you can upscale your source and retouch using sharpeners and artifact suppressors, but that will never, ever be as good as a video shot in native HD format.
th3obr0
9th March 2009, 06:56
Hmm.. I get that. So how do I do a proper upscaling? I use FFT3D and LSF for sharpening. What else do I need?
Sagekilla
9th March 2009, 07:14
NNEDI is one of the better resizers: NNEDI(0,dh=true).TurnLeft().NNEDI(0,dh=true).TurnRight(). Then just stick a Spline36Resize(1920,1080).
th3obr0
9th March 2009, 23:50
And for proper sharpness and denoising to remove the artifacts?
Okay, what would an AVS be like if you're resizing a SD source?
Sagekilla
10th March 2009, 03:08
I wouldn't resize SD, but if I did it would go like this:
src = last
super = src.MSuper(pel=2)
bvec3 = super.MAnalyse(isb=true, delta=3, overlap=4)
bvec2 = super.MAnalyse(isb=true, delta=2, overlap=4)
bvec1 = super.MAnalyse(isb=true, delta=1, overlap=4)
fvec1 = super.MAnalyse(isb=false, delta=1, overlap=4)
fvec2 = super.MAnalyse(isb=false, delta=2, overlap=4)
fvec3 = super.MAnalyse(isb=false, delta=3, overlap=4)
src.MDegrain3(super, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3)
NNEDI(0,dh=true).TurnLeft().NNEDI(0,dh=true).TurnRight()
LimitedSharpenFaster()
AddGrain(25) # Or use GrainFactory3()
Comatose
10th March 2009, 07:58
NNEDI is one of the better resizers: NNEDI(0,dh=true).TurnLeft().NNEDI(0,dh=true).TurnRight(). Then just stick a Spline36Resize(1920,1080).
A bit off-topic, but why always field=0? I'm not doubting you or anything, I'm just wondering about the logic behind this.
2Bdecided
10th March 2009, 11:21
Because you feed it progressive footage - so there's no field order - so you just treat all the frames as the same field type. It doesn't matter which - as long as you pick one and stick to it. Using the modes that alternate top-field / bottom-field in the interpolation wouldn't work - the resulting footage would bob up and down.
If the source is interlaced, deinterlace properly first.
Cheers,
David.
Sagekilla
10th March 2009, 18:27
You could, if you really wanted to be a rebel, do NNEDI(1,dh=true) on both instances ;) There's no real big difference at all though.
Comatose
11th March 2009, 00:52
I tried this:
ColorBars()
nnedi(field=0,dh=true).TurnRight().nnedi(field=1,dh=true).TurnLeft()
and didn't notice any bobbing motion.
When you upscale with nnedi, the entire image shifts a bit to the side, but doing it this way suppresses the effect a bit... no other noticeable differences.
Gavino
11th March 2009, 11:04
When you upscale with nnedi, the entire image shifts a bit to the side, but doing it this way suppresses the effect a bit... no other noticeable differences.
Since in effect one instance of nnedi resizes vertically and the other horizontally, it doesn't matter if the field parameters are different - no bobbing either way. But the amount of shift (which is both horizontal and vertical) is the same, it just changes direction (right instead of left, or up instead of down) depending on the field.
2Bdecided
11th March 2009, 12:34
Comatose,
From the NNEDI readme.txt...
PARAMETERS:
field -
Controls the mode of operation (double vs same rate) and which field is kept.
Possible settings:
-2 = double rate (alternates each frame), uses avisynth's internal parity value to start
-1 = same rate, uses avisynth's internal parity value
0 = same rate, keep bottom field
1 = same rate, keep top field
2 = double rate (alternates each frame), starts with bottom
3 = double rate (alternates each frame), starts with top
Default: -1 (int)
-2, 2 and 3 will "bob". That's what I meant. 0 and 1 can't "bob" - in the upsizing case, they just determine where the interpolated lines go (like Gavino said).
Cheers,
David.
th3obr0
12th March 2009, 00:37
Wow... great discussion here :D. I haven't reached such heights in scripting, but I am still trying to grasp these things. I hope the discussion goes on and I learn more.
Thanks a lot! :)
halsboss
15th March 2009, 01:34
What are you burning it to, to watch it on your HDTV ?
th3obr0
20th March 2009, 05:02
What are you burning it to, to watch it on your HDTV ?
Yes, and make it better with filters(colors mainly).
halsboss
20th March 2009, 07:08
no, no, what media are you burning it to ? dvd-r, blue-ray, or what ?
ie how are you actually going to play it on your TV, with a DVD player or blue-ray player or what ?
Socio
20th March 2009, 21:08
Another tip,
I seem to get better results resizing to 480p to 720p then run it through a filter script with Limited Sharpen etc.., and then resize to 1080p however it does take a quite a bit longer.
McCauley
21st March 2009, 00:00
Hi,
i wrote a small function to make upsizing with the aforementioned method a bit easier, my avisynth skills are very basic, so please be gentle :o:
##########################################################
## A simple upsizing function based on an idea by Didée ##
## version 0.1 alpha 21 March 2009 ##
## author : McCauley ##
##########################################################
## ##
## dependencies : MVTools2.dll ##
## NNEDI.dll ##
## Repair (included in Removegrain) ##
## warsharp.dll ##
##########################################################
function BlowUp(clip clp, float "sstr", int "exstr", int "exr",int "avgstr",float "agstr", int "avg", \
bool "preblow", bool "nnu", bool "exsharp", bool "ag")
{
sstr = default(sstr, 0.85) # sharpening strength
exstr = default(exstr, 180) # unsharp mask sharpening strength
exr = default(exr, 2) # unsharp mask sharpening radius
avgstr = default(avgstr, 400) # averaging strength
agstr = default(agstr, 12) # grain strength
avg = default(avg, 2) # how many frames are averaged
preblow = default(preblow, true) # upsize before sharpening averaging
nnu = default(nnu, false) # use Lanczos/Repair or NNEDI to upsize
exsharp = default(exsharp, true) # use higher quality sharpener
ag = default(ag, true) # add grain to the final output
ox = clp.width
oy = clp.height
blk = blankclip(clp)
# setting up the clip for the averageing
#---------------------------------------
upsized = (nnu==true && preblow==true) ? clp.NNEDI(0,dh=true).TurnLeft().NNEDI(0,dh=true).TurnRight() \
: (preblow==true && nnu==false) ? clp.LanczosResize(ox*2,oy*2).Repair(clp.Gaussresize(ox*2,oy*2,p=100),1) : clp
# choosing the sharpening method:
#--------------------------------
sharp = (exsharp==true && preblow==true) ? upsized.unsharpmask(exstr,radius=exr,threshold=0) \
: (preblow==true) ? upsized.Sharpen(sstr) : upsized.Sharpen(0.75*sstr)
# doing the temporal averaging
#-----------------------------
src_super = upsized.MSuper(pel=2)
sharp_super = sharp.MSuper(pel=2, levels=1)
bvec2 = (avg ==2) ? src_super.MAnalyse(isb=true, delta=2, overlap=4) : blk
bvec1 = src_super.MAnalyse(isb=true, delta=1, overlap=4)
fvec1 = src_super.MAnalyse(isb=false, delta=1, overlap=4)
fvec2 = (avg ==2) ? src_super.MAnalyse(isb=false, delta=2, overlap=4) : blk
smooth_clp = (avg ==1) ? upsized.MDegrain1(sharp_super, bvec1, fvec1, avgstr) \
: (avg ==2) ? upsized.MDegrain2(sharp_super, bvec1, fvec1, bvec2, fvec2, avgstr) : blk
# upsize the clip if it has not been done before
#-----------------------------------------------
blow_clp= (preblow==false) ? smooth_clp.LanczosResize(ox*2,oy*2).Repair(clp.Gaussresize(ox*2,oy*2,p=100),1) : smooth_clp
# adding grain to create the illusion of detail
#----------------------------------------------
grain_clp = (ag) ? blow_clp.AddGrain(agstr,hcorr=0.3,vcorr=0.3) : blow_clp
return (grain_clp) }
Please report any bugs, or ideas ideas how to improve it.
Examples:
Source.BlowUp(nnu=true).spline36resize(1920,1080)
http://img256.imageshack.us/img256/6372/hq2.th.png (http://img256.imageshack.us/my.php?image=hq2.png) http://img16.imageshack.us/img16/8858/31251472.th.png (http://img16.imageshack.us/my.php?image=31251472.png)
Source.BlowUp(preblow=false).spline36resize(1920,1080)
http://img256.imageshack.us/img256/5681/lq2.th.png (http://img256.imageshack.us/my.php?image=lq2.png) http://img16.imageshack.us/img16/7291/97959241.th.png (http://img16.imageshack.us/my.php?image=97959241.png)
Source.spline36resize(1920,1080)
http://img256.imageshack.us/img256/415/simple2.th.png (http://img256.imageshack.us/my.php?image=simple2.png) http://img17.imageshack.us/img17/3826/simplep.th.png (http://img17.imageshack.us/my.php?image=simplep.png)
Regards
McCauley
Trash Master
21st March 2009, 05:43
I was playing around and came up with a script from other posts. I have never attempted to upsize 480 to 720p. I use MeGui and the time frame to do 1 20 minute cartoon is roughly 1 1/2 days a pass. If everything worked right on my 3rd day it would be complete. Is it normal for the process to take that long?
Trash Master
21st March 2009, 05:52
This is the first day I started using MeGui. I have been a Vdubmod user for years. Here is my script. Keep in mind I am just playing around. If something looks out of place please tell me. I am running a file thru Megui now so I can't change any settings. I was reading some guides and they do not mention (or I missed it) what you are saying. I am not a fan of guides. EDIT: The post before mine is gone. This post may seem a little weird now.
SetMemoryMax(512)
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\Decomb522.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\deblock.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\vinverse.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\dup230\dup.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\mt_masktools-25.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\DctFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\AddGrainC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\TTempSmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\EEDI2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\gradfun2db.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\mvtools2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\nnedi1.3\nnedi.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\RemoveGrainS.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\fft3dgpu.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\MT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\Repair.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\vinverse.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\RSharpenS.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\DenoiseSharpen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\aWarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\RSharpen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\TIVTC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\TDeint.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\ColorMatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\hqdn3d.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Requirements\dfttest.dll")
Import("C:\Program Files\AviSynth 2.5\Requirements\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\Requirements\fastlinedarken.avsi")
Import("C:\Program Files\AviSynth 2.5\Requirements\LSFmod.avs")
Import("C:\Program Files\AviSynth 2.5\Requirements\GradFun2DBmod.avsi")
Import("C:\Program Files\AviSynth 2.5\Requirements\USS.avsi")
Import("C:\Program Files\AviSynth 2.5\Requirements\Toon.avsi")
Import("C:\Program Files\AviSynth 2.5\Requirements\gradfunkmirror.avsi")
mpeg2source("C:\He-Man Disk 1\yo.d2v",info=3,cpu=4,cpu2="ooooxx",iPP=true, moderate_v=20)
Toon()
dfttest(sigma=1.6, tbsize=3)
tdeint(mode=0,order=-1,full=true,field=-1,mthreshL=-3,mthreshC=-3,type=4,sharp=true,mtnmode=2,cthresh=8,blim=100,metric=0,slow=2)
NNEDI(1,dh=true).TurnLeft().NNEDI(1,dh=true).TurnRight()
aWarpSharp(24,4,0.3,1)
fastlinedarken()
LSFmod(Smode=3,Smethod=2,Lmode=1,ss_x=1.0,ss_y=1.0,strength=100,soothe=false)
USS(1232,688)
limitedsharpenfaster(dest_x=1232, dest_y=688)
Addborders(24,16,24,16)
th3obr0
10th June 2009, 00:46
Hi,
i wrote a small function to make upsizing with the aforementioned method a bit easier, my avisynth skills are very basic, so please be gentle :o:
Regards
McCauley
I used it and it does help a bit. I also tried Didee's IIP, but it produces a lot of sharpening. Any plans of updating your script?
*.mp4 guy
10th June 2009, 03:19
It doesn't actually matter what is in (http://www.imagebam.com/image/ff3bec38517984) your source, what matters is presentation (http://www.imagebam.com/image/04607738517980).
Aghora
22nd June 2009, 09:40
I wouldn't resize SD, but if I did it would go like this:
src = last
super = src.MSuper(pel=2)
bvec3 = super.MAnalyse(isb=true, delta=3, overlap=4)
bvec2 = super.MAnalyse(isb=true, delta=2, overlap=4)
bvec1 = super.MAnalyse(isb=true, delta=1, overlap=4)
fvec1 = super.MAnalyse(isb=false, delta=1, overlap=4)
fvec2 = super.MAnalyse(isb=false, delta=2, overlap=4)
fvec3 = super.MAnalyse(isb=false, delta=3, overlap=4)
src.MDegrain3(super, bvec1, fvec1, bvec2, fvec2, bvec3, fvec3)
NNEDI(0,dh=true).TurnLeft().NNEDI(0,dh=true).TurnRight()
LimitedSharpenFaster()
AddGrain(25) # Or use GrainFactory3()
http://i40.tinypic.com/28w15p0.png i am getting this error , which filter should be there in my plugin folder ?
J_Darnley
22nd June 2009, 10:30
MVTools2
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.