Skip to content

Remove extra dc skip guard from the final encoding stage - #5365

Draft
jingninghan wants to merge 1 commit into
AOMediaCodec:av2-encfrom
jingninghan:dcskip
Draft

Remove extra dc skip guard from the final encoding stage#5365
jingninghan wants to merge 1 commit into
AOMediaCodec:av2-encfrom
jingninghan:dcskip

Conversation

@jingninghan

Copy link
Copy Markdown
Contributor

The related functions were never called, as the mode search stage would ensure that if an intra block has eob is 1, its tx type must be 2D-DCT.

Tested in speed 1 and 4 for a5, a4, and a2, no coding stats change.

Comment thread av2/encoder/encodemb.c Outdated
cm->quant_params.base_qindex);
}
}
if (*eob == 1 && plane == 0) assert(tx_type == DCT_DCT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we improve this one so that we can avoid the condition check if it’s in release mode?
assert(!(*eob == 1 && plane == 0) || tx_type == DCT_DCT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. You can even use the IMPLIES macro we have for this:

assert(IMPLIES(condition, statement));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

I will put this on hold for now as unit test ran into failures.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jingninghan
jingninghan marked this pull request as draft September 3, 2026 03:55
The related functions were never called, as the mode search
stage would ensure that if an intra block has eob is 1, its
tx type must be 2D-DCT.

Tested in speed 1 and 4 for a5, a4, and a2, no coding stats
change.
@jingninghan
jingninghan marked this pull request as ready for review September 8, 2026 23:29
@jingninghan
jingninghan marked this pull request as draft September 9, 2026 04:19
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