Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-a cq-level=QP is overridden if -a end-usage=q is not also specified #953

Closed
wantehchang opened this issue May 20, 2022 · 0 comments · Fixed by #954
Closed

-a cq-level=QP is overridden if -a end-usage=q is not also specified #953

wantehchang opened this issue May 20, 2022 · 0 comments · Fixed by #954
Assignees

Comments

@wantehchang
Copy link
Collaborator

src/codec_aom.c has some code that sets the aom-specific cq-level option for the user if the user does not set -a cq-level=QP and -a end-usage=q. This depends on the endUsageSet and cqLevelSet booleans being set correctly.

I found that we neglect to set cqLevelSet if the aom library has the aom_codec_set_option() function. Since all recent versions of the aom library (v3.0.0 or later) have the aom_codec_set_option() function, this bug affects all recent versions of the aom library.

To reproduce this bug, run this command:

avifenc --min 0 --max 63 -a cq-level=18 -a tune=ssim happy_dog.jpg happy_dog.avif

src/codec_aom.c will set the cq-level option to (min + max) / 2 = (0 + 63) / 2 = 31, overriding the -a cq-level=18 option from the user.

Note that if -q end-usage=q is passed, then things work correctly:

avifenc --min 0 --max 63 -a end-usage=q -a cq-level=18 -a tune=ssim happy_dog.jpg happy_dog.avif

Note: Since src/codec_aom.c uses the aom library's all-intra mode for still image encoding, and -a end-usage=q is the default for the all-intra mode, it is tempting to omit the -a end-usage=q option. Until this bug is fixed, the -a end-usage=q option cannot be omitted.

wantehchang added a commit to wantehchang/libavif that referenced this issue May 20, 2022
Set the cqLevelSet boolean correctly when libaom has the
aom_codec_set_option() function.

Fix AOMediaCodec#953.
@wantehchang wantehchang self-assigned this May 20, 2022
wantehchang added a commit that referenced this issue May 20, 2022
Set the cqLevelSet boolean correctly when libaom has the
aom_codec_set_option() function.

Fix #953.
@wantehchang wantehchang mentioned this issue Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant