Implement VP9 loop filtering #550

Merged
KeatonTheBot merged 5 commits from VP9-loop-filtering into master 2025-02-19 02:59:36 +00:00
KeatonTheBot commented 2025-01-20 19:57:40 +00:00 (Migrated from github.com)

Unmerged PR from OG Ryujinx (#4367). From @gdkchan:

The main goal of this change is porting the loop filtering from libvpx, which should fix the block artifacts on some VP9 videos on games using NVDEC to decode them. In addition to that, there are two other changes:

  • The remaining decoder code required to decode a VP9 video (with headers included) has been added. That was done because it's much better to test the decoder standalone with a video file. I decided to keep that code on the emulator, even if some of it is unused, since it makes standalone testing easier in the future too, and we can include unit tests with video files.
  • Large refactoring of both new and existing code to conform with our conding [sic] styles, done by @TSRBerry (thanks!) Some of it has been automated.

Since we had no loop filtering before, this change will make video decoding slower. That may cause frame drop etc if the decoder is not fast enough in some games. I plan to optimize the decoder more in the future to make up for that, but if possible I'd prefer to not do it as part of this PR, but if the perf loss is too severe I might consider.

This will need to be tested on games that had the block artifacts, it would be nice to confirm if they match hardware now, and get some before/after screenshots etc.

Comment from @Bjorn29512:

Significantly improves the block artifacts in FE: Engage.

Before:

After:

Unmerged PR from OG Ryujinx (#4367). From @gdkchan: > The main goal of this change is porting the loop filtering from libvpx, which should fix the block artifacts on some VP9 videos on games using NVDEC to decode them. In addition to that, there are two other changes: > > - The remaining decoder code required to decode a VP9 video (with headers included) has been added. That was done because it's much better to test the decoder standalone with a video file. I decided to keep that code on the emulator, even if some of it is unused, since it makes standalone testing easier in the future too, and we can include unit tests with video files. > - Large refactoring of both new and existing code to conform with our conding [sic] styles, done by @TSRBerry (thanks!) Some of it has been automated. > > Since we had no loop filtering before, this change will make video decoding slower. That may cause frame drop etc if the decoder is not fast enough in some games. I plan to optimize the decoder more in the future to make up for that, but if possible I'd prefer to not do it as part of this PR, but if the perf loss is too severe I might consider. > > This will need to be tested on games that had the block artifacts, it would be nice to confirm if they match hardware now, and get some before/after screenshots etc. Comment from @Bjorn29512: > Significantly improves the block artifacts in FE: Engage. > > Before: > ![](https://user-images.githubusercontent.com/110204265/216882414-ec88dbda-7544-4490-8a47-37f074056ae3.png) > > After: > ![](https://user-images.githubusercontent.com/110204265/216882478-4e81fead-1033-4877-b282-f9cac6d6aa3b.png)
github-actions[bot] commented 2025-01-20 20:06:26 +00:00 (Migrated from github.com)
Download the artifacts for this pull request: * [ryujinx-Release-1.2.0+c1a5edf-linux_arm64](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613500985.zip) * [ryujinx-Release-1.2.0+c1a5edf-linux_arm64-AppImage](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613501096.zip) * [ryujinx-Release-1.2.0+c1a5edf-linux_x64](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613506227.zip) * [ryujinx-Release-1.2.0+c1a5edf-macos_universal](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613506239.zip) * [ryujinx-Release-1.2.0+c1a5edf-linux_x64-AppImage](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613506287.zip) * [ryujinx-Release-1.2.0+c1a5edf-win_x64](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613515754.zip) <details><summary>Only for Developers</summary> * [ryujinx-Debug-1.2.0+c1a5edf-linux_arm64](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613501197.zip) * [ryujinx-Debug-1.2.0+c1a5edf-linux_arm64-AppImage](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613501293.zip) * [ryujinx-Debug-1.2.0+c1a5edf-linux_x64](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613508284.zip) * [ryujinx-Debug-1.2.0+c1a5edf-linux_x64-AppImage](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613508411.zip) * [ryujinx-Debug-1.2.0+c1a5edf-macos_universal](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613510578.zip) * [ryujinx-Debug-1.2.0+c1a5edf-win_x64](https://nightly.link/Ryubing/Ryujinx/actions/artifacts/2613518859.zip) </details>
Sign in to join this conversation.
No description provided.