AV1: Use AOM_USAGE_REALTIME when creating encoder
libaom is compiled with REALTIME_ONLY option. Soon it will be impossible
to create encoder or request default config with usage other than
AOM_USAGE_REALTIME. Fixing the wrapper to use proper usage parameter
Bug: None
Change-Id: I862741a724e4a8524f22ae79700b3da6517dbfb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214100
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33624}
diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
index ddb52cb..8c82476 100644
--- a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
+++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
@@ -41,7 +41,7 @@
// Encoder configuration parameters
constexpr int kQpMin = 10;
-constexpr int kUsageProfile = 1; // 0 = good quality; 1 = real-time.
+constexpr int kUsageProfile = AOM_USAGE_REALTIME;
constexpr int kMinQindex = 145; // Min qindex threshold for QP scaling.
constexpr int kMaxQindex = 205; // Max qindex threshold for QP scaling.
constexpr int kBitDepth = 8;
@@ -195,7 +195,7 @@
// Initialize encoder configuration structure with default values
aom_codec_err_t ret =
- aom_codec_enc_config_default(aom_codec_av1_cx(), &cfg_, 0);
+ aom_codec_enc_config_default(aom_codec_av1_cx(), &cfg_, kUsageProfile);
if (ret != AOM_CODEC_OK) {
RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret
<< " on aom_codec_enc_config_default.";