Skip to content

Extend intra mode cache reuse to revisited intra blocks - #5484

Merged
yunqingwang1 merged 1 commit into
AOMediaCodec:av2-encfrom
chengchen-google:s9-b-clean
Oct 7, 2026
Merged

yunqingwang1 merged 1 commit into
AOMediaCodec:av2-encfrom
chengchen-google:s9-b-clean

Conversation

@chengchen-google

Copy link
Copy Markdown
Contributor
  1. Reuse cached intra modes (x->inter_mode_cache[0]) on revisited blocks within the same superblock pass in av2_rd_pick_intra_sby_mode() and av2_rd_pick_intra_sbuv_mode() when REUSE_INTRA_MODE_IN_INTERFRAME_FLAG is active, restricting search to the cached winning mode and DC_PRED.
  2. Skip redundant IntraBC search in av2_rd_pick_intra_mode_sb() when the cached mode on a revisited sub-block did not use IntraBC.

Performance on RA, A1 (17 frames), A2 (33 frames) against the baseline commit: 24ff468

Speed	Bar   BD-rate PSNR-YUV	Enc_Speedup	    Ratio (A1 / A2)
1    	≥35      +0.13%	          7.80%	        52.0 / 60.0 (PASS)
2    	≥30      +0.10%	          2.50%	        31.3 / 25.0 (PASS)
3    	≥25      +0.06%	          2.98%	        33.1 / 49.7 (PASS)
4    	≥20      +0.07%	          4.69%	        46.9 / 67.0 (PASS)
5    	≥15      +0.12%	          3.88%	        29.8 / 32.3 (PASS)
6    	≥10      +0.14%	          2.75%	        18.3 / 19.6 (PASS)

STATS_CHANGED

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

Trade off looks good!

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

@chengchen-google, thanks for the efforts, I have two comments, could you please help take a look?

Comment thread av2/encoder/rdopt.c Outdated
Comment thread av2/encoder/intra_mode_search.c Outdated

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

Thanks @chengchen-google, LGTM.

1. Reuse cached intra modes (x->inter_mode_cache[0]) on revisited blocks
   within the same superblock pass in av2_rd_pick_intra_sby_mode() and
   av2_rd_pick_intra_sbuv_mode() when REUSE_INTRA_MODE_IN_INTERFRAME_FLAG
   is active, restricting search to the cached winning mode and DC_PRED.
2. Skip redundant IntraBC search in av2_rd_pick_intra_mode_sb() when the
   cached mode on a revisited sub-block did not use IntraBC.

Performance on RA, A1 (17 frames), A2 (33 frames) against the baseline
commit: 24ff468

```
Speed	Bar   BD-rate PSNR-YUV	Enc_Speedup	Ratio (A1 / A2)
1	≥35      +0.13%	          7.80%	        52.0 / 60.0 (PASS)
2	≥30      +0.10%	          2.50%	        31.3 / 25.0 (PASS)
3	≥25      +0.06%	          2.98%	        33.1 / 49.7 (PASS)
4	≥20      +0.07%	          4.69%	        46.9 / 67.0 (PASS)
5	≥15      +0.12%	          3.88%	        29.8 / 32.3 (PASS)
6	≥10      +0.14%	          2.75%	        18.3 / 19.6 (PASS)
```

STATS_CHANGED

Change-Id: I88a0eb283f7b11943cc8b24a6173d64ab87f2dca
@yunqingwang1
yunqingwang1 merged commit bd33bc0 into AOMediaCodec:av2-enc Oct 7, 2026
107 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.

5 participants