Unnest compound mode search loops and clean up inter search - #5343
Merged
Conversation
kslu-aom
requested review from
jingninghan,
leolzhao,
urvangjoshi,
yeqing-wu and
yunqingwang1
August 28, 2026 17:18
Contributor
Author
|
Please review this refactoring patch and let me know if anything can be improved. I have a follow up patch to clean up more variables, search state structs, and function signatures, but I think it is better to separate this unnesting change for code review. I will mark the PR as ready when speed 0 tests are finished. |
kslu-aom
marked this pull request as ready for review
August 31, 2026 19:05
Contributor
Author
|
Results have been updated. This PR has been marked as ready. |
yeqing-wu
enabled auto-merge (squash)
August 31, 2026 19:20
Unnest the JMVD scale factor, CWP, and RefineMV loops in handle_compound_inter_prediction into sequential evaluation stages: 1. Base compound mode (scale 0, CWP EQUAL, RefineMV 0) 2. RefineMV mode (scale 0, CWP EQUAL, RefineMV 1) 3. CWP modes (scale 0, CWP != EQUAL, RefineMV 0) 4. JMVD scale factor modes (scale 1..N-1, CWP EQUAL, RefineMV 0) Avoid redundant motion search and skip invalid tool combinations.
…prediction - Hoist invariant mbmi initializations, rate computations, and loop invariants out of search loops in handle_single_inter_prediction and handle_compound_inter_prediction. - Use reset_inter_mode_info helper to unify mode_info field resets. - Use base template struct assignment in compound search instead of re-assigning individual invariant fields per iteration. - Clean up BAWP search in single prediction by simplifying scalar BAWP MV tracking and mode_info access. - Remove redundant dead checks in CWP and JMVD scaling stages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change includes the following cleanups
STATS_CHANGED
Results tested with RA 33 frames based on 18a0096