Skip to content

Commit 04e5341

Browse files
committed
Disable key frame filtering when encoding images
Disable key frame filtering when encoding still images.
1 parent 4f40299 commit 04e5341

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codec_aom.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ static avifResult aomCodecEncodeImage(avifCodec * codec,
591591
if (aomCpuUsed != -1) {
592592
aom_codec_control(&codec->internal->encoder, AOME_SET_CPUUSED, aomCpuUsed);
593593
}
594+
if (addImageFlags & AVIF_ADD_IMAGE_FLAG_SINGLE) {
595+
// Disable temporal filtering on key frames, otherwise we will lose a good amount of compression
596+
// performance.
597+
aom_codec_control(&codec->internal->encoder, AV1E_SET_ENABLE_KEYFRAME_FILTERING, 0);
598+
}
594599
if (!avifProcessAOMOptionsPostInit(codec)) {
595600
return AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION;
596601
}

0 commit comments

Comments
 (0)