zoeyjodon / moonlight-N3DS

Gamestream client for the New 3DS
https://github.com/moonlight-stream/moonlight-embedded/wiki
GNU General Public License v3.0
109 stars 4 forks source link

Downscale behavior issue with NVENC #55

Open DragonWario opened 2 weeks ago

DragonWario commented 2 weeks ago

I am experiencing poor downscaling quality when using Hardware-based encoding (NVENC). Using an Nvidia graphics card to encode produces what seems to be a nearest neighbor downscale, which for downscaling from an HD or 4K panel, looks very bad.

The expected behavior is for the PC to downscale the rendered image in such a way that it adds a kind of supersample anti aliasing effect. Something like a Bilinear, Bicubic, or Area downscale for example.

Screenshots (Integer upscaled to 4K for easier viewing on modern screens) NVENC P4: Screenshot 2024-08-28 220058

Software x264 Ultrafast: Screenshot 2024-08-28 221205

PC Settings Host: Sunshine v0.23.1 OS: Windows 10 Home; Version 22H2 (19045.4780) Browser: Google Chrome; Version 128.0.6613.114 (64-bit) CPU: Intel i7-1165G7 @3-4.7Ghz (thermal limited) GPU: ASUS Dual RTX 3070 (Non-LHR) (Desktop GPU connected via M.2 PCIe adapter) / Driver: 560.94 RAM: 16GB Quad-Channel LPDDR4 @4,267Mhz

3DS/Stream settings Hardware: RED-001 (New Nintendo 3DS XL, USA Region) OFW: 11.17.0-50U CFW: "Polari3DS" v1.1 https://github.com/Alexyo21/Polari3DS/releases/tag/1.1.0 Stream: 400x240, 60fps, 8000kbps. NVENC Quality setting is P4.

DragonWario commented 2 weeks ago

As an aside, 800px "HoriHD" content does not really work on software or hardware based encoding with Sunshine either. Ideally, we could stream 800x240 (800x225 16:9) at 30 or 60fps with a nice supersample downscale filter on hardware encoding, but for now the best results I have been able to get are 400x240 / software encode as "HoriHD" content is not scaled to a 1:2 Pixel Aspect Ratio (what the 3DS Screen uses).

800px software encode 2024-08-28_22-27-28 421_top

800px hardware encode 2024-08-28_22-29-34 198_top

Both screenshots resolve to an 400x240 1:1 PAR in an 800x240 area from luma's capture, but IRL it looks squished vertically compared to 400x240 streams. I don't have a good way of representing that with luma's capture, though.