Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ The changes are relative to the previous release, unless the baseline is specifi
* Set tuning before applying the user-provided specific aom codec options.
* Use AOM_TUNE_PSNR by default when encoding alpha with libaom because
AOM_TUNE_SSIM causes ringing for alpha.
* Use AOM_TUNE_IQ by default when encoding still non-RGB color samples with
libaom v3.13.0 or later.
* Converting an image containing a gain map using avifenc with the --grid flag
now also splits the gain map into a grid.

Expand Down
2 changes: 1 addition & 1 deletion apps/avifenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static void syntaxLong(void)
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");
printf(" tune=METRIC : Tune the encoder for distortion metric, one of 'psnr', 'ssim' or 'iq'.\n");
printf(" (Default for color: ssim, default for alpha: psnr)\n");
printf(" (Default for color: still non-RGB images (libaom v3.13.0+): iq, otherwise: ssim; default for alpha: psnr)\n");
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
14 changes: 14 additions & 0 deletions src/codec_aom.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,20 @@ static avifResult aomCodecEncodeImage(avifCodec * codec,
libavifDefaultTuneMetric = AOM_TUNE_PSNR;
} else {
libavifDefaultTuneMetric = AOM_TUNE_SSIM;
#if defined(AOM_HAVE_TUNE_IQ)
// AOM_TUNE_IQ has been tuned for the YCbCr family of color spaces, and is favored for
// its low perceptual distortion. AOM_TUNE_IQ partially generalizes to, and benefits
// from other "YUV-like" spaces (e.g. YCgCo and ICtCp) including monochrome (luma only).
// AOM_TUNE_IQ sets --deltaq-mode=6 which can only be used in all intra mode.
// AOM_TUNE_IQ was introduced in libaom v3.12.0 but it has significantly different bit
// allocation characteristics compared to v3.13.0. AOM_TUNE_IQ is used by default
// starting with v3.13.0 for fewer behavior changes in libavif.
static const int aomVersion_3_13_0 = (3 << 16) | (13 << 8);
if (image->matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_IDENTITY && aomUsage == AOM_USAGE_ALL_INTRA &&
aomVersion >= aomVersion_3_13_0) {
libavifDefaultTuneMetric = AOM_TUNE_IQ;
}
#endif
Comment thread
wantehchang marked this conversation as resolved.
}
}
}
Expand Down
Loading