Skip to content

avmenc.c: Misc cleanup for config->arg_ctrls#5027

Merged
urvangjoshi merged 1 commit into
AOMediaCodec:mainfrom
wantehchang:clean-up-avmenc-arg_ctrls
Jun 3, 2026
Merged

avmenc.c: Misc cleanup for config->arg_ctrls#5027
urvangjoshi merged 1 commit into
AOMediaCodec:mainfrom
wantehchang:clean-up-avmenc-arg_ctrls

Conversation

@wantehchang
Copy link
Copy Markdown
Member

Document that the current value of the ARG_CTRL_CNT_MAX macro doesn't really make sense.

Handle invalid indexes for the config->arg_ctrls array rather than assert the indexes are valid.

Use the pre-increment ++ operator on config->arg_ctrl_cnt consistently.

When adding AVME_SET_QP to the config->arg_ctrls array, look for an existing array element rather than always insert at the end of the array.

Document that the current value of the ARG_CTRL_CNT_MAX macro doesn't
really make sense.

Handle invalid indexes for the config->arg_ctrls array rather than
assert the indexes are valid.

Use the pre-increment ++ operator on config->arg_ctrl_cnt consistently.

When adding AVME_SET_QP to the config->arg_ctrls array, look for an
existing array element rather than always insert at the end of the
array.
Comment thread apps/avmenc.c
@urvangjoshi urvangjoshi merged commit d80e3c3 into AOMediaCodec:main Jun 3, 2026
109 checks passed
Comment thread apps/avmenc.c
const int qp_val =
get_qindex_from_quantizer_and_warn(cq_level_val, "cq-level", "qp");
const int idx = config->arg_ctrl_cnt;
assert(idx < (int)ARG_CTRL_CNT_MAX);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note that it is not necessary to cast ARG_CTRL_CNT_MAX to int because the NELEMENTS macro already contains an int cast.

@wantehchang wantehchang deleted the clean-up-avmenc-arg_ctrls branch June 3, 2026 19:35
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.

3 participants