summaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec_other.c
diff options
context:
space:
mode:
authorLinjie Fu <linjie.fu@intel.com>2019-10-08 21:41:02 +0800
committerZhong Li <zhong.li@intel.com>2019-10-09 11:27:34 +0800
commit5345965b3f088ad5acd5151bec421c97470675a4 (patch)
tree55e28c563f3f87cf4627ded67ec89f34a50f5e97 /libavcodec/qsvdec_other.c
parent949a1b3e2f75338e17e446e97105e06ad6b4012a (diff)
downloadffmpeg-5345965b3f088ad5acd5151bec421c97470675a4.tar.gz
lavc/qsvdec: Add GPU-accelerated memory copy support
GPU copy enables or disables GPU accelerated copying between video and system memory. This may lead to a notable performance improvement. Memory must be sequent and aligned with 128x64. CMD: ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -c:v h264_qsv -gpu_copy on -i input.h264 -f null - or: ffmpeg -c:v h264_qsv -gpu_copy on -i input.h264 -f null - Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsvdec_other.c')
-rw-r--r--libavcodec/qsvdec_other.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c
index b044c11540..ff2834c20b 100644
--- a/libavcodec/qsvdec_other.c
+++ b/libavcodec/qsvdec_other.c
@@ -181,6 +181,11 @@ static void qsv_decode_flush(AVCodecContext *avctx)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption 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 },
+
+ { "gpu_copy", "A GPU-accelerated copy between video and system memory", OFFSET(qsv.gpu_copy), AV_OPT_TYPE_INT, { .i64 = MFX_GPUCOPY_DEFAULT }, MFX_GPUCOPY_DEFAULT, MFX_GPUCOPY_OFF, VD, "gpu_copy"},
+ { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_GPUCOPY_DEFAULT }, 0, 0, VD, "gpu_copy"},
+ { "on", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_GPUCOPY_ON }, 0, 0, VD, "gpu_copy"},
+ { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_GPUCOPY_OFF }, 0, 0, VD, "gpu_copy"},
{ NULL },
};