Repository navigation
Reuse counterparts in partition search - #5524
Conversation
2cd2bdf to
80dc5f1
Compare
|
@chengchen-google : from the title "redundant partition search and dry-run evaluations", my first impression was that we are removing redundant computations without changing output. Can you clarify if any of the 3 changes listed are neutral / near-neutral? And which changes actually result in a loss? Then, perhaps I can review carefully to see if there are improvements possible? |
Stats change is expected. The change aims to reuse the same partition decisions for the block that its counterpart is previously searched. For example: If SPLIT has been searched, later in the HORZ --> VERT search, qudrants Q00 and Q01 could reuse the same decision from SPLIT. So, it is a fast method, not identical. |
4039bcc to
73b4279
Compare
|
@chengchen-google : as discussed offline, it will be good to know a breakdown results of different parts in this PR -- to see how much speed-up / loss each part has. Thanks! |
Hi @urvangjoshi , as discussed offline, the PR consists of two parts. The numbers have changed significantly as compared to the initial submission when the anchor is 24ff468. In addition, we discussed offline that "skip the non-root DRY_RUN_NORMAL pass on the last sub-block (except for LUMA_PART in inter-frame INTRA_REGION) right before context restoration" seems unnecessary. I agree that this part is not critical for speed, but could be misleading. I deleted this part in the updated version. |
73b4279 to
c4ad4ec
Compare
Thanks for the breakdown numbers! A few things I noticed:
So, I'll suggest trimming the PR down to just part 1, as the idea seems both theoretically sound and practically verified to have minimal loss. (Remove part 2 from this PR). You can later tune / re-test part 2 in future PRs.
Actually, thought more about this and there maybe something to this idea -- but let's discuss and we can create a PR separately for this part later if it makes sense. |
c4ad4ec to
41b933f
Compare
|
I trimmed the PR to contain the part 1, reusing the counterpart in partition search. |
1. Extend av2_look_for_counterpart_block() to reuse evaluated PARTITION_SPLIT quadrants (Q01, Q10, Q11) during HORZ -> VERT sub-partition search when all preceding quadrants in raster order match in partitioning and RD cost, and prefer valid (non-aborted) candidates in counterpart_from_different_partition(). 2. In av2_rd_pick_partition(), factor counterpart eligibility into can_reuse_counterpart_block() and reject counterpart blocks whose RD cost exceeds best_rdc before copying the PC_TREE or running encode_sb(DRY_RUN_NORMAL). Performance on RA CTC, Class A1 (4K, 17 frames) + Class A2 (1080p, 33 frames), Anchor: 14fde9b ``` Speed Class PSNR-Y PSNR-YUV VMAF-NEG EncTime 1 A1 -0.02% -0.01% -0.00% -1.24% 1 A2 -0.00% -0.01% +0.00% -1.54% 1 All -0.01% -0.01% +0.00% -1.45% 2 A1 +0.01% -0.02% +0.20% -0.08% 2 A2 -0.03% -0.02% -0.12% -0.18% 2 All -0.02% -0.02% -0.02% -0.15% 3 A1 +0.04% +0.05% +0.11% -0.18% 3 A2 -0.01% -0.01% -0.00% +0.58% 3 All +0.00% +0.01% +0.03% +0.35% 4 A1 +0.08% +0.09% +0.07% -0.43% 4 A2 +0.03% +0.02% +0.13% +0.01% 4 All +0.05% +0.04% +0.11% -0.12% 5 A1 -0.02% -0.04% +0.00% +0.63% 5 A2 +0.02% +0.01% -0.03% -0.16% 5 All +0.01% -0.01% -0.02% +0.08% 6 A1 -0.00% -0.03% +0.09% -1.78% 6 A2 -0.04% -0.03% -0.05% -0.40% 6 All -0.03% -0.03% -0.01% -0.81% ``` STATS_CHANGED Change-Id: I4853f5b501a06f98446899c2253eb88b7a2acb3f
Extend av2_look_for_counterpart_block() to reuse evaluated
PARTITION_SPLIT quadrants (Q01, Q10, Q11) during HORZ -> VERT
sub-partition search when all preceding quadrants in raster order
match in partitioning and RD cost, and prefer valid (non-aborted)
candidates in counterpart_from_different_partition().
Performance on RA CTC, Class A1 (4K, 17 frames) + Class A2 (1080p,
33 frames), Anchor: 14fde9b
STATS_CHANGED