summaryrefslogtreecommitdiff
path: root/libavcodec/qsvenc_hevc.c
diff options
context:
space:
mode:
authorZhong Li <zhong.li@intel.com>2018-12-12 15:03:21 +0800
committerZhong Li <zhong.li@intel.com>2018-12-18 15:15:18 +0800
commit978c935f2f659edf028b9219c7397efdcf4a1260 (patch)
treed15e09445081304b55e92adc0e126cc9a1e541d6 /libavcodec/qsvenc_hevc.c
parenta1f0dd24f62532ff82ac87fbcb01244e6cdfa424 (diff)
lavc/qsv_hevc: correct QSV HEVC default plugin on Windows
1. Old logic meaned: everywhere, except Windows, ffmpeg has to use HW acceleration, but on Windows ffmpeg has to use (unavailable) software HEVC by default 2. Software HEVC is available only if you provide corresponding software MediaSDK library, which isn't provided with ffmpeg. More information could be found in https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/samples/readme-encode_linux.pdf 3. HW HEVC decoding/encoding are available on Windows in the driver by default Note: Default case should be the most common case but this change still has potential risk on windows if HW path is not supported(or doesn't work as expection). (See the historical disscution: https://lists.libav.org/pipermail/libav-devel/2016-November/080419.html). In such case, two options suggested: 1. Use the option "-load_plugin hevc_sw" to switch SW path manually. 2. Or report bug to Intel windows driver if your GPU can support HEVC HW codec. (HEVC decoding is supported since Braswell, and encoding supported since Skylake) Patch started by Landgraph. Add similar change for hevc decoder and bump a new version. Reviewed-by: Mark Thompson <sw@jkqxz.net> Reviewed-by: Maxym Dmytrychenko <maxim.d33@gmail.com> Signed-off-by: Landgraph <me@landgraph.ru> Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsvenc_hevc.c')
-rw-r--r--libavcodec/qsvenc_hevc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index 4339b316a3..1c615b4e81 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -217,12 +217,6 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)
return ff_qsv_enc_close(avctx, &q->qsv);
}
-#if defined(_WIN32)
-#define LOAD_PLUGIN_DEFAULT LOAD_PLUGIN_HEVC_SW
-#else
-#define LOAD_PLUGIN_DEFAULT LOAD_PLUGIN_HEVC_HW
-#endif
-
#define OFFSET(x) offsetof(QSVHEVCEncContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
@@ -230,7 +224,7 @@ static const AVOption options[] = {
{ "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT_MAX, VE, "idr_interval" },
{ "begin_only", "Output an IDR-frame only at the beginning of the stream", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, VE, "idr_interval" },
- { "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_DEFAULT }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VE, "load_plugin" },
+ { "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_HEVC_HW }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VE, "load_plugin" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VE, "load_plugin" },
{ "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VE, "load_plugin" },
{ "hevc_hw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 0, 0, VE, "load_plugin" },