diff options
author | Linjie Fu | 2018-11-29 14:14:22 +0800 |
---|---|---|
committer | Zhong Li | 2019-01-10 21:48:07 +0800 |
commit | e92ce340e63058de32aec733b59fe2b196bed214 (patch) | |
tree | 86ffad65395fede6550521ab6ccd39a50be60ddb /libavcodec/qsvenc.c | |
parent | ed3b64402ef770097f81e4f1e17f1fca253159aa (diff) |
lavc/qsvenc: add VDENC support for H264
Add VDENC(lowpower mode) support for QSV H264
It's an experimental function(like lowpower in vaapi) with
some limitations:
- CBR/VBR require HuC which should be explicitly loaded via i915
module parameter(i915.enable_guc=2 for linux kernel version >= 4.16)
Use option "-low_power 1" to enable VDENC.
Add in dump_video_param() to show the status of VDENC in runtime log.
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r-- | libavcodec/qsvenc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 56a3756357..5b6c68e307 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -226,6 +226,10 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q, av_log(avctx, AV_LOG_VERBOSE, "\n"); #endif +#if QSV_HAVE_VDENC + av_log(avctx, AV_LOG_VERBOSE, "VDENC: %s\n", print_threestate(info->LowPower)); +#endif + #if QSV_VERSION_ATLEAST(1, 8) av_log(avctx, AV_LOG_VERBOSE, "RepeatPPS: %s; NumMbPerSlice: %"PRIu16"; LookAheadDS: ", @@ -475,6 +479,9 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) } } +#if QSV_HAVE_VDENC + q->param.mfx.LowPower = q->low_power ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; +#endif q->param.mfx.CodecProfile = q->profile; q->param.mfx.TargetUsage = avctx->compression_level; q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size); |