Scaler won't downscale

Discussion about displays and related hardware including MiSTer filters and video settings.
thorr
Top Contributor
Posts: 1311
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 634 times
Been thanked: 308 times

Scaler won't downscale

Unread post by thorr »

I noticed this several months ago when the scaler code changed. If you try to display something that has more vertical resolution than your display, it won't downscale it. Instead, you get the top rows of pixels and the bottom rows are cut off. Any chance this can be fixed? It used to downscale correctly. This affects at least most arcade cores and ao486. I know you would lose horizontal lines in your image but at least you can see the whole screen instead of the top half. Specifically, I am using a 240p mode on my CRT TV and can't see the bottom half of anything higher than 240 vertical resolution.

Also, since I am on the subject of the scaler, it would be amazing if 480i support was added.

Thanks for your consideration to whomever can implement these features.
ash2fpga
Posts: 237
Joined: Tue May 26, 2020 6:20 pm
Has thanked: 62 times
Been thanked: 28 times

Re: Scaler won't downscale

Unread post by ash2fpga »

I think the template project may be the place to report this.

https://github.com/MiSTer-devel/Template_MiSTer/issues
thorr
Top Contributor
Posts: 1311
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 634 times
Been thanked: 308 times

Re: Scaler won't downscale

Unread post by thorr »

Thanks. I just posted it.
FoxbatStargazer
Top Contributor
Posts: 1019
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 times

Re: Scaler won't downscale

Unread post by FoxbatStargazer »

This weirdly does not match my own experience with ao486. While some stuff is cut off in 720x400 DOS using a 240p resolution, its not half the screen like your description would suggest. Maybe there is something else going on or something different about AO486 or even your setup. Like using direct video would be pretty different from relying on the scaler.
thorr
Top Contributor
Posts: 1311
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 634 times
Been thanked: 308 times

Re: Scaler won't downscale

Unread post by thorr »

FoxbatStargazer wrote: Mon Jun 28, 2021 3:35 pm This weirdly does not match my own experience with ao486. While some stuff is cut off in 720x400 DOS using a 240p resolution, its not half the screen like your description would suggest. Maybe there is something else going on or something different about AO486 or even your setup. Like using direct video would be pretty different from relying on the scaler.
DOS is fine, but playing the 7th guest from the flynnsbit collection seems to be cut off.
FoxbatStargazer
Top Contributor
Posts: 1019
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 315 times
Been thanked: 238 times

Re: Scaler won't downscale

Unread post by FoxbatStargazer »

Interesting then that DOS and game are treated differently? Is this a general scaler problem then or something specific to AO486?

I also wonder what arcades you have in mind that go above 240p/480i? Its normal to lose important stuff to overscan. Or is this happening when you use rotation?
User avatar
Grabulosaure
Core Developer
Posts: 79
Joined: Sun May 24, 2020 7:41 pm
Location: Mesozoic
Has thanked: 3 times
Been thanked: 92 times
Contact:

Re: Scaler won't downscale

Unread post by Grabulosaure »

This is a known problem. Actually a design limitation.

- The scaler can be used to resize the video from the core (usually standard 220- 240 lines PAL/NTSC) to any resolution on the HDMI output (can be upscaled with polyphase or downscaled with linear).
- The scaler has a "framebuffer" mode where pixels are directly written to DRAM by the cores and then the scaler generates on-the-fly the high resolution image on the HDMI port.

This framebuffer mode is used by AO486 for superVGA, by MiniMig for RTG, for the Linux console, by some arcade cores when rotating the image, by the double resolution mode on GBA, etc... But, this framebuffer mode cannot downscale, just upscale (or same resolution).

How is it so?

The scaler output pipeline runs at the output pixel frequency (up to around 200MHz).
When upscaling, there are fewer pixels read from memory than pixels on the output, so the scaler only need to read at most one pixel per cycle. Simple.
When downscaling an image in RAM, more than one pixel per cycle must be read for correct interpolation. And that's not easy, particularly for horizontal downscaling.
Vertical downscaling could be a bit more manageable than horizontal, at least for showing an image, maybe not correctly interpolated.
(Lack of interlaced output is somewhat related to that limitation. Interlaced means skipping lines, which is similar to vertical downscale constraints)
thorr
Top Contributor
Posts: 1311
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 634 times
Been thanked: 308 times

Re: Scaler won't downscale

Unread post by thorr »

Grabulosaure wrote: Mon Jun 28, 2021 10:45 pm The scaler output pipeline runs at the output pixel frequency (up to around 200MHz).
When upscaling, there are fewer pixels read from memory than pixels on the output, so the scaler only need to read at most one pixel per cycle. Simple.
When downscaling an image in RAM, more than one pixel per cycle must be read for correct interpolation. And that's not easy, particularly for horizontal downscaling.
Vertical downscaling could be a bit more manageable than horizontal, at least for showing an image, maybe not correctly interpolated.
(Lack of interlaced output is somewhat related to that limitation. Interlaced means skipping lines, which is similar to vertical downscale constraints)
Thank you very much for the explanation. The vertical direction is the only thing I care about actually. I have plenty of horizontal resolution. I run the scaler at 1280x240p. I could live with simply throwing away lines (show every other line for 480p sources scaled onto 240p, etc.), or maybe every other frame alternate which lines are shown in the 240 lines (that might look terrible though). For 480i, it is the same concept as my second idea just mentioned - show every other line, then every other in between line. If 480i was available, when needed I would choose that over 240p to get the extra resolution. I run my PC at 480i with emulators and it looks beautiful. I am hoping it can be added to the MiSTer. Thanks again!
thorr
Top Contributor
Posts: 1311
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 634 times
Been thanked: 308 times

Re: Scaler won't downscale

Unread post by thorr »

FoxbatStargazer wrote: Mon Jun 28, 2021 10:00 pm Interesting then that DOS and game are treated differently? Is this a general scaler problem then or something specific to AO486?

I also wonder what arcades you have in mind that go above 240p/480i? Its normal to lose important stuff to overscan. Or is this happening when you use rotation?
I see it when rotating arcade games. For DOS, a very easy one to see it on is Sim City 2000.
dentnz
Core Developer
Posts: 54
Joined: Sun May 24, 2020 10:28 pm
Been thanked: 12 times

Re: Scaler won't downscale

Unread post by dentnz »

Instead of interpolation, wouldn’t it be just ok to skip pixels? Surely this would mean you would be able to read one pixel per cycle, and even skip vertical lines?
Post Reply