Skip to content

Refactor compound type search functions - #5296

Merged
urvangjoshi merged 4 commits into
AOMediaCodec:av2-encfrom
RemyaPrakasan:refactor-comp-type-search
Aug 21, 2026
Merged

Refactor compound type search functions#5296
urvangjoshi merged 4 commits into
AOMediaCodec:av2-encfrom
RemyaPrakasan:refactor-comp-type-search

Conversation

@RemyaPrakasan

Copy link
Copy Markdown

No description provided.

@RemyaPrakasan

Copy link
Copy Markdown
Author

@yunqingwang1 @urvangjoshi
/cc @vikasprasad10 @harishdm @ranjit-tulabandu @cherma-a @deepa-kg @ram-mohan

We have verified that this PR is bit-exact for speeds 0 to 3 across RA and LD configurations on a few test clips. Please review.

Note: Each commit in this PR has its own commit message. Please do not squash them.

@yunqingwang1 yunqingwang1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thanks.

- Consolidated initializations and moved early gating
  to the function start
- Introduced local variables for readability
- Renamed calc_masked_type_cost() to calc_comp_type_cost()
  and abstracted compound type cost calculation
- Replaced update_mask_best_mv() with av2_copy_array()
- Renamed rs2 to comp_type_rate
- Simplified the masked_compound_type_rd() signature
- Made cosmetic changes to follow coding guidelines

No Stats Changed
- Added CompTypeRdStats to consolidate RD cost members
  in COMP_RD_STATS
- Replaced local arrays in av2_compound_type_rd() with
  CompTypeRdStats

This improves readability, simplifies the function signature
and data copy in various helper functions.

No Stats Changed
- Unified pick_wedge() and pick_wedge_fixed_sign() to
  avoid code duplication
- Cleaned up the dead code and debug prints in pick_wedge()
- Modified get_wedge_cost() to cleanup unused parameter

No Stats Changed
- Modified comments to ensure correctness and correct punctuations
- Replaced INLINE with AVM_INLINE
- Replaced hard coded values with enums
- Used pre-increments in loop counters

No Stats Changed
@urvangjoshi
urvangjoshi force-pushed the refactor-comp-type-search branch from 91c76f7 to d668e9d Compare August 21, 2026 17:48
@urvangjoshi
urvangjoshi merged commit 6565e2e into AOMediaCodec:av2-enc Aug 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants