Skip to content

[draft] Fix accidental disabling of masked compound in REFINE_ALL mode#5072

Open
kslu-aom wants to merge 1 commit into
AOMediaCodec:mainfrom
kslu-aom:opfl2-fix
Open

[draft] Fix accidental disabling of masked compound in REFINE_ALL mode#5072
kslu-aom wants to merge 1 commit into
AOMediaCodec:mainfrom
kslu-aom:opfl2-fix

Conversation

@kslu-aom

Copy link
Copy Markdown
Contributor

In REFINE_ALL mode, the encoder incorrectly disabled the search for masked compound modes (WEDGE and DIFFWTD) for regular compound modes such as NEW_NEWMV.

This issue was introduced in commit 7085cf3 ("CWG-F107 Fix OPFL issues and remove DAMR") after v10 anchor. There, the condition for masked_compound_used in process_compound_inter_mode(), which checked !opfl_allowed_cur_pred_mode(). Since mbmi->interinter_comp.type is initialized to COMPOUND_AVERAGE by default during the search, opfl_allowed_cur_pred_mode() returned true for regular modes in REFINE_ALL mode, incorrectly setting masked_compound_used to 0 and skipping the masked compound search.

This patch fixes the issue by changing the condition to check if the mode is a regular compound mode (mbmi->mode < NEAR_NEARMV_OPTFLOW) instead of using opfl_allowed_cur_pred_mode(). This ensures that masked compound is only disabled for explicit OPTFLOW modes (in REFINE_SWITCHABLE mode) and remains enabled for regular compound modes in REFINE_ALL mode.

This resolves a significant coding loss regression with --enable-opfl-refine=2

RA CTC on v15
Before the fix: +0.72% at 91.9% encoding time
After the fix: +0.2X% at XX.X% encoding time (Will update when results are ready)

In REFINE_ALL mode, the encoder incorrectly disabled the search for
masked compound modes (WEDGE and DIFFWTD) for regular compound modes
such as NEW_NEWMV.

This issue was introduced in commit 7085cf3 ("CWG-F107 Fix OPFL
issues and remove DAMR") after v10 anchor. There, the condition for
masked_compound_used in process_compound_inter_mode(), which checked
!opfl_allowed_cur_pred_mode(). Since mbmi->interinter_comp.type is
initialized to COMPOUND_AVERAGE by default during the search,
opfl_allowed_cur_pred_mode() returned true for regular modes in
REFINE_ALL mode, incorrectly setting masked_compound_used to 0 and
skipping the masked compound search.

This patch fixes the issue by changing the condition to check if the
mode is a regular compound mode (mbmi->mode < NEAR_NEARMV_OPTFLOW)
instead of using opfl_allowed_cur_pred_mode(). This ensures that
masked compound is only disabled for explicit OPTFLOW modes (in
REFINE_SWITCHABLE mode) and remains enabled for regular compound
modes in REFINE_ALL mode.

This resolves a significant coding loss regression with
--enable-opfl-refine=2

RA CTC on v15
Before the fix: +0.72% at 91.9% encoding time
After the fix: +0.26% at XX.X% encoding time
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.

2 participants