Refactor av2_rd_pick_inter_mode_sb() - #5342
Merged
urvangjoshi merged 5 commits intoAug 28, 2026
Merged
Conversation
Contributor
Author
|
@yunqingwang1 , @urvangjoshi We have verified that this PR is bit-exact with it's parent commit for speeds 0 to 3 across RA, LD, and AI configurations for few test clips. |
yunqingwang1
approved these changes
Aug 28, 2026
yeqing-wu
approved these changes
Aug 28, 2026
yeqing-wu
left a comment
Contributor
There was a problem hiding this comment.
Thanks for refactoring the code, the code looks good to me.
This change unifies the rectangular sub-block search to improve the readabilty and avoid code duplication. Unified code is extracted to new function has_searched_rect_subblock() which scans HORZ/VERT sub-blocks for a previously searched partition. No stats changed Change-Id: I331cf4a82fadc549122a91f2acb7f1e9eef1b2cd
- Abstracted the TPL stage inter/intra cost accumulation to calculate_cost_from_tpl_data(). - Abstracted the IntraBC prediction code to try_intrabc_after_inter_search(). No stats changed Change-Id: Icc70b559709078236cc96b4d3af34c5d10cff6ac
- Hoist the frame/sequence level reads out of the mode loop into locals. - Fold the loop-invariant BLOCK_4X4 check into the mode loop bound. - Flatten the BRU gate from three nesting levels to two. No stats changed Change-Id: I7d9e8fa4794e1959185e9aa39aedd7aad0cfc319
- Drop is_comp_mode, a second name for comp_pred used interchangeably with it in the same loop body. - Drop the no-op guard around the search_state.best_rd assignment. - Compute num_amvd_modes and amvd_inverted just above the use_amvd loop that consumes them. - Scope the loop counter i to the loops that use it. - Initialize the motion mode prune pool with a single flat loop. - Use the local aliases consistently (e.g: sf-> over cpi->sf etc). - Add the missing const to the pointer locals that are never reassigned. - Move the main loop and hdres threshold comments next to the code they describe. - Use prefix increment in the two loops that used postfix. No stats changed Change-Id: Ic88588aa0ce5986bdabb471cf4322141975a00c5
Gcc reports "array subscript 8 is above array bounds of unsigned int[8][8]" for ref_costs_comp[ref_frame_index]. The index only reaches TIP_FRAME_INDEX(8) for TIP, which is single reference only, so the compound branch is never evaluated with that index. ref_costs_single is sized to include the TIP slot, ref_costs_comp is not. Added the bounds check to the condition so that the invariant is visible to the compiler. No stats changed Change-Id: I518f7414c5958f886e6750ee7402a48ecc1a895a
urvangjoshi
force-pushed
the
refactor_rd_pick_inter
branch
from
August 28, 2026 21:53
60079d2 to
27e69f9
Compare
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.
No description provided.