Repository navigation
Count the AMVD flag cost for same-ref compound and TIP modes - #5490
Merged
Merged
Conversation
Contributor
Author
|
Hello all, this PR is ready for review, could you please help review the code? |
urvangjoshi
marked this pull request as draft
October 13, 2026 18:24
yeqing-wu
force-pushed
the
fix/amvd-flag-cost
branch
from
October 13, 2026 20:58
9643e83 to
878bab9
Compare
urvangjoshi
marked this pull request as ready for review
October 13, 2026 22:52
Contributor
|
@leolzhao : could you review this one, as it's related to AMVD? |
urvangjoshi
removed their request for review
October 13, 2026 23:03
Contributor
Author
|
@leolzhao and @yunqingwang1 , could you please help review this PR? |
leolzhao
approved these changes
Oct 14, 2026
cost_prediction_mode() left out the adaptive MVD flag cost for same-ref compound modes and for TIP NEWMV, even though the flag is coded for every mode that allow_amvd_mode() accepts. The mode search tries both use_amvd values for these modes, so both were priced the same and the choice ignored the flag's rate. Add the cost to those two returns, and only count it when enable_adaptive_mvd is on, which is when the flag is actually coded. Anchor: commit 6169621 Speed 0 (cpu-used=0): VCWG CTC (130 frames, RA and LD) ``` 1) RA +------------+-------+-------+-------+-------+------+------+ | Class | Y | Cb | Cr | wAvg | Enc% | Dec% | +------------+-------+-------+-------+-------+------+------+ | A1 | -0.10 | -0.23 | -0.27 | -0.11 | 100 | 100 | | A2 | -0.14 | 0.03 | -0.19 | -0.13 | 100 | 99 | | A3 | -0.11 | -0.10 | -0.33 | -0.12 | 101 | 99 | | A4 | 0.04 | 0.02 | 0.47 | 0.05 | 99 | 99 | | A5 | -0.05 | -0.32 | 0.15 | -0.05 | 100 | 99 | | B1 | -0.06 | -0.15 | 0.02 | -0.06 | 100 | 99 | | B2 | -0.08 | -0.52 | 0.25 | -0.08 | 100 | 100 | | Avg w/o B2 | -0.09 | -0.09 | -0.09 | -0.09 | 100 | 99 | +------------+-------+-------+-------+-------+------+------+ 2) LD +------------+-------+-------+-------+-------+------+------+ | Class | Y | Cb | Cr | wAvg | Enc% | Dec% | +------------+-------+-------+-------+-------+------+------+ | A2 | -0.18 | -0.37 | -0.18 | -0.19 | 100 | 100 | | A3 | -0.28 | -0.52 | -0.28 | -0.29 | 100 | 100 | | A4 | -0.28 | -0.01 | 0.15 | -0.25 | 102 | 101 | | A5 | -0.50 | -0.08 | -0.96 | -0.50 | 101 | 101 | | B1 | -0.12 | 0.18 | 0.34 | -0.09 | 100 | 100 | | B2 | 0.05 | 0.02 | 0.52 | 0.07 | 101 | 100 | | Avg w/o B2 | -0.23 | -0.21 | -0.11 | -0.22 | 100 | 100 | +------------+-------+-------+-------+-------+------+------+ ``` STATS_CHANGED
leolzhao
force-pushed
the
fix/amvd-flag-cost
branch
from
October 14, 2026 17:22
878bab9 to
ab0d5b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cost_prediction_mode() left out the adaptive MVD flag cost for same-ref compound modes and for TIP NEWMV, even though the flag is coded for every mode that allow_amvd_mode() accepts. The mode search tries both use_amvd values for these modes, so both were priced the same and the choice ignored the flag's rate.
Add the cost to those two returns, and only count it when enable_adaptive_mvd is on, which is when the flag is actually coded.
Anchor: commit 6169621
Speed 0 (cpu-used=0): VCWG CTC (130 frames, RA and LD)
STATS_CHANGED