shmups.system11.org

Shmups Forum
 
* FAQ    * Search
 * Register  * Login 
It is currently Wed Aug 23, 2017 6:03 am View unanswered posts
View active topics



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: best upscaling algorithm in VirtualDub for retro games
PostPosted: Sun Mar 19, 2017 11:05 pm 


User avatar

Joined: 08 Mar 2015
Posts: 1949
Location: Québec City
Here is the list I got in VirtualDub 1.10.4, which one is the best for upscaling 240p graphics?

Nearest neighbor
Bilinear (interpolation only)
Bicubic (interpolation only)
Precise bilinear
Precise bicubic (A=0.75)
Precise bicubic (A=0.60)
Precise bicubic (A=1.00)
Lanczos3

I know I could render 1 of each and take snapshots and compare, but that would take a good while and if somebody already has the answer to this and don't mind sharing, it would save me a lot of time and efforts.

Thanks!


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Sun Mar 19, 2017 11:31 pm 


User avatar

Joined: 06 Mar 2006
Posts: 10513
Location: Germany
You do a next neighbour upscale to about 2x your target size (and keep it integer) and then a precise bilinear downscale to your target resolution.


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Sun Mar 19, 2017 11:51 pm 


User avatar

Joined: 08 Mar 2015
Posts: 1949
Location: Québec City
Thanks! Woah I've got a ton of questions now.
Wait : so I need to upscale and then downscale? are you messing with me lol

What is target resolution exactly? the final size I'll be uploading to Youtube? For me that would be 720p (1280x720)
Also, I capture at 720x240p, but linedouble in Amarec. So the file I import in VirtualDub is 720x480

So I should next neighbor upscale 3X integer (2160x1440) and then precise bilinear downscale to 1280x720?
Can I put both these filter in the same rendering process? or should I do them separately


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Mon Mar 20, 2017 8:12 am 


User avatar

Joined: 06 Mar 2006
Posts: 10513
Location: Germany
When you're capturing at 720x240 your horizontal sampling isn't perfect anyway, so the result won't be perfect, unless you downscale to the physical resolution first. To do so you're cropping away the overscan first and then do a NN downscale to the physical resolution of your source (e.g. 256 pixels for SNES). Then you upscale using NN and downscale using Prec.BL.

If you're using a codec with reduced color sampling (e.g. 4:2:2) I would do the same for the vertical scaling. If done right you can usually achieve "emu-like" results. The point of using the BL downscale is to give you the best possible result without shimmering that would otherwise occur due to the NN scaling.

You can create the whole processing chain at once. Cropping -> horizontal NN downscale to the exact sample rate -> integer upscale -> Prec.BL downscale.

If you don't mind the vertical underscan and whish to leave it, you can keep the vertical scaling integer all the way.


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Mon Mar 20, 2017 6:31 pm 


User avatar

Joined: 08 Mar 2015
Posts: 1949
Location: Québec City
ok thanks


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Tue Aug 08, 2017 6:42 am 



Joined: 11 Nov 2013
Posts: 6
So that I'm clear, if I were capturing 256-wide PC Engine at 720x240, and uprezzing to 960x720, I would:

* Crop overscan
* NN down to 256x240
* NN upscale to ~1920x240
* Bilinear down to 960x240
* Line triple (NN?) to 960x720

Is that correct?

Are there tools for doing this at runtime (livestream), or is this only as a post process in virtualDub?


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Tue Aug 08, 2017 8:41 am 


User avatar

Joined: 06 Mar 2006
Posts: 10513
Location: Germany
Quote:
* NN down to 256x240

that can be tricky depending on how your capture card sampled the input.

If your final upscale doesn't require a integer width (which 960 pixels don't), then you can try to skip this part and focus on the vertical resolution instead.

Quote:
Are there tools for doing this at runtime (livestream), or is this only as a post process in virtualDub?

you might be able to integreate Avisynth into your livestream graph and use the filters there.


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Tue Aug 08, 2017 2:16 pm 



Joined: 11 Nov 2013
Posts: 6
Fudoh wrote:
Quote:
* NN down to 256x240

that can be tricky depending on how your capture card sampled the input.

If your final upscale doesn't require a integer width (which 960 pixels don't), then you can try to skip this part and focus on the vertical resolution instead.


I'm using an XCapture-1 over RGB (720x240). If I'm reading you right, you're saying:
1. Crop out overscan
2. NN to 256 (or 320 or 512 or whatever that particular PCE game uses)
3. Use a bilinear to 960, or an NN to 960?
4. Line triple to 720 lines

Fudoh wrote:
you might be able to integreate Avisynth into your livestream graph and use the filters there.


All roads lead to AviSynth, it seems :)

Other questions I could use help on:
a. When I crop out overscan from the 720 image, I was expecting to have exactly 80 pixels of overscan (720 - 80 = 640 = 4:3). I have less than 80. Is that normal? Should I preserve all of the color?
b. Does it matter that I have the card set to a 4:3 aspect ratio *AND* my capture software (either AmaRec or vDub) set to 4:3? Should I leave one of these at 1:1 instead?


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Tue Aug 08, 2017 10:25 pm 


User avatar

Joined: 06 Mar 2006
Posts: 10513
Location: Germany
Quote:
2. NN to 256 (or 320 or 512 or whatever that particular PCE game uses)

as said, that's harder than it sounds. Did you try it ? You have to check a horizontally scrolling game if your cropping and down sizing is able to restore the original resolution. If you can't do it, leave it at 720 pixels and just crop.

Quote:
a. When I crop out overscan from the 720 image, I was expecting to have exactly 80 pixels of overscan (720 - 80 = 640 = 4:3).

no, since you don't have square pixels that doesn't work out.


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Tue Aug 08, 2017 10:29 pm 



Joined: 11 Nov 2013
Posts: 6
Fudoh wrote:
Quote:
2. NN to 256 (or 320 or 512 or whatever that particular PCE game uses)

as said, that's harder than it sounds. Did you try it ? You have to check a horizontally scrolling game if your cropping and down sizing is able to restore the original resolution. If you can't do it, leave it at 720 pixels and just crop.


I tried it on a screenshot in Paint.Net just to make sure I had my math correct and could iterate a little faster.

Quote:
Quote:
a. When I crop out overscan from the 720 image, I was expecting to have exactly 80 pixels of overscan (720 - 80 = 640 = 4:3).

no, since you don't have square pixels that doesn't work out.


Makes sense. Will telling the card/software what aspect ratio to expect change what comes across in the 720x240 image? Is it OK to have both of them set to 4:3?


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Wed Aug 09, 2017 6:40 am 


User avatar

Joined: 06 Mar 2006
Posts: 10513
Location: Germany
Quote:
I tried it on a screenshot in Paint.Net just to make sure I had my math correct and could iterate a little faster.

you need the scrolling test, so you have to do it in the editing suite. A static screenshot can look good, but you might get artefacts once your have scrolling.

Quote:
Will telling the card/software what aspect ratio to expect change what comes across in the 720x240 image? Is it OK to have both of them set to 4:3?

doesn't matter, since you do postprocessing anyway.


Top
 Offline Profile  
 
 Post subject: Re: best upscaling algorithm in VirtualDub for retro games
PostPosted: Wed Aug 09, 2017 2:07 pm 



Joined: 11 Nov 2013
Posts: 6
Fudoh wrote:
Quote:
I tried it on a screenshot in Paint.Net just to make sure I had my math correct and could iterate a little faster.

you need the scrolling test, so you have to do it in the editing suite. A static screenshot can look good, but you might get artefacts once your have scrolling.


Makes sense. I'm guessing the fastest way to iterate here is to do a short capture and then play with AviSynth scripts to view the results in the vDub editor. Time to dive into AviSynth!

Thanks, btw!


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], doonut, gordon-creAtive, mufunyo, SamIAm and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Space Pilot 3K template by Jakob Persson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group