feat(video): reduce branching for faster video render task #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Reduce branching in the video task, and replace some ternary operations with bitwise operations and arithmetic instead.
Motivation and Context
Helps keep the video task performant by reducing the amount of branches that stall the pipeline.
How has this been tested?
Running
Super Mario Bros.
and a few other roms and letting them auto-play for a little bit to capture the difference repeatably.Super Mario Bros.
Before
Frames: 1655
FPS: 108.7
Frame Time: [min 2333 us, avg: 9201.9 us, max: 21461 us]
After
Frames: 1704
FPS: 111.3
Frame Time: [min 2427 us, avg: 8983.1 us, max: 20611 us]
Legend of Zelda Links Awakening DX
Before
Frames: 1918
FPS: 78.4
Frame Time: [min 2583 us, avg: 12751.7 us, max: 26477 us]
After
Frames: 1930
FPS: 79.9
Frame Time: [min 2629 us, avg: 12508.3 us, max: 21521 us]
Sonic The Hedeghog (Genesis)
Before
Frames: 1336
FPS: 49.0
Frame Time: [min 9633 us, avg: 20394.7 us, max: 41146 us]
After
Frames: 1336
FPS: 49.4
Frame Time: [min 9545 us, avg: 20255.3 us, max: 42334 us]
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist:
Software
.github/workflows/build.yml
file to add my new test to the automated cloud build github action.