aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKagami Hiiragi <kagami@genshiken.org>2017-03-02 21:19:09 +0300
committerJames Zern <jzern@google.com>2017-03-06 11:58:33 -0800
commit734d760e2fb2621040edef3536b5935e7bc45351 (patch)
treeb7800e3ba62d497e6beeebe2a8c0d412d4a64f02
parent8aa4f3bb4f772404ff43a3c8c9d5faaadafbdfdd (diff)
downloadffmpeg-734d760e2fb2621040edef3536b5935e7bc45351.tar.gz
lavc/libvpxenc: add -row-mt option
Signed-off-by: James Zern <jzern@google.com>
-rw-r--r--libavcodec/libvpxenc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index de0d0b6bcb..7c567a0d1d 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -108,6 +108,7 @@ typedef struct VPxEncoderContext {
int noise_sensitivity;
int vpx_cs;
float level;
+ int row_mt;
} VPxContext;
/** String mappings for enum vp8e_enc_control_id */
@@ -139,6 +140,9 @@ static const char *const ctlidstr[] = {
[VP9E_SET_TARGET_LEVEL] = "VP9E_SET_TARGET_LEVEL",
[VP9E_GET_LEVEL] = "VP9E_GET_LEVEL",
#endif
+#ifdef VPX_CTRL_VP9E_SET_ROW_MT
+ [VP9E_SET_ROW_MT] = "VP9E_SET_ROW_MT",
+#endif
#endif
};
@@ -720,6 +724,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
#if VPX_ENCODER_ABI_VERSION >= 12
codecctl_int(avctx, VP9E_SET_TARGET_LEVEL, ctx->level < 0 ? 255 : lrint(ctx->level * 10));
#endif
+#ifdef VPX_CTRL_VP9E_SET_ROW_MT
+ if (ctx->row_mt >= 0)
+ codecctl_int(avctx, VP9E_SET_ROW_MT, ctx->row_mt);
+#endif
}
#endif
@@ -1132,6 +1140,9 @@ static const AVOption vp9_options[] = {
#if VPX_ENCODER_ABI_VERSION >= 12
{"level", "Specify level", OFFSET(level), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 6.2, VE},
#endif
+#ifdef VPX_CTRL_VP9E_SET_ROW_MT
+ {"row-mt", "Row based multi-threading", OFFSET(row_mt), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
+#endif
LEGACY_OPTIONS
{ NULL }
};