[FFmpeg-devel] [PATCH v2 22/22] lavfi/vpp_qsv: allow user to set scaling mode for vpp_qsv filter

Haihao Xiang haihao.xiang at intel.com
Mon May 17 06:24:26 EEST 2021


option 'scaling' accepts one of low_power and hq

$ ffmpeg -init_hw_device qsv -hwaccel qsv -c:v h264_qsv -i input.h264
-vf "vpp_qsv=scaling=hq" -f null -
---
 libavfilter/vf_vpp_qsv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 4607ece1c5..b994f1e408 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -637,6 +637,16 @@ static const AVOption vpp_options[] = {
     { "format", "Output pixel format", OFFSET(output_format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
     { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
 
+#if QSV_HAVE_SCALING
+    { "scaling",      "set scaling mode",    OFFSET(scaling_mode),    AV_OPT_TYPE_INT,    { .i64 = MFX_SCALING_MODE_DEFAULT}, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, FLAGS, "mode"},
+    { "low_power", "low power mode",        0,             AV_OPT_TYPE_CONST,  { .i64 = MFX_SCALING_MODE_LOWPOWER}, INT_MIN, INT_MAX, FLAGS, "mode"},
+    { "hq",        "high quality mode",     0,             AV_OPT_TYPE_CONST,  { .i64 = MFX_SCALING_MODE_QUALITY},  INT_MIN, INT_MAX, FLAGS, "mode"},
+#else
+    { "scaling",      "(not supported)",     OFFSET(scaling_mode),    AV_OPT_TYPE_INT,    { .i64 = 0}, 0, INT_MAX, FLAGS, "mode"},
+    { "low_power", "",                      0,             AV_OPT_TYPE_CONST,  { .i64 = 1}, 0,   0,     FLAGS, "mode"},
+    { "hq",        "",                      0,             AV_OPT_TYPE_CONST,  { .i64 = 2}, 0,   0,     FLAGS, "mode"},
+#endif
+
     { NULL }
 };
 
-- 
2.25.1



More information about the ffmpeg-devel mailing list