blargg snes filter - limitations?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
blargg snes filter - limitations?
by on (#154883)
Quote:
snes_ntsc.txt

Limitations
-----------
The library's horizontal rescaling is too wide by about 3% in order to
allow a much more optimal implementation. This means that a 256 pixel
wide input image should appear as 581 output pixels, but with this
library appears as 602 output pixels. TV aspect ratios probably vary by
this much anyway. If you really need unscaled output, contact me and
I'll see about adding it.

Input pixels are converted to 13-bit RGB (4 bits red, 5 bits green, 4
bits blue) to reduce memory usage from 16MB to 4MB. This reduction can
cause slight banding in some smooth gradients. Contact me if you'd like
this reduction made optional.


With modern processing, how would one "undo" these limits in source? Trying to learn better how algorithm works. With final goal to add more input bitdepths (888, 101010) if pipedream starts functioning.

I suppose running step-step with debug compiler should be first stop. :mrgreen:

Thanks for any help
Re: blargg snes filter - limitations?
by on (#154890)
bsnes-classic includes a version of blargg's filter without the 13-bit color depth reduction (and also without needlessly using twice as much memory in a 64-bit compile).

I tried to modify the horizontal scaling (mainly to try to make SNES hires modes less blurry) but it was well beyond my understanding.
Re: blargg snes filter - limitations?
by on (#154904)
Many smart people have failed to decipher blargg's optimizations, including myself.

It was wonderful that he wrote something so fast, but the end result is a nightmare that nobody can improve much.

Much as I hate to say it, it'd probably be best to start over.