[FFmpeg-cvslog] avcodec/libaomenc: use ctx->usage to get default cfg

James Zern git at videolan.org
Tue Aug 24 01:53:02 EEST 2021


ffmpeg | branch: master | James Zern <jzern at google.com> | Fri Aug 13 19:00:50 2021 -0700| [cb23c1e55359dc1319690517251ee170d0d68bae] | committer: James Zern

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 at google.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb23c1e55359dc1319690517251ee170d0d68bae
---

 libavcodec/libaomenc.c | 4 +---
 libavcodec/version.h   | 2 +-
 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, \



More information about the ffmpeg-cvslog mailing list