Skip to content

Refactor rd_pick_intra_dip_sby() - #5306

Open
SamuthirikaS wants to merge 3 commits into
AOMediaCodec:av2-encfrom
SamuthirikaS:dip_refactor
Open

Refactor rd_pick_intra_dip_sby()#5306
SamuthirikaS wants to merge 3 commits into
AOMediaCodec:av2-encfrom
SamuthirikaS:dip_refactor

Conversation

@SamuthirikaS

Copy link
Copy Markdown

No description provided.

@SamuthirikaS

Copy link
Copy Markdown
Author

@yunqingwang1 @urvangjoshi
/cc @vikasprasad10 @harishdm @ranjit-tulabandu @cherma-a @deepa-kg @RemyaPrakasan @ram-mohan
We have verified that this PR is bit-exact for speeds 0 to 3 across RA, LD, and AI configurations on a few test clips.
Please review.
Note: Each commit in this PR is logically independent and has its own commit message. Please do not squash them.

- Move the intra DIP ML feature tracking structure (DipMlInfo)
to intra_dip.h and store it directly inside the MACROBLOCK
struct.
- This simplifies the function signature of
rd_pick_intra_dip_sby() by removing the need to pass
stack-allocated feature structure.
- Extract ML-based intra DIP pruning logic from
rd_pick_intra_dip_sby() into a static helper,
keep_intra_dip_mode().
- This consolidates feature collection, TFLite input setup,
and threshold evaluation into a single modular function,
improving code structure and readability.
- Extract init_mbmi_for_intra_dip() helper to eliminate
duplicate MB_MODE_INFO reset logic.
- Use an early return when keep_intra_dip_mode() fails,
un-nesting the main candidate mode search loop.
- Encapsulate DIP mode index calculation into a dedicated
get_intra_dip_mode() inline helper.
- Update function return type from int to bool.
- Update comments to adhere to coding guidelines.
- Use pre-increment for loops in rd_pick_intra_dip_sby_modelrd().
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.

2 participants