summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2021-08-13 19:00:50 -0700
committerJames Zern <jzern@google.com>2021-08-23 15:33:51 -0700
commitcb23c1e55359dc1319690517251ee170d0d68bae (patch)
treef79b2fb6d199adc3e83e15aa4c187af2b38cca72
parent7f194c7d965ff9791e498074ca803ab0a097fa01 (diff)
avcodec/libaomenc: use ctx->usage to get default cfg
this prevents some mismatches in config values for realtime and all intra modes, avoiding failures like: [libaom-av1 @ ...] Failed to initialize encoder: Invalid parameter [libaom-av1 @ ...] Additional information: g_lag_in_frames out of range [..0] Signed-off-by: James Zern <jzern@google.com>
-rw-r--r--libavcodec/libaomenc.c4
-rw-r--r--libavcodec/version.h2
2 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 9c0317f3b2..800fda0591 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -599,7 +599,7 @@ static av_cold int aom_init(AVCodecContext *avctx,
av_log(avctx, AV_LOG_INFO, "%s\n", aom_codec_version_str());
av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_build_config());
- if ((res = aom_codec_enc_config_default(iface, &enccfg, 0)) != AOM_CODEC_OK) {
+ if ((res = aom_codec_enc_config_default(iface, &enccfg, ctx->usage)) != AOM_CODEC_OK) {
av_log(avctx, AV_LOG_ERROR, "Failed to get config: %s\n",
aom_codec_err_to_string(res));
return AVERROR(EINVAL);
@@ -623,8 +623,6 @@ static av_cold int aom_init(AVCodecContext *avctx,
enccfg.g_threads =
FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 64);
- enccfg.g_usage = ctx->usage;
-
if (ctx->lag_in_frames >= 0)
enccfg.g_lag_in_frames = ctx->lag_in_frames;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 8cdbb4ecf3..6334fa9be6 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 59
#define LIBAVCODEC_VERSION_MINOR 5
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \