Skip to content

Support Level 2 orientation partition pruning for 4K at Speed >= 6 - #5402

Merged
urvangjoshi merged 2 commits into
AOMediaCodec:av2-encfrom
chengchen-google:0911/s6_orient_unblunted_on_pr5275
Sep 22, 2026
Merged

urvangjoshi merged 2 commits into
AOMediaCodec:av2-encfrom
chengchen-google:0911/s6_orient_unblunted_on_pr5275

Conversation

@chengchen-google

Copy link
Copy Markdown
Contributor

Support Level 2 orientation partition pruning for 4K at Speed >= 6

The performance on RA, speed 6, A1:

BD-Rate (YUV)  Speedup      Ratio
+1.09%         +14.32%       13.1

STATS_CHANGED

@chengchen-google

Copy link
Copy Markdown
Contributor Author

Note that this PR is a follow-up of #5275

The diff is much smaller than the patch shows.
Diff:

-  const uint64_t frame_scaled = orientation_anisotropy_for_frame(cpi, 1);
-  if (frame_scaled == 0) return;
-  const uint64_t anisotropy =
-      orientation_anisotropy_for_bsize(bsize, base_anisotropy) * frame_scaled;
+  uint64_t anisotropy;
+  if (cpi->sf.part_sf.prune_by_struct_orient >= 2) {
+    // Level 2 (unblunted mode for 4K at speed >= 6): prune across all frames
+    // regardless of temporal layer depth (patch 0006d).
+    anisotropy = base_anisotropy;
+  } else {
+    const uint64_t frame_scaled = orientation_anisotropy_for_frame(cpi, 1);
+    if (frame_scaled == 0) return;
+    anisotropy =
+        orientation_anisotropy_for_bsize(bsize, base_anisotropy) * frame_scaled;
+  }

+    if (is_4k_or_larger) {
+      sf->part_sf.prune_by_struct_orient = 2;
+    }

-  bool prune_by_struct_orient;
+  // Prune rectangular and extended partitions based on structure orientation
+  // of the source signal.
+  // 0: disabled
+  // 1: standard (size-graded anisotropy with GOP temporal layer protection)
+  // 2: unblunted (prunes across all GOP temporal layers for 4K at speed >= 6)
+  int prune_by_struct_orient;

@chengchen-google
chengchen-google force-pushed the 0911/s6_orient_unblunted_on_pr5275 branch from 2d4cdaf to e4a924a Compare September 15, 2026 21:06
@urvangjoshi

Copy link
Copy Markdown
Contributor

@chengchen-google : I believe this PR depends on the base PR? If so, @yeqing-wu could you review the base PR trade-off?

Also @chengchen-google : the PR title / description will become commit message after merging, so pls edit it.

@chengchen-google
chengchen-google force-pushed the 0911/s6_orient_unblunted_on_pr5275 branch from e4a924a to 5b1e837 Compare September 21, 2026 20:46
@chengchen-google chengchen-google changed the title 0911/s6 orient unblunted on pr5275 Support Level 2 orientation partition pruning for 4K at Speed >= 6 Sep 21, 2026
@chengchen-google

Copy link
Copy Markdown
Contributor Author

@chengchen-google : I believe this PR depends on the base PR? If so, @yeqing-wu could you review the base PR trade-off?

Also @chengchen-google : the PR title / description will become commit message after merging, so pls edit it.

Done. Thanks for the suggestion.

Comment thread av2/encoder/speed_features.c Outdated
@chengchen-google
chengchen-google force-pushed the 0911/s6_orient_unblunted_on_pr5275 branch from 5b1e837 to 88c635e Compare September 21, 2026 21:20
The speed feature shows a good tradeoff for speed 5, A1.

We turn it on for A1 only.

RA performance:

Speed   	A1 BD-Rate (YUV)  A1 Speedup	A1 Ratio
Speed_4		+0.16%	           +1.61%	10.1
Speed_5		+0.14%	           +3.09%	22.1

Speed   	A2 BD-Rate (YUV)  A2 Speedup	A2 Ratio
Speed_4		+0.19%		   +2.96%	15.6
Speed_5		+0.21%		   +2.89%	13.8

STATS_CHANGED

Change-Id: Iea96600b64fdd27c83efc1250d46b4a90ccb5878
The performance on RA, speed 6, A1:

BD-Rate (YUV)  Speedup      Ratio
+1.09%         +14.32%       13.1

STATS_CHANGED

Change-Id: I5e74f4ffd130e16864e834a94627a8bf2d285bb7
@urvangjoshi
urvangjoshi force-pushed the 0911/s6_orient_unblunted_on_pr5275 branch from 88c635e to 00ec3c4 Compare September 22, 2026 17:21
@urvangjoshi
urvangjoshi merged commit 9b284ed into AOMediaCodec:av2-enc Sep 22, 2026
2 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.

4 participants