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

WIP: Allow AOM_HAVE_TUNE_IQ #2599

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/avifenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ static void syntaxLong(void)
printf(" enable-chroma-deltaq=B : Enable delta quantization in chroma planes. 0=disable (default), 1=enable\n");
printf(" end-usage=MODE : Rate control mode, one of 'vbr', 'cbr', 'cq', or 'q'\n");
printf(" sharpness=S : Bias towards block sharpness in rate-distortion optimization of transform coefficients in 0..7. (Default: 0)\n");
#if defined(AOM_HAVE_TUNE_IQ)
printf(" tune=METRIC : Tune the encoder for distortion metric, one of 'psnr', 'ssim' or 'iq'. (Default: iq)\n");
#else
printf(" tune=METRIC : Tune the encoder for distortion metric, one of 'psnr' or 'ssim'. (Default: psnr)\n");
#endif
vrabaud marked this conversation as resolved.
Show resolved Hide resolved
printf(" film-grain-test=TEST : Film grain test vectors in 0..16. 0=none (default), 1=test1, 2=test2, ... 16=test16\n");
printf(" film-grain-table=FILENAME : Path to file containing film grain parameters\n");
printf("\n");
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/LocalAom.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(AVIF_AOM_GIT_TAG v3.11.0)
set(AVIF_AOM_GIT_TAG 2454213a72f194522c98610ef17057c226ffe391)
set(AVIF_AVM_GIT_TAG research-v9.0.0)
vrabaud marked this conversation as resolved.
Show resolved Hide resolved

if(AVIF_CODEC_AVM)
Expand Down
13 changes: 11 additions & 2 deletions src/codec_aom.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ struct aomOptionDef
static const struct aomOptionEnumList tuningEnum[] = { //
{ "psnr", AOM_TUNE_PSNR }, //
{ "ssim", AOM_TUNE_SSIM }, //
#if defined(AOM_HAVE_TUNE_IQ)
{ "iq", AOM_TUNE_IQ }, //
#endif
vrabaud marked this conversation as resolved.
Show resolved Hide resolved
{ NULL, 0 }
};

Expand Down Expand Up @@ -871,8 +874,14 @@ static avifResult aomCodecEncodeImage(avifCodec * codec,
if (!avifProcessAOMOptionsPostInit(codec, alpha)) {
return AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION;
}
if (!codec->internal->tuningSet) {
if (aom_codec_control(&codec->internal->encoder, AOME_SET_TUNING, AOM_TUNE_SSIM) != AOM_CODEC_OK) {
if (!lossless && !codec->internal->tuningSet) {
#if defined(AOM_HAVE_TUNE_IQ)
if (aomUsage == AOM_USAGE_ALL_INTRA &&
aom_codec_control(&codec->internal->encoder, AOME_SET_TUNING, AOM_TUNE_IQ) != AOM_CODEC_OK) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are not ready to make AOM_HAVE_TUNE_IQ the default in libavif yet. But we can think about how to make the new tuning mode more discoverable.

For example, if we release libavif v1.2.0 after libaom v3.12.0 is released, we can mention the libaom codec-specific option tune=iq in the libavif v1.2.0 release notes.

return AVIF_RESULT_UNKNOWN_ERROR;
} else
#endif
if (aom_codec_control(&codec->internal->encoder, AOME_SET_TUNING, AOM_TUNE_SSIM) != AOM_CODEC_OK) {
return AVIF_RESULT_UNKNOWN_ERROR;
}
}
Expand Down
Loading