Skip to content

Commit 7e6bd0d

Browse files
committed
Use AOM_TUNE_IQ only for non-alpha and non-id MC
1 parent 088b68a commit 7e6bd0d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/avifenc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static void syntaxLong(void)
312312
printf(" enable-chroma-deltaq=B : Enable delta quantization in chroma planes. 0=disable (default), 1=enable\n");
313313
printf(" end-usage=MODE : Rate control mode, one of 'vbr', 'cbr', 'cq', or 'q'\n");
314314
printf(" sharpness=S : Bias towards block sharpness in rate-distortion optimization of transform coefficients in 0..7. (Default: 0)\n");
315-
printf(" tune=METRIC : Tune the encoder for distortion metric, one of 'psnr', 'ssim' or 'iq'. (Default for aom 3.12+ still images: iq, otherwise ssim)\n");
315+
printf(" tune=METRIC : Tune the encoder for distortion metric, one of 'psnr', 'ssim' or 'iq'. (Default for aom 3.12+ still images YUV: iq, otherwise ssim)\n");
316316
printf(" film-grain-test=TEST : Film grain test vectors in 0..16. 0=none (default), 1=test1, 2=test2, ... 16=test16\n");
317317
printf(" film-grain-table=FILENAME : Path to file containing film grain parameters\n");
318318
printf("\n");

src/codec_aom.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,9 @@ static avifResult aomCodecEncodeImage(avifCodec * codec,
889889
if (!lossless && !codec->internal->tuningSet) {
890890
aom_tune_metric tuneMetric = AOM_TUNE_SSIM;
891891
#if defined(AOM_HAVE_TUNE_IQ)
892+
// AOM_TUNE_IQ is favored for its low perceptual distortion on luma and chroma samples.
892893
// AOM_TUNE_IQ sets --deltaq-mode=6 which can only be used in all intra mode.
893-
if (aomUsage == AOM_USAGE_ALL_INTRA) {
894+
if (!alpha && image->matrixCoefficients != AVIF_MATRIX_COEFFICIENTS_IDENTITY && aomUsage == AOM_USAGE_ALL_INTRA) {
894895
tuneMetric = AOM_TUNE_IQ;
895896
}
896897
#endif

0 commit comments

Comments
 (0)