Any chance of a "Simple 2X/3X/4X" filter?

Archived bsnes development news, feature requests and bug reports. Forum is now located at http://board.byuu.org/
Locked
Missingno
New Member
Posts: 3
Joined: Wed Apr 01, 2009 12:14 pm

Any chance of a "Simple 2X/3X/4X" filter?

Post by Missingno »

Currently in bsnes you have two options for scaling the image. With "linear" filtering, you get a rather blurry image. With "point" filtering on the other hand you get sharp pixels, but if you stretch it out to 4:3 you will get ugly artifacts.

A good compromise is to upsize the image first by just doubling the pixels, and then letting the hardware stretch it to 4:3 using bilinear interpolation. Several other emulators have this option.
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

I think the license that the filters use, is not compatible with the BSNES license.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

That shouldn't be an issue here.

Your idea should be simple enough.. if byuu doesn't pounce on it I'll give it a go and post some screenshots.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

Uhh, why would hardware bilinear interpolation be any better than software bilinear interpolation?
Missingno
New Member
Posts: 3
Joined: Wed Apr 01, 2009 12:14 pm

Post by Missingno »

All right, let me post some pictures for comparision.

bsnes with "linear" filtering selected:
Image

bsnes with "point" filtering selected:
Image

snes9x with "Simple 2x" filtering selected (and window manually resized to approximately 4:3)
Image

Sharpness-wise it's somewhere in between the two bsnes images, but with no nasty warped pixels like in the second bsnes shot.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

Does anyone here know how long Qt is supposed to take to compile? It's been going for bloody ages now, and I'm starting to think it's stuck in some sort of infinite loop.
byuu

Post by byuu »

A good compromise is to upsize the image first by just doubling the pixels, and then letting the hardware stretch it to 4:3 using bilinear interpolation. Several other emulators have this option.
Several other emulators have options to swap the left and right mouse buttons. Not always the best measurement :P

I suppose a 2x point filter would be fine. Easy enough to get it working with hires / interlace, too. Just ensure the final image is 512x(448,480). No promises on how quickly I'll get around to it.

I was actually just thinking the other day it'd be nice to re-do libfilter as a fully-fledged library. Support the most popular ones natively. Plugins never work well because they only get compiled for / work on Windows. So what about a library that creates its own secondary thread, and has a Python / whatever script compiler that builds and executes user-defined .py plugin filters? Works on any platform and requires no compilation. Uses second core so there's no emulator slowdown for being interpreted.
Does anyone here know how long Qt is supposed to take to compile? It's been going for bloody ages now, and I'm starting to think it's stuck in some sort of infinite loop.
If you use my build line that disables all the crap, about 10 minutes. If you do a stock compile with "configure -static && make", it'll take about four hours on a Core 2.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

You need to have your eyeballs checked, Missingo. The image with the least visible line duplication is the one with the most intense blur. Look at the right side of the tomato in your snes9x shot. Why would you claim that that image has no noticeable duplication? Either you want it gone or you don't, and that negligible amount of blending is insufficient in accomplishing that.
Missingno
New Member
Posts: 3
Joined: Wed Apr 01, 2009 12:14 pm

Post by Missingno »

FitzRoy wrote:You need to have your eyeballs checked, Missingo. The image with the least visible line duplication is the one with the most intense blur. Look at the right side of the tomato in your snes9x shot. Why would you claim that that image has no noticeable duplication? Either you want it gone or you don't, and that negligible amount of blending is insufficient in accomplishing that.
As I said in my first post, it's a compromise. Yes I notice the side of the "tomato", now that you point it out. Pretty much every other part of the image looks much better than the image above it.
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

You have to choose between visible line duplication and blur. It strikes me as odd that anyone would want to incur noticeable levels of both. There are practically infinite variations that could be employed of every filter. Where do you think the line should be drawn? If you get your blur slider, I want my yellow polka dots. This is the slippery slope of supporting any kind of filtration.
Last edited by FitzRoy on Wed Apr 01, 2009 5:28 pm, edited 1 time in total.
byuu

Post by byuu »

It would at least be a nice option for people stuck with eg DirectDraw pre-Vista or Xv YUY2 on Linux. A 2x scale would greatly reduce blurring if it weren't desired.

But yeah it would be fairly uncommon. Even the Scale2x filter is a bit out of place.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

I'm trying this command line from the 0.040 topic now:

Code: Select all

configure -static -release -no-exceptions -no-rtti -no-accessibility -no-stl -plugin-sql-sqlite -no-opengl -no-phonon -no-webkit -no-scripttools -no-openssl -no-dbus -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde
That's still what you're using, right?
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

That is what I'm using. I wondering he change it at end as well.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
byuu

Post by byuu »

I disabled more stuff, but that'll work fine and be ~90% as small as what I have now. Make sure to use (mingw32-)make sub-src as well. No need to build examples and demos. I have the line saved at home. I need to write up instructions on how to build the damn thing already. Getting really complicated: Qt 4.5 source fixes for MinGW 4 (lazy Nokia), DirectX SDK, XInput.lib -> libxinput.a, updating the path to Qt 4.5 in the Makefile ...
FirebrandX
Trooper
Posts: 376
Joined: Tue Apr 19, 2005 11:08 pm
Location: DFW area, TX USA
Contact:

Post by FirebrandX »

Missingno wrote:
FitzRoy wrote:You need to have your eyeballs checked, Missingo. The image with the least visible line duplication is the one with the most intense blur. Look at the right side of the tomato in your snes9x shot. Why would you claim that that image has no noticeable duplication? Either you want it gone or you don't, and that negligible amount of blending is insufficient in accomplishing that.
As I said in my first post, it's a compromise. Yes I notice the side of the "tomato", now that you point it out. Pretty much every other part of the image looks much better than the image above it.


I myself use point filtering and then apply a custom res to my monitor in order to correct the aspect ratio via monitor scaling. It maintains sharpness and avoids warping the pixels. On my 1680x1050, I use powerstrip to apply a 1440x1050 mode whenever bsnes is loaded. In bsnes, I use 4xscale in fullscreen with aspect turned off and this makes the 1440 res perfectly correct the image to 4:3 aspect.

End result of all that jargon? A perfectly aspect corrected, point filtered image with no warped pixels. Its literally impossible for software filters to do it that well. 8)
NES NTSC palette file:

http://www.firebrandx.com/downloads/fbx2pal.zip
FitzRoy
Veteran
Posts: 861
Joined: Wed Aug 04, 2004 5:43 pm
Location: Sloop

Post by FitzRoy »

Line duplication is an effect simulating stretched pixels for modern displays, there really is no clever way to defeat it without incurring blur. You could also make it imperceptible with an obscenely high pixel density that doesn't exist yet, but that's besides the point.

Super Mario World is also one of those games that looks normal when it's NOT corrected to 4:3. Objects we would expect to have equidistance only have it when uncorrected. Not a relevant statement here, I just found it funny that SMW was the example used.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

byuu wrote:Qt 4.5 source fixes for MinGW 4 (lazy Nokia)
I actually got it to compile without any fixes. (some warnings, but no errors) I used 1.902.0 of the TDM/MinGW.
FirebrandX
Trooper
Posts: 376
Joined: Tue Apr 19, 2005 11:08 pm
Location: DFW area, TX USA
Contact:

Post by FirebrandX »

FitzRoy wrote:Line duplication is an effect simulating stretched pixels for modern displays, there really is no clever way to defeat it without incurring blur.
The blur incurred with my method is nearly undetectable. Having the monitor do the horizontal scaling as opposed to having the software handle it really does look a lot better. This is because instead of randomly warping pixels, the monitor averages the pixel width for the entire resolution. The result is each pixel has the exact same width, and sharpness is almost fully retained. By my own experience, the sharpness is about 95% of an unscaled image. By far the best method, though there is a learning curve as not many people know how to set it up.
NES NTSC palette file:

http://www.firebrandx.com/downloads/fbx2pal.zip
Dullaron
Lurker
Posts: 199
Joined: Mon Mar 10, 2008 11:36 pm

Post by Dullaron »

Verdauga Greeneyes wrote: I actually got it to compile without any fixes. (some warnings, but no errors) I used 1.902.0 of the TDM/MinGW.
Are you using MinGW that TDM/MinGW is asking for? I never did try that way. I use the QT instead.

byuu I will wait on your instructions on what you did before I change stuff at my end. It crazy making those demos for make on byuu src to work.
Window Vista Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / Nvidia GeForce 8500 GT
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

Dullaron wrote:Are you using MinGW that TDM/MinGW is asking for? I never did try that way. I use the QT instead.
Yeah, I installed the TDM/MinGW first, then pointed the Qt installer to it.
Locked