Skip to content

Reduce intra mode top count to 3 for speed 3 and 4 - #5289

Open
chengchen-google wants to merge 1 commit into
AOMediaCodec:av2-encfrom
chengchen-google:0818/P08_s4_intra_top2_all_contexts
Open

Reduce intra mode top count to 3 for speed 3 and 4#5289
chengchen-google wants to merge 1 commit into
AOMediaCodec:av2-encfrom
chengchen-google:0818/P08_s4_intra_top2_all_contexts

Conversation

@chengchen-google

@chengchen-google chengchen-google commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

By reducing the number of candidates, we achieve a considerable
speed up with accepted coding loss.

Result of reducing the count to 3 for speed 4:

TestSet PSNR-YUV EncTime Ratio
A1 (17 frames) 0.10% 96.70% 34.1
A2 (33 frames) 0.07% 96.81% 47.0

Result of reducing the count to 3 for speed 3:

TestSet PSNR-YUV EncTime Ratio
A1 (17 frames) 0.11% 96.87% 29.4
A2 (33 frames) 0.09% 96.41% 41.3

If we reduce the count to 2
The speedup/loss ratio is good for A2, but not good enough for A1.
On speed 4, RA, the performance is:

TestSet PSNR-YUV EncTime Ratio
A1 (17 frames) 0.41% 92.76% 19.0
A2 (33 frames) 0.19% 93.44% 36.9

STATS_CHANGED

@chengchen-google
chengchen-google force-pushed the 0818/P08_s4_intra_top2_all_contexts branch from 4b4d9fb to 6c7a607 Compare August 19, 2026 20:41
@urvangjoshi

Copy link
Copy Markdown
Contributor

The ratio for A1 set seems less than the threshold, right?
What if you used value 3 instead of 2?

@chengchen-google

Copy link
Copy Markdown
Contributor Author

The ratio for A1 set seems less than the threshold, right? What if you used value 3 instead of 2?

Yes, you are right. I am testing 3.

@leolzhao

Copy link
Copy Markdown
Contributor

The trade off for class A1 is a little bit worse than the threshold, what about enabling this speed feature for speed 5 and above? @chengchen-google

@leolzhao

Copy link
Copy Markdown
Contributor

The ratio for A1 set seems less than the threshold, right? What if you used value 3 instead of 2?

Yes, you are right. I am testing 3.

if 3 is good for cpu-used 4, we can set it to 3 for speed 4 and 2 for speed 5 and above.

@chengchen-google

Copy link
Copy Markdown
Contributor Author

I tested to reduce the count to 3 and tested on speed 3 and 4. The tradeoff is better. Please see the updated commit message.

@chengchen-google
chengchen-google force-pushed the 0818/P08_s4_intra_top2_all_contexts branch from 6c7a607 to 2b06d27 Compare August 20, 2026 19:17
@chengchen-google chengchen-google changed the title Reduce intra mode top count to 2 for speed 4 Reduce intra mode top count to 3 for speed 3 and 4 Aug 20, 2026
@chengchen-google
chengchen-google force-pushed the 0818/P08_s4_intra_top2_all_contexts branch 2 times, most recently from cb2169e to 849ea3e Compare August 21, 2026 17:29
@yeqing-wu

Copy link
Copy Markdown
Contributor

What is the anchor of the results? Meanwhile, should we remove 'Change-Id: Ib9dba881748b9106f295f4d468cdbf0367e28a7d'?

@chengchen-google

Copy link
Copy Markdown
Contributor Author

What is the anchor of the results? Meanwhile, should we remove 'Change-Id: Ib9dba881748b9106f295f4d468cdbf0367e28a7d'?

The anchor is ea89c21.

By reducing the number of candidates, we achieve a considerable
speed up with accepted coding loss.

Result of reducing the count to 3 for speed 4:

TestSet          PSNR-YUV   EncTime    Ratio
A1 (17 frames)    0.10%      96.70%    34.1
A2 (33 frames)    0.07%      96.81%    47.0

Result of reducing the count to 3 for speed 3:

TestSet          PSNR-YUV   EncTime    Ratio
A1 (17 frames)    0.11%      96.87%    29.4
A2 (33 frames)    0.09%      96.41%    41.3

If we reduce the count to 2
The speedup/loss ratio is good for A2, but not good enough for A1.
On speed 4, RA, the performance is:

TestSet          PSNR-YUV   EncTime    Ratio
A1 (17 frames)    0.41%      92.76%    19.0
A2 (33 frames)    0.19%      93.44%    36.9

STATS_CHANGED

Change-Id: Ib9dba881748b9106f295f4d468cdbf0367e28a7d
@leolzhao
leolzhao force-pushed the 0818/P08_s4_intra_top2_all_contexts branch from 849ea3e to 5629415 Compare August 21, 2026 22:30
@chengchen-google
chengchen-google force-pushed the 0818/P08_s4_intra_top2_all_contexts branch from 5629415 to 9410f98 Compare August 21, 2026 22:32
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