libretro / libretro/RetroArch

Incorrect integer scaling with "keep aspect ratio" turned off on Miyoo Mini

Open
#16,041 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

Blargg NTSC filter produces an image of the size [original-height]x602 applied to the standard SNES output, which is double width plus a bit more, due to how it works. It then relies on Retroarch to use integer scaling to scale the image vertically to produce the expected [2x-original-height]x602 image. But when internally calculating integer scaling options Retroarch (I assume) relies on the output image target aspect ratio being exactly 4:3, which results in incorrect vertical scaling with the output resolution of 451x602, no matter the vertical resolution of the actual filter output. This absolutely messes up the image, makes it vertically blurry, messes up with scanlines overlays, etc.

Expected behavior

Blargg NTSC filter's [original-height]x602 output being scaled correctly to [2x-original-height]x602

Actual behavior

Output height is instead 451, which is, I assume, is a result of an internal calculation relying on an expected aspect ratio instead of just doubling the existing height, as 451:602 is exactly 4:3

Steps to reproduce the bug
  1. Apply Blargg NTSC filter to SNES output, either as a separate video filter or as a built-in core option
  2. Turn on integer scaling, turn off keep "keep image aspect"
Version/Commit

version 1.15.0, Build date Oct 18 2023

Environment information
  • OS: Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing RetroArch's integer-scaling path when keep image aspect is disabled, then compare its calculations with the Blargg NTSC filter output dimensions described in the report. Reproduce the issue using the listed SNES filter steps at 451x602 and verify that the resulting scaled height matches the expected doubled original height without blur or scanline distortion.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.