av1: use AOM_FRAME_IS_KEY instead of AOM_EFLAG_FORCE_KF
to determine if a frame is a key frame.
AOM_EFLAG_FORCE_KF is a flag passed to the encoder and should not be compared with the output aom_codec_frame_flags_t AOM_FRAME_IS_KEY even though both have the same value.
drive-by bugfix from the bug linked below
Bug: webrtc:434975748
Change-Id: I03a8ab385e7764d1064a51029c90d7ce6f54b7e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/402582
Reviewed-by: Danil Chapovalov <[email protected]>
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Philipp Hancke <[email protected]>
Cr-Commit-Position: refs/heads/main@{#45251}
diff --git a/api/video_codecs/libaom_av1_encoder_factory.cc b/api/video_codecs/libaom_av1_encoder_factory.cc
index f82538f..d79719a 100644
--- a/api/video_codecs/libaom_av1_encoder_factory.cc
+++ b/api/video_codecs/libaom_av1_encoder_factory.cc
@@ -781,7 +781,7 @@
aom_codec_get_cx_data(&ctx_, &iter)) {
if (pkt->kind == AOM_CODEC_CX_FRAME_PKT && pkt->data.frame.sz > 0) {
SET_OR_RETURN(AOME_GET_LAST_QUANTIZER_64, &result.encoded_qp);
- result.frame_type = pkt->data.frame.flags & AOM_EFLAG_FORCE_KF
+ result.frame_type = pkt->data.frame.flags & AOM_FRAME_IS_KEY
? FrameType::kKeyframe
: FrameType::kDeltaFrame;
ArrayView<uint8_t> output_buffer =
diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
index 6f4aa40..8c64a56 100644
--- a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
+++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
@@ -784,7 +784,7 @@
/*data=*/static_cast<const uint8_t*>(pkt->data.frame.buf),
/*size=*/pkt->data.frame.sz));
- if ((pkt->data.frame.flags & AOM_EFLAG_FORCE_KF) != 0) {
+ if ((pkt->data.frame.flags & AOM_FRAME_IS_KEY) != 0) {
layer_frame->Keyframe();
}