Gate partition ML/pruning in fast two pass partitions - #5317
Conversation
This newly activates fast two pass partition for speed=2, while
improving speed-quality ratio for speed=3/4.
Some of the partition ML/pruning schemes interact poorly with the
fast two-pass partition search, so skip them in the dry pass and on
trusted wet-pass blocks. The full policy across regimes:
* FAST dry pass: disabled. Shape is picked from reduced-tool
RD, and the dry pass is already fast.
* FAST wet pass, forced: disabled. Partition is already fixed by the
dry-pass template; the decision is discarded.
* FAST wet pass, reopened: enabled. Block is genuinely searched.
* CONSERVATIVE / one-pass: enabled. Predicate is inert on this path.
Anchor: commit 7361d54
Speed 4 (cpu-used=4): FG16 CTC (33 frames, class A1 and A2, RA)
Speed 3 (cpu-used=3): FG16 CTC (33 frames, class A1 and A2, RA)
Speed 2 (cpu-used=2): FG16 CTC (33 frames, class A1 and A2, RA)
```
1) Speed 4 (cpu-used=4)
+------------+-------+-------+-------+-------+------+------+
| Class | Y | Cb | Cr | wAvg | Enc% | Dec% |
+------------+-------+-------+-------+-------+------+------+
| A1 | -0.73 | 0.26 | -0.05 | -0.66 | 106 | 101 |
| A2 | -0.49 | 0.22 | 0.20 | -0.43 | 105 | 101 |
| Avg w/o B2 | -0.56 | 0.23 | 0.12 | -0.50 | 105 | 101 |
+------------+-------+-------+-------+-------+------+------+
2) Speed 3 (cpu-used=3)
+------------+-------+-------+-------+-------+------+------+
| Class | Y | Cb | Cr | wAvg | Enc% | Dec% |
+------------+-------+-------+-------+-------+------+------+
| A1 | -0.75 | 0.08 | 0.17 | -0.68 | 106 | 101 |
| A2 | -0.47 | 0.18 | -0.15 | -0.43 | 104 | 100 |
| Avg w/o B2 | -0.55 | 0.15 | -0.05 | -0.51 | 105 | 100 |
+------------+-------+-------+-------+-------+------+------+
3) Speed 2 (cpu-used=2)
+------------+-------+-------+-------+-------+------+------+
| Class | Y | Cb | Cr | wAvg | Enc% | Dec% |
+------------+-------+-------+-------+-------+------+------+
| A1 | -0.50 | -2.10 | -2.72 | -0.65 | 84 | 87 |
| A2 | 0.46 | 1.97 | 1.60 | 0.56 | 83 | 95 |
| Avg w/o B2 | 0.17 | 0.76 | 0.32 | 0.20 | 84 | 93 |
+------------+-------+-------+-------+-------+------+------+
```
STATS_CHANGED
|
@yeqing-wu : I have a general question related to the fast two pass method: Reason for asking:
Given that fast two pass is enabled for speed >= 3 on that commit, I'm trying to understand something isn't fundamentally broken with this feature in combination with extended partitions. It's more important to double check this, as you move the feature to speed 2. Note: On commit 2abcfff (~1 week ago), the behavior was as expected (gain at both speed 2 and 4) |
|
Hi @urvangjoshi, thanks for your information. I haven’t conducted any special tests with the extended partitions turned on. All my tests are based on the default speed features in the av2-enc branch. Before I run the tests, let me confirm a few things:
Thanks |
Correct. For my tests, I basically moved this speed feature to speed 5 (to test gains on speed 2, 3 and 4).
The coding gains when enabling ext-partitions (on top of commit 2abcfff) were as follows (33 frames RA, all classes without B2):
The ratio isn't good enough to directly make this change, but I'm thinking about possible pruning methods to get some of the gains.
|
|
Got it. I can run some tests with sf->part_sf.disable_ext_partitions = false. By the way, when part_sf.disable_ext_partitions is set to true, how many partition shapes would be disabled? There’s no comment in the code explaining this, so could you please elaborate on it? Does it disable all 3-ways and 4-ways partitions? |
This will only enable the HORZ_3 / VERT_3 (that is, H shaped) partitions. |
This newly activates fast two pass partition for speed=2, while improving speed-quality ratio for speed=3/4.
Some of the partition ML/pruning schemes interact poorly with the fast two-pass partition search, so skip them in the dry pass and on trusted wet-pass blocks. The full policy across regimes:
RD, and the dry pass is already fast.
dry-pass template; the decision is discarded.
Anchor: commit 7361d54
Speed 4 (cpu-used=4): FG16 CTC (33 frames, class A1 and A2, RA)
Speed 3 (cpu-used=3): FG16 CTC (33 frames, class A1 and A2, RA)
Speed 2 (cpu-used=2): FG16 CTC (33 frames, class A1 and A2, RA)
STATS_CHANGED