summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-01-22 21:02:17 -0300
committerJames Almer <jamrial@gmail.com>2020-01-24 20:03:46 -0300
commitc461500c5ec0ca6cf3de40adecf685a07dc52202 (patch)
tree956f69f506a0b890e764c96675f991ff32c7358f /libavcodec
parenta4f2fc9341c125c9e52e04f0f713c44592ecb54b (diff)
avcodec/libaomenc: add an option to set the encoder "usage"
This allows the user enable the realtime encoding speed mode Reviewed-by: James Zern <jzern@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libaomenc.c6
-rw-r--r--libavcodec/version.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index c36313bf9d..096aadbe1c 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -93,6 +93,7 @@ typedef struct AOMEncoderContext {
int enable_global_motion;
int enable_intrabc;
int enable_restoration;
+ int usage;
} AOMContext;
static const char *const ctlidstr[] = {
@@ -551,6 +552,8 @@ 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;
@@ -1090,6 +1093,9 @@ static const AVOption options[] = {
{ "enable-global-motion", "Enable global motion", OFFSET(enable_global_motion), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
{ "enable-intrabc", "Enable intra block copy prediction mode", OFFSET(enable_intrabc), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
{ "enable-restoration", "Enable Loop Restoration filtering", OFFSET(enable_restoration), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
+ { "usage", "Quality and compression efficiency vs speed tradeof", OFFSET(usage), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "usage"},
+ { "good", "Good quality", 0, AV_OPT_TYPE_CONST, {.i64 = 0 /* AOM_USAGE_GOOD_QUALITY */}, 0, 0, VE, "usage"},
+ { "realtime", "Realtime encoding", 0, AV_OPT_TYPE_CONST, {.i64 = 1 /* AOM_USAGE_REALTIME */}, 0, 0, VE, "usage"},
{ NULL },
};
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 6cf333eeb6..b438a09d6d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 66
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \