Skip to content

Properly disable uneven 4-way partitions for > 270p at speed 1 - #5403

Merged
yeqing-wu merged 1 commit into
AOMediaCodec:av2-encfrom
urvangjoshi:mg__res_dep_disable_ue4way
Sep 13, 2026
Merged

Properly disable uneven 4-way partitions for > 270p at speed 1#5403
yeqing-wu merged 1 commit into
AOMediaCodec:av2-encfrom
urvangjoshi:mg__res_dep_disable_ue4way

Conversation

@urvangjoshi

Copy link
Copy Markdown
Contributor

This was attempted originally in
#5305, but it was not working as intended, because seq_params.enable_uneven_4way_partitions was set before any change to sf->part_sf.disable_uneven_4way_partitions was made.

We fix this as follows:

Update seq_params.enable_uneven_4way_partitions based on sf->part_sf.disable_uneven_4way_partitions in
av2_set_speed_features_framesize_dependent() before seq_params_locked.

At speed 1, this properly disables uneven 4-way partitions only when resolution is larger than 270p, while keeping them enabled for <= 270p. There is no behavior change for speed 0 (enabled for all resolutions) or speed >= 2 (disabled for all resolutions in framesize_independent).

Also, keep uneven 4-way partitions enabled for screen content at speed 1, as the loss / speed-up ratio is not good enough.

CTC RA 33 frames (Anchor: 4a8df58 + PR #5393):

+---------+--------+-------------+
| Summary |  YUV   |   Enc-time  |
+---------+--------+-------------+
|   A1    |  0.09% |    96.48%   |
|   A2    |  0.03% |    92.85%   |
|Avg wo B2|  0.10% |    92.18%   |
+---------+--------+-------------+

STATS_CHANGED for speed 1

This was attempted originally in
AOMediaCodec#5305, but it was not working as
intended, because seq_params.enable_uneven_4way_partitions was set
before any change to sf->part_sf.disable_uneven_4way_partitions was
made.

We fix this as follows:

Update seq_params.enable_uneven_4way_partitions based on
sf->part_sf.disable_uneven_4way_partitions in
av2_set_speed_features_framesize_dependent() before seq_params_locked.

At speed 1, this properly disables uneven 4-way partitions only when
resolution is larger than 270p, while keeping them enabled for <= 270p.
There is no behavior change for speed 0 (enabled for all resolutions)
or speed >= 2 (disabled for all resolutions in framesize_independent).

Also, keep uneven 4-way partitions enabled for screen content at speed
1, as the loss / speed-up ratio is not good enough.

CTC RA 33 frames (Anchor: 4a8df58 + PR AOMediaCodec#5393):

```
+---------+--------+-------------+
| Summary |  YUV   |   Enc-time  |
+---------+--------+-------------+
|   A1    |  0.09% |    96.48%   |
|   A2    |  0.03% |    92.85%   |
|Avg wo B2|  0.10% |    92.18%   |
+---------+--------+-------------+
```

STATS_CHANGED for speed 1
@yeqing-wu
yeqing-wu merged commit db16baa into AOMediaCodec:av2-enc Sep 13, 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.

3 participants