Skip to content

Skip partition revisits that cannot fit in the rd budget - #5578

Open
chengchen-google wants to merge 1 commit into
AOMediaCodec:av2-encfrom
chengchen-google:s18-skip-revisit-2c5c26
Open

chengchen-google wants to merge 1 commit into
AOMediaCodec:av2-encfrom
chengchen-google:s18-skip-revisit-2c5c26

Conversation

@chengchen-google

Copy link
Copy Markdown
Contributor

In one superblock pass, the partition search can reach the same block (same position, size and region type) from different parent partitions. Each search of such a block now keeps an rd bound in the SimpleMotionData entry of the block: the best rd cost if the search found a valid partition, or else the largest rd budget under which it found none. A later search of the block in the same pass is skipped when this bound is not smaller than its rd budget.

It applies only to inter frames, SHARED_PART trees and mixed inter-intra regions. It does not apply to the superblock, to blocks that must find a valid partition, or to blocks that use a template or an implied partition. The bounds are cleared at the start of each superblock.

New speed feature part_sf.skip_revisit_by_rd_bound, on at speed >= 1.

Performance on RA CTC.
Anchor:ec49095221d4cd1710662bb35609ca79a894f923

Speed  Class   PSNR-Y   PSNR-YUV  VMAF-NEG  SpeedUp
1     A1     +0.08%   +0.08%    -0.11%    -3.97%
1     A2     +0.09%   +0.11%    +0.03%    -5.06%
1     All    +0.09%   +0.10%    -0.01%    -4.74%

2     A1     +0.01%   +0.01%    -0.01%    -0.89%
2     A2     +0.05%   +0.05%    +0.23%    -3.98%
2     All    +0.04%   +0.03%    +0.16%    -3.07%

3     A1     +0.08%   +0.04%    +0.03%    -2.19%
3     A2     -0.01%   -0.01%    -0.11%    -2.48%
3     All    +0.01%   +0.01%    -0.07%    -2.39%

4     A1     -0.03%   -0.02%    +0.03%    -2.37%
4     A2     +0.02%   +0.02%    -0.00%    -2.23%
4     All    +0.00%   +0.01%    +0.01%    -2.27%

5     A1     +0.04%   +0.04%    +0.16%    -0.59%
5     A2     +0.02%   +0.03%    +0.09%    -1.36%
5     All    +0.03%   +0.03%    +0.11%    -1.13%

6     A1     -0.02%   -0.03%    -0.11%    -0.61%
6     A2     +0.03%   +0.04%    +0.03%    -0.89%
6     All    +0.01%   +0.02%    -0.01%    -0.80%

STATS_CHANGED

Comment thread av2/encoder/partition_search.c Outdated
Comment thread av2/encoder/partition_search.c
@chengchen-google
chengchen-google force-pushed the s18-skip-revisit-2c5c26 branch 2 times, most recently from 26a5bbf to 1bfe1de Compare October 23, 2026 18:52

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

LGTM, thanks

@urvangjoshi

Copy link
Copy Markdown
Contributor

@chengchen-google : there is a conflict. Pls rebase to fix it.

In one superblock pass, the partition search can reach the same block
(same position, size and region type) from different parent
partitions. Each search of such a block now keeps an rd bound in the
SimpleMotionData entry of the block: the best rd cost if the search
found a valid partition, or else the largest rd budget under which it
found none. A later search of the block in the same pass is skipped
when this bound is not smaller than its rd budget.

It applies only to inter frames, SHARED_PART trees and
mixed inter-intra regions. It does not apply to the superblock, to
blocks that must find a valid partition, or to blocks that use a
template or an implied partition. The bounds are cleared at the start
of each superblock.

New speed feature part_sf.skip_revisit_by_rd_bound, on at speed >= 1.

Performance on RA CTC.
Anchor:ec49095221d4cd1710662bb35609ca79a894f923

```
Speed  Class   PSNR-Y   PSNR-YUV  VMAF-NEG  SpeedUp
1     A1     +0.08%   +0.08%    -0.11%    -3.97%
1     A2     +0.09%   +0.11%    +0.03%    -5.06%
1     All    +0.09%   +0.10%    -0.01%    -4.74%

2     A1     +0.01%   +0.01%    -0.01%    -0.89%
2     A2     +0.05%   +0.05%    +0.23%    -3.98%
2     All    +0.04%   +0.03%    +0.16%    -3.07%

3     A1     +0.08%   +0.04%    +0.03%    -2.19%
3     A2     -0.01%   -0.01%    -0.11%    -2.48%
3     All    +0.01%   +0.01%    -0.07%    -2.39%

4     A1     -0.03%   -0.02%    +0.03%    -2.37%
4     A2     +0.02%   +0.02%    -0.00%    -2.23%
4     All    +0.00%   +0.01%    +0.01%    -2.27%

5     A1     +0.04%   +0.04%    +0.16%    -0.59%
5     A2     +0.02%   +0.03%    +0.09%    -1.36%
5     All    +0.03%   +0.03%    +0.11%    -1.13%

6     A1     -0.02%   -0.03%    -0.11%    -0.61%
6     A2     +0.03%   +0.04%    +0.03%    -0.89%
6     All    +0.01%   +0.02%    -0.01%    -0.80%
```

STATS_CHANGED

Change-Id: I99a944e12d5981471b150c37cf8ee533251288ac
@chengchen-google

Copy link
Copy Markdown
Contributor Author

@chengchen-google : there is a conflict. Pls rebase to fix it.

Done

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