Skip to content

perf(xbox): speed up YUY2 overlay packing - #400

Draft
ReenigneArcher wants to merge 1 commit into
masterfrom
codex/xbox-yuy2-packing
Draft

ReenigneArcher wants to merge 1 commit into
masterfrom
codex/xbox-yuy2-packing

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

At 1080i, the Xbox GPU renderer prepares each frame in a packed YUY2 buffer before handing it to the video overlay. Pack directly into aligned overlay buffers with Pentium III-compatible MMX and SSE1 instructions. Restore x87 state and order the writes before CPU composition or GPU scanout. Keep the existing path for unaligned buffers and the scalar path for the end of each row.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

  • Extended the packing test to compare the full output byte for byte for aligned and unaligned destinations, including an odd height, a partial block, and row padding.
  • All 560 native tests passed with CTest. All 529 Xbox guest tests passed in xemu.
  • In paired nine-second MPEG-2 playback tests at 1920×1080 with 1080i output, the updated build presented 269 of 270 frames at 30 FPS, up from 258. With three GPU buffers and a 60 FPS source at 20 Mbps, it presented 502 of 540 frames, up from 487.
  • In a live 1080i MPEG-2 Desktop stream from a separate Sunshine instance, the client presented 29.2 FPS with a 30 FPS request and 48.8 FPS with a 60 FPS request. The client received 49.1 FPS in the 60 FPS run.
  • Sustained full-resolution 60 FPS and performance on an original Xbox still need validation.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.74%. Comparing base (be476be) to head (76ac243).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #400      +/-   ##
==========================================
+ Coverage   88.71%   88.74%   +0.03%     
==========================================
  Files          82       82              
  Lines        9437     9466      +29     
  Branches     4063     4067       +4     
==========================================
+ Hits         8372     8401      +29     
  Misses        957      957              
  Partials      108      108              
Flag Coverage Δ
Linux-aarch64 75.04% <ø> (ø)
Linux-x86_64 75.14% <90.00%> (+0.01%) ⬆️
Windows-AMD64 77.07% <96.55%> (+0.06%) ⬆️
Windows-ARM64 76.92% <ø> (-0.03%) ⬇️
Xbox-guest-xemu-Linux 72.00% <100.00%> (+0.03%) ⬆️
Xbox-guest-xemu-Windows 72.00% <100.00%> (+0.03%) ⬆️
Xbox-guest-xemu-macOS 72.00% <100.00%> (+0.03%) ⬆️
macOS-arm64 64.75% <ø> (-0.03%) ⬇️
macOS-x86_64 64.93% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/streaming/video_acceleration.cpp 98.96% <100.00%> (+0.43%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be476be...76ac243. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant