mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
a1f0dd24f6
commit
978c935f2f
@ -178,12 +178,6 @@ static void qsv_decode_flush(AVCodecContext *avctx)
|
|||||||
ff_qsv_decode_flush(avctx, &s->qsv);
|
ff_qsv_decode_flush(avctx, &s->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(QSVH2645Context, x)
|
#define OFFSET(x) offsetof(QSVH2645Context, x)
|
||||||
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
|
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
|
||||||
|
|
||||||
@ -191,7 +185,7 @@ static void qsv_decode_flush(AVCodecContext *avctx)
|
|||||||
static const AVOption hevc_options[] = {
|
static const AVOption hevc_options[] = {
|
||||||
{ "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VD },
|
{ "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VD },
|
||||||
|
|
||||||
{ "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, VD, "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, VD, "load_plugin" },
|
||||||
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VD, "load_plugin" },
|
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VD, "load_plugin" },
|
||||||
{ "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VD, "load_plugin" },
|
{ "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VD, "load_plugin" },
|
||||||
{ "hevc_hw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 0, 0, VD, "load_plugin" },
|
{ "hevc_hw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 0, 0, VD, "load_plugin" },
|
||||||
|
@ -217,12 +217,6 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)
|
|||||||
return ff_qsv_enc_close(avctx, &q->qsv);
|
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 OFFSET(x) offsetof(QSVHEVCEncContext, x)
|
||||||
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
||||||
static const AVOption options[] = {
|
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" },
|
{ "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" },
|
{ "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" },
|
{ "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_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" },
|
{ "hevc_hw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 0, 0, VE, "load_plugin" },
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 58
|
#define LIBAVCODEC_VERSION_MAJOR 58
|
||||||
#define LIBAVCODEC_VERSION_MINOR 42
|
#define LIBAVCODEC_VERSION_MINOR 42
|
||||||
#define LIBAVCODEC_VERSION_MICRO 102
|
#define LIBAVCODEC_VERSION_MICRO 103
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
|
Loading…
Reference in New Issue
Block a user