Skip to content

Refactor av2_rd_pick_intra_sby_mode() - #5235

Merged
urvangjoshi merged 6 commits into
AOMediaCodec:av2-encfrom
SamuthirikaS:rebased_av2_enc
Aug 20, 2026
Merged

Refactor av2_rd_pick_intra_sby_mode()#5235
urvangjoshi merged 6 commits into
AOMediaCodec:av2-encfrom
SamuthirikaS:rebased_av2_enc

Conversation

@SamuthirikaS

Copy link
Copy Markdown

No description provided.

@SamuthirikaS SamuthirikaS changed the title Rebase av2_rd_pick_intra_sby_mode() Refactor av2_rd_pick_intra_sby_mode() Aug 10, 2026
@SamuthirikaS
SamuthirikaS marked this pull request as ready for review August 12, 2026 16:45
@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.

@urvangjoshi
urvangjoshi requested a review from leolzhao August 13, 2026 15:59
@leolzhao
leolzhao requested a review from yeqing-wu August 18, 2026 05:35
@leolzhao

Copy link
Copy Markdown
Contributor

@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.

As the gain of FSC mode is mainly for class B2, have you tested class B2 video sequences to see whether it has any bitstream change or not? @SamuthirikaS

@SamuthirikaS

Copy link
Copy Markdown
Author

As the gain of FSC mode is mainly for class B2, have you tested class B2 video sequences to see whether it has any bitstream change or not? @SamuthirikaS

Hi @leolzhao, We have verified the changes are bit-exact on a B2 content Wikipedia_1920x1080p30.y4m for speed 0, 1, 2, 3 across RA, LD, and AI configurations. Please let us know if further testing on B2 contents is required.

@leolzhao

Copy link
Copy Markdown
Contributor

As the gain of FSC mode is mainly for class B2, have you tested class B2 video sequences to see whether it has any bitstream change or not? @SamuthirikaS

Hi @leolzhao, We have verified the changes are bit-exact on a B2 content Wikipedia_1920x1080p30.y4m for speed 0, 1, 2, 3 across RA, LD, and AI configurations. Please let us know if further testing on B2 contents is required.

Thanks, the MR looks good to me. Please rebase the code and fix the conflicts. @SamuthirikaS

Refactor av2_rd_pick_intra_sby_mode() to evaluate Forward Skip
Coding (FSC) modes using an outer fsc_mode loop, eliminating
redundant candidate search logic and unifying non-FSC and
FSC intra mode evaluation.
This patch refactors and abstracts different pruning logics
within the intra mode evaluation loop into a new function and
also avoids redundant computations in intra mode loop.

This is a bit-exact change.
Abstracted code related to multi winner mode processing
into a helper function `refine_winner_intra_mode_tx`.
Also replaces memcpy with `av2_copy_array()`.
This patch renames variables in av2_rd_pick_intra_sby_mode()
for better readablity and code consistency.
- Updated comments to adhere to coding guidelines.
- Used local variables to avoid repetitive access from
data structures.
- Modified code logic for better readability.
Abstracted code related to luma intra mode cost
calculation into a helper function to improve
readability.
@urvangjoshi
urvangjoshi merged commit 227878e into AOMediaCodec:av2-enc Aug 20, 2026
1 check 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